sequenceDiagram
autonumber
participant StakeClient as Sample stake<br> client application
participant StakeAPI as Stake Intent API
participant Blockchain as Blockchain RPC API
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, withdrawal & recipient address)
StakeClient ->> Blockchain: get blockchain inputs (gas, nonce) for new tx<br>(sender wallet)
StakeClient ->> StakeClient: construct unsigned tx
StakeClient ->> TSM1: request signature (unsigned tx)
TSM1 -->> StakeClient: return partial signature
StakeClient ->> TSM2: request signature (unsigned tx)
TSM2 -->> StakeClient: return partial signature
StakeClient ->> StakeClient: combine partial signatures
StakeClient ->> Blockchain: broadcast signed tx<br>(signed tx, deposit contract)
- Golang 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 for free Blockdaemon RPC API key and set in .env as BLOCKDAEMON_API_KEY
- Register for free Blockdaemon Staking API key and set in .env as BLOCKDAEMON_STAKE_API_KEY
cd ethereum-staking/buildervault/golang/
cp .env.example .env
- update .env with API keys
go run main.go
- note, on first run this step will fail as the wallet address has no funds
- copy the new Ethereum wallet address and fund the account
Step 4. Launch main.go to generate the Stake Intent request, sign the request with BuilderVault and broadcast the transaction
go run main.go
- (optional) decode the raw signed transaction to inspect the Blockdaemon provided attributes (https://rawtxdecode.in)
- observe the confirmed transaction through the generated blockexplorer link