Skip to content

Instantly share code, notes, and snippets.

@leighmcculloch
Last active November 11, 2025 21:40
Show Gist options
  • Select an option

  • Save leighmcculloch/3c4fc1593fa77c0442843ecfba15ea9b to your computer and use it in GitHub Desktop.

Select an option

Save leighmcculloch/3c4fc1593fa77c0442843ecfba15ea9b to your computer and use it in GitHub Desktop.
Instructions for how to use the unreleased protocol-25 zk primitives.

To use the protocol-25 zk preview that is not yet released:

Note

This requires workflow requires the stellar-cli, Rust, and Docker (or some other container runtime) to be installed. See the Getting Started documentation for how to install these.

Creating a new contract

Create a new contract with:

stellar contract init .

In the contract Cargo.toml replace the soroban-sdk imports with:

#[dependencies]
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3cf10a984dba03f68b4f2ed653b715063e983bba" }

#[dev-dependencies]
soroban-sdk = { git = "https://github.com/stellar/rs-soroban-sdk", rev = "3cf10a984dba03f68b4f2ed653b715063e983bba", features = ["testutils"] }

Building the contract

Build the contract:

stellar contract build --out-dir out/

Run a local test network with the zk primitives

Run a version of the network supporting the zk primitives:

stellar container start -t future

or

docker run --rm -i --name stellar -p 8000:8000 stellar/quickstart:future --local

Setup an account

Configure the cli to interact with that network:

stellar network use local

Create a key on the local network:

stellar keys generate mykey
stellar keys fund mykey
stellar keys use mykey

Deploying the contract to the local network

Deploy the contract to the local network:

stellar contract deploy --wasm-dir out/<FILE>.wasm --alias mycontract

Invoking the contract

Invoke the contract:

stellar contract invoke --id mycontract -- <FUNCTION_NAME> <ARGS>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment