* stake-pool: Add depositor key on init, required on deposit Some stake pools need to be private, and not allow outside depositors. Enhance the existing deposit authority in the stake pool be configurable on initialization, and then require its signature on deposit. The existing deposit authority is a program address, making deposits permissionless. This allows a pool creator to set their own deposit_authority on initialization. In a great turn of events, almost everything else works the same way! Here's the current workflow for deposit, where the user calls stake_program::authorize and stake_pool::deposit in the same transaction: * stake_program::authorize assigns staker and withdraw authority to the stake pool deposit authority * stake_pool::deposit - uses the deposit authority to assign authority on the deposited stake account to the stake pool withdraw authority - uses the withdraw authority to merge the deposited stake into the validator stake The deposit authority must "sign" the transaction in order to reassign authority to the withdraw authority. Currently, as a program address, it can just do that. With this change, if the deposit authority is set during initialization, then that deposit authority must sign the instruction. There's also a little update for ease-of-use to always do the stake_program::authorize in the same transaction as stake_pool::deposit. This way, in case someone tries to deposit into a forbidden stake pool, the whole transaction will bail and their stake will stay as theirs. * Address review feedback * Fix rebase issues |
||
---|---|---|
.. | ||
cli | ||
program | ||
README.md |
README.md
stake-pool program
A work-in-progress program for pooling together SOL to be staked by an off-chain agent running SoM (Stake-o-Matic).
Each SoM needs at least one pool. Users deposit stakes into the SoM pool and receives a pool token minus the fee. The SoM redistributes the stakes across the network and tries to maximize censorship resistance and rewards.
Full documentation is available at https://spl.solana.com/stake-pool
Javascript bindings are available in the ./js
directory.