Blog · Guides · 6 min read

Solana verifiable builds explained: what they prove and how to set one up

By Orivions team ·

A Solana verifiable build proves that the program running on-chain was compiled from a specific commit of a public repository: anyone can rebuild that commit in the same Docker environment and get the same hash. It does not prove the code is secure, so treat it as the link between your audit and your deployment, not as a replacement for the audit.

Verifiable build in five steps
StepWhat you doCommand or check
1. Public repoPush the exact commit you will deploy to a public repositoryPin the Solana version and commit Cargo.lock
2. BuildBuild inside the official Docker image, not with your local toolchainsolana-verify build
3. DeployDeploy the .so file from that build, unchangedsolana program deploy
4. CompareCheck that the on-chain hash matches a fresh build of the commitsolana-verify verify-from-repo
5. PublishStore the verification data on-chain and request a remote checksolana-verify remote submit-job

Repeat steps 2 to 5 after every upgrade. An upgrade marks the program as unverified until the new version is verified.

Key takeaways
  • A verifiable build links the on-chain program to one commit of public source code.
  • It proves where the code came from, not that the code is safe. Verified is not audited.
  • Build in Docker with solana-verify, deploy that exact file, then verify and publish the result.
  • Only the upgrade authority can publish the verification data, so a multisig signs it too.
  • Every upgrade needs a new verification, tied to the new commit.

An audit report names a commit. Users interact with bytes on-chain. Without a verifiable build, nobody outside your team can confirm that those two are the same code. Solana program builds are not deterministic across machines, so building on a laptop and comparing hashes usually fails even when nothing is wrong. Verifiable builds fix that by building in a fixed Docker environment.

What a verifiable build proves, and what it does not

That is why a verifiable build is most useful next to an audit: the report says which commit was reviewed, and the verification shows that commit, or a later reviewed one, is what runs on mainnet. Our guide on how to read a smart contract audit report shows where to find the commit in a report.

How to set one up

You need Docker, Cargo and the solana-verify CLI, and the source must be in a public repository. Private repositories cannot be verified, because the whole point is that anyone can rebuild the code.

cargo install solana-verify --locked

# build in the Docker image that matches your Solana version
solana-verify build --library-name $PROGRAM_LIB_NAME
solana-verify get-executable-hash target/deploy/$PROGRAM_LIB_NAME.so

# deploy that exact file, then compare with the on-chain program
solana-verify get-program-hash -u $NETWORK_URL $PROGRAM_ID
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

# after uploading the verification data, request the remote check
solana-verify remote submit-job -u $NETWORK_URL --program-id $PROGRAM_ID --uploader $UPLOADER

Set the Solana version in the root Cargo.toml so the tool can pick the right build image. Use the library name, not the package name. Do not rebuild with anchor build or cargo build-sbf after solana-verify build, since that overwrites the file with one that will not match. Add --mount-path when the program lives in a subfolder of the repository.

At the end, verify-from-repo asks whether to upload the verification data on-chain. That data sits in an account derived from your program address and holds the repository URL, the commit and the build arguments. Then remote submit-job asks a public verification service to rebuild and compare. Once it succeeds, explorers such as Solana Explorer, SolanaFM and Solscan show the program as verified. The service re-checks verified programs every 24 hours.

If the upgrade authority is a multisig

Only the upgrade authority can publish the verification data. This stops someone else from attaching a different repository to your program. If the authority sits in a multisig, export the transaction with solana-verify export-pda-tx, have the signers approve it in the multisig, and pass the multisig address as --uploader when you submit the remote job. Do this again after each upgrade. Our guide on moving the upgrade authority to a multisig covers the authority setup itself.

Why the hash does not match: a different Rust or Solana toolchain, dependencies that changed between builds, a build outside Docker, or the wrong commit checked out. Build with solana-verify build from the exact commit you deployed and compare again.

How to check a program you depend on or paid for

If a development company is deploying for you, write the verifiable build into the final milestone, next to handing the authority to your multisig. Then the deployment you pay for can be checked by anyone.

Where it fits before launch

A verifiable build is one item in the Solana pre-launch security checklist, after the audit and the fix review and before monitoring. Plan it into your incident response plan too, so an emergency fix is verified once the dust settles. To find a reviewer for the commit you will verify, browse the Solana smart contract audit providers we have checked.

Want to see who can upgrade a program right now? Paste its address into the free upgrade authority checker.

Frequently asked questions

What is a verifiable build on Solana?

A build made in a fixed Docker environment from a specific commit of a public repository, so anyone can rebuild it and get the same hash as the program on-chain. The repository, commit and build arguments are stored on-chain.

Does a verified program mean it is safe?

No. Verification only confirms that the deployed program matches the published source. It says nothing about bugs. Check the audit report for the same commit, and check who holds the upgrade authority.

Why does my local build hash not match the on-chain hash?

Usually a different Rust or Solana toolchain, changed dependencies, a build outside Docker or the wrong commit. Build with solana-verify build from the exact commit you deployed and compare again.

Do I need to verify again after an upgrade?

Yes. An upgrade removes the verified status. Update the on-chain verification data with the new commit, signed by the upgrade authority, and submit a new remote verification job.

Can I verify a program from a private repository?

No. Verification needs public source code, because anyone must be able to rebuild the commit and read what the program does.

Need an audit that ends in a verified deployment?

Tell us what you are launching. We suggest audit providers we checked by hand, with a reason for each. Free for teams.

Get matched →

Looking for help with this? Browse Solana smart contract audit providers, or describe your project and get matched for free.

Related reading

← All posts