sequenceDiagram
autonumber
participant StakeClient as Sample stake<br> client application
participant StakeAPI as Stake Intent API
participant Blockchain as Solana RPC
box Builder Vault
participant TSM1 as MPC Wallet <br>(private key share 1)
participant TSM2 as MPC Wallet <br>(private key share 2)
end
StakeClient ->> StakeAPI: get StakeIntent unsigned tx data <br>(amount, validator vote account, delegator)
StakeClient ->> StakeClient: construct unsigned tx
StakeClient ->> Blockchain: get blockchain inputs (gas fee) for new tx<br>(sender wallet)
StakeClient ->> Blockchain: check delegator account balance for stake<br>(sender wallet)
StakeClient ->> TSM1: request signature (unsigned tx hash)
TSM1 -->> StakeClient: return partial signature
StakeClient ->> TSM2: request signature (unsigned tx hash)
TSM2 -->> StakeClient: return partial signature
StakeClient ->> StakeClient: combine partial signatures <br> add signature to tx <br> verify tx signatures
StakeClient ->> Blockchain: broadcast full signed tx<br>(signed tx)
- Node.js or launch in code-spaces
- Register for a demo Builder Vault tenant: https://www.blockdaemon.com/get-started/builder-vault-sandbox-registration
- Download SDK bundle provided in registration email (extract authentication certificates)
- Place Builder Vault authentication certificate key-pair
client.crt
&client.key
in this nodejs folder
- Register free Blockdaemon RPC API key and set in .env as BLOCKDAEMON_API_KEY
- Register free Blockdaemon Staking API key and set in .env as BLOCKDAEMON_STAKE_API_KEY
cd solana-staking/buildervault/nodejs/
cp .env.example .env
- update .env with API keys
- set the public NPM repository for the BuilderVault Node.js SDK
npm config set @sepior:registry=https://gitlab.com/api/v4/projects/56306653/packages/npm/
npm install
npm run start solana-stake-bv.ts
- note, on first run this step will fail as the wallet address has no funds
- copy the new Solana wallet address and fund the account
- https://solfaucet.com
- https://faucet.triangleplatform.com/solana/testnet
- https://faucet.quicknode.com/solana/testnet
- https://solfate.com/faucet
Step 5. Launch solana-stake-bv.ts to generate the Stake Intent request, sign the request with BuilderVault and broadcast the transaction
npm run start solana-stake-bv.ts
- [optional] view the signed transaction contents with inspector: https://explorer.solana.com/tx/inspector?cluster=testnet
- observe the confirmed transaction through the generated blockexplorer link