Skip to content
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

53 changes: 48 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,52 @@
## Solana Program Library Single-Validator Stake Pool
# Single-Validator Stake Pool

The single-validator stake pool program is an upcoming SPL program that enables liquid staking with zero fees, no counterparty, and 100% capital efficiency.
Fully permissionless liquid staking.

The program defines a canonical pool for every vote account, which can be initialized permissionlessly, and mints tokens in exchange for stake delegated to its designated validator.
| Information | Account Address |
| --- | --- |
| Single Pool | `SVSPxpvHdN29nkVg9rPapPNDddN5DipNLRUFhyjFThE` |

The program is a stripped-down adaptation of the existing multi-validator stake pool program, with approximately 80% less code, to minimize execution risk.
## Overview

On launch, users will only be able to deposit and withdraw active stake, but pending future stake program development, we hope to support instant sol deposits and withdrawals as well.
The Single-Validator Stake Pool is an onchain program that enables liquid staking with zero fees, no counterparty, and 100% capital efficiency. The program defines a canonical pool for every vote account, which can be initialized permissionlessly, and mints tokens in exchange for stake delegated to its designated validator.

The program also allows permissionless harvesting of Jito tips and other MEV rewards, turning liquid sol paid into the stake account into active stake earning rewards, functionally distributing these earnings to all LST holders just like protocol staking rewards.

Users can only deposit and withdraw active stake, but liquid sol deposit is coming in a future update.

## Security Audits

The Single Pool Program has received three external audits:

* Zellic (2024-01-02)
- Review commit hash [`ef44df9`](https://github.com/solana-program/single-pool/commit/ef44df985e76a697ee9a8aabb3a223610e4cf1dc)
- Final report <https://github.com/anza-xyz/security-audits/blob/master/spl/ZellicSinglePoolAudit-2024-01-02.pdf>
* Neodyme (2023-08-08)
- Review commit hash [`735d729`](https://github.com/solana-program/single-pool/commit/735d7292e35d35101750a4452d2647bdbf848e8b)
- Final report <https://github.com/anza-xyz/security-audits/blob/master/spl/NeodymeSinglePoolAudit-2023-08-08.pdf>
* Zellic (2023-06-21)
- Review commit hash [`9dbdc3b`](https://github.com/solana-program/single-pool/commit/9dbdc3bdae31dda1dcb35346aab2d879deecf194)
- Final report <https://github.com/anza-xyz/security-audits/blob/master/spl/ZellicSinglePoolAudit-2023-06-21.pdf>

## Building and Verifying

To build the Single Pool Program, you can run `cargo-build-sbf` or use the Makefile
command:

```console
cargo build-sbf --manifest-path program/Cargo.toml
make build-sbf-program
```

The BPF program deployed on all clusters is built with [solana-verify](https://solana.com/developers/guides/advanced/verified-builds). It may be verified independently by comparing the output of:

```console
solana-verify get-program-hash -um SVSPxpvHdN29nkVg9rPapPNDddN5DipNLRUFhyjFThE
```

with:

```console
solana-verify build --library-name program
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like the build works with this command, but in my testing and looking at the source code, I think --library-name takes the crate name:

Suggested change
solana-verify build --library-name program
solana-verify build --library-name spl_single_pool

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

im not sure what you mean by "the build works with this command [but] --library-name takes the crate name." like both work but the latter is preferred for style? ive always built by giving it program

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean that it'll build the program, but the CLI code is expecting spl_single_pool as the input, to show the build hash afterwards

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

39bf1d3

thats funny, im definitely not the only one because ive had people ask about the parse error solana-verify gives at the end and been like "oh dont worry it just does that for some reason, the build still worked"

solana-verify get-executable-hash target/deploy/spl_single_pool.so
```
2 changes: 2 additions & 0 deletions clients/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ serde = "1.0.219"
serde_derive = "1.0.103"
serde_json = "1.0.142"
serde_with = "3.13.0"
solana-account = "2.2"
solana-account-decoder = "2.3.4"
solana-borsh = "3.0"
solana-clap-v3-utils = "2.3.4"
Expand All @@ -43,6 +44,7 @@ solana-stake-program = "2.2"
solana-transaction = "2.2"
solana-transaction-status = "2.3.4"
solana-vote-program = "2.2"
spl-associated-token-account = { version = "7.0", features = ["no-entrypoint"] }
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: not a big deal since this is a CLI crate, but spl-associated-token-account-interface has what you need with fewer deps

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spl-token = { version = "8.0", features = ["no-entrypoint"] }
spl-token-client = { version = "0.16.1" }
spl-single-pool = { version = "2.0.0", path = "../../program", features = [
Expand Down
Loading