Security
A guarantee that the program running onchain matches the source code, which rules out silent, malicious alterations between repo and deploy.
Community-run · built on solana-verify
Verified builds link a deployed Solana program to its public repository, so anyone can independently check that the bytes running onchain were built from that exact source.
$ cargo install solana-verify --locked $ solana-verify verify-from-repo -um \ --program-id PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY \ https://github.com/Ellipsis-Labs/phoenix-v1 Executable Program Hash from repo: 6877a5b732b3494b828a324ec846d526d962223959534dbaf4209e0da3b2d6a9 On-chain Program Hash: 6877a5b732b3494b828a324ec846d526d962223959534dbaf4209e0da3b2d6a9 Program hash matches ✅
The whole idea, in one comparison
6877a5b732b3494b828a324ec846d526d962223959534dbaf4209e0da3b2d6a9
6877a5b732b3494b828a324ec846d526d962223959534dbaf4209e0da3b2d6a9
Program hash matches ✓
Build the program deterministically in Docker, hash the executable, and compare it with the hash of what is deployed. No discrepancies means the build is verified.
Why verify
A guarantee that the program running onchain matches the source code, which rules out silent, malicious alterations between repo and deploy.
Users and other developers can validate the program themselves by comparing it against the public codebase.
Onchain behaviour demonstrably matches public code. Wallets and tools can allow transactions from verified programs more easily.
Anyone can find your source, docs, SDK or IDL straight from an explorer, and reach you on GitHub when something looks wrong.
A verified build is not automatically more secure than an unverified one. What it does is let anyone confirm the source matches what is deployed, and then read that source to see what a transaction will actually execute.
How it works
solana-verify build copies your workspace into a container and compiles it in a controlled environment. Builds outside Docker are not deterministic across machines and will most likely fail verification.
Deploy the .so produced by the verified build. Don't overwrite it with anchor build or cargo build-sbf — those produce a different hash.
A PDA of the verify program stores the program address, git URL, commit hash and build arguments — everything needed to reproduce the build.
Using the PDA data, anybody can run the verification locally, trustlessly. The OtterSec verify API does the same remotely and feeds explorers.
The verified builds pipeline was designed and is maintained by Ellipsis Labs and OtterSec.
Quick start
Docker gives you the controlled build environment; the CLI is published on crates.io. Make sure the Docker service is running.
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh cargo install solana-verify --locked
Pin a release with --version $VERSION. For production use, prefer installing from a tagged release.
Your repository needs a Cargo.lock in its root. If the program lives in a subfolder, add a workspace Cargo.toml at the root and declare the Solana/Agave version so the tool can pick the right build image.
[workspace] members = ["program/programs/*"] resolver = "2" [workspace.metadata.cli] solana = "4.2.0" [profile.release] overflow-checks = true lto = "fat" codegen-units = 1 [profile.release.build-override] opt-level = 3 incremental = false codegen-units = 1
It is the [lib] name that matters, not the package name. Run cargo generate-lockfile once the workspace file is in place.
Run from the directory containing the workspace Cargo.toml. It is slower than a native build, especially on Apple Silicon; x86 Linux is fastest.
solana-verify build # several programs in one repo? pick one by library name solana-verify build --library-name $PROGRAM_LIB_NAME solana-verify get-executable-hash target/deploy/$PROGRAM_LIB_NAME.so
A multisig or governance solution such as Squads is recommended for deployments, but a direct deploy works too. Then confirm the onchain hash equals your executable hash.
solana program deploy -u $NETWORK_URL target/deploy/$PROGRAM_LIB_NAME.so \ --program-id $PROGRAM_ID --with-compute-unit-price 50000 \ --max-sign-attempts 100 --use-rpc solana-verify get-program-hash -u $NETWORK_URL $PROGRAM_ID
Rebuilds the source at the given commit and compares hashes. When prompted, say yes to uploading the verification data onchain — explorers and the remote API read it from there.
solana-verify verify-from-repo -u $NETWORK_URL \ --program-id $PROGRAM_ID https://github.com/$REPO_PATH \ --commit-hash $COMMIT_HASH \ --library-name $PROGRAM_LIB_NAME \ --mount-path $MOUNT_PATH
--mount-path is the folder holding the Cargo.toml with your library name. Without --commit-hash, the latest commit on the default branch is used.
Queue an independent build on the OtterSec worker. The uploader is the address that wrote the PDA — normally the program's upgrade authority.
solana-verify remote submit-job -u $NETWORK_URL \ --program-id $PROGRAM_ID --uploader $UPLOADER_PUBKEY solana-verify remote get-job-status --job-id $JOB_ID
The server is chosen from the cluster: verify.osec.io for mainnet, verify-devnet.osec.io for devnet; pass --remote-url for anything else. The old --remote flag on verify-from-repo is deprecated. Use a paid RPC URL to avoid public rate limits.
Check a program
Paste a mainnet program ID. The lookup goes straight from your browser to the public OtterSec verify API — nothing is stored here.
In the wild
solana-verify verify-from-repo -um --program-id PhoeNiXZ8ByJGLkxNfZRnkUfjvmuYqLR89jjFHGqdXY https://github.com/Ellipsis-Labs/phoenix-v1
6877a5b732b3494b828a324ec846d526d962223959534dbaf4209e0da3b2d6a9
solana-verify verify-from-repo https://github.com/Squads-Protocol/squads-mpl --commit-hash c95b7673d616c377a349ca424261872dfcf8b19d --program-id SMPLecH534NA9acpos4G6x7uf3LWbCAwZQE9e8ZekMu -um --library-name squads_mpl --bpf
72da599d9ee14b2a03a23ccfa6f06d53eea4a00825ad2191929cbd78fb69205c
solana-verify verify-from-repo -um --program-id dRiftyHA39MWEi3m9aunc5MzRF1JYuBsbn6VPcn33UH https://github.com/drift-labs/protocol-v2 --commit-hash 110d3ff4f8ba07c178d69f9bfc7b30194fac56d6 --library-name drift
e31d58edeabc3c30bf6f2aa60bfaa5e492b41ec203e9006404b463e5adee5828
solana-verify verify-from-repo -um --program-id MFv2hWf31Z9kbCa1snEPYctwafyhdvnV7FZnsebVacA https://github.com/mrgnlabs/marginfi-v2 --commit-hash d33e649e415c354cc2a1e3c49131725552d69ba0 --library-name marginfi -- --features mainnet-beta
890d68f48f96991016222b1fcbc2cc81b8ef2dcbf280c44fe378c523c108fad5
Status badges and hashes are fetched live from the OtterSec API. After a program upgrade it reads as not verified until the new build is verified again. Squads needs --library-name because its repo holds several programs, and --bpf because it was originally verified with Anchor.
Multisig
Remote verification needs the verification data written to a PDA signed by the program authority. A multisig can't answer a CLI prompt, so you export that transaction and run it through the multisig instead.
solana-verify build and deploy the resulting binary.verify-from-repo locally to confirm your parameters.solana-verify export-pda-tx https://github.com/$REPO_PATH \ --program-id $PROGRAM_ID \ --uploader $MULTISIG_AUTHORITY \ --encoding base58 --compute-unit-price 0
solana-verify remote submit-job \ --program-id $PROGRAM_ID \ --uploader $MULTISIG_AUTHORITY
solana-verify build solana program write-buffer target/deploy/$PROGRAM_LIB_NAME.so \ --with-compute-unit-price 50000 --max-sign-attempts 50 solana program set-buffer-authority $BUFFER \ --new-buffer-authority $MULTISIG_AUTHORITY
If the build is already published as an image, compare the executable inside it with the onchain program — no full rebuild needed.
solana-verify verify-from-image \ -e examples/hello_world/target/deploy/hello_world.so \ -i ellipsislabs/hello_world_verifiable_build:latest \ -p 6EstieBS8jB6jhcE5Ax7cmAenZxxNXHvE5BnHZbxpump
Embed contact details in the program itself so researchers can reach you from just an address. Maintained by Neodyme Labs.
security_txt! {
name: "MyProject",
project_url: "https://myproject.com",
contacts: "email:security@myproject.com",
policy: "https://myproject.com/security-policy",
source_code: "https://github.com/you/your-program"
}Add solana-security-txt = "1.1.1" and prefer links for details that may change.
Trust model
Verified builds are powerful, but the default setup is not completely trustless. Know where the assumptions are.
Default Docker images are built and hosted by the Solana Foundation, and your whole project directory is copied into the container — including anything sensitive in it.
Go trustless: build and host the images yourself from the scripts in the solana-verifiable-build repository.
Remote verification trusts the OtterSec API and whichever explorer displays the result. A compromised service could show incorrect information.
Go trustless: run the verify API yourself, or just run verify-from-repo locally against the onchain PDA data.
The onchain verify program verifycLy8mB96wd9wqq3WDXQwM4oU6r42Th37Db9fC is deployed by OtterSec and is not frozen, so it can be upgraded.
Verification proves source ↔ binary. It does not audit the source. Always review the code.
cargo install solana-verify --locked