Stake Address Commands

The torsten-cli stake-address subcommands manage stake key generation, reward address construction, and certificate creation for staking operations.

key-gen

Generate a stake key pair:

torsten-cli stake-address key-gen \
  --verification-key-file stake.vkey \
  --signing-key-file stake.skey
FlagRequiredDescription
--verification-key-fileYesOutput path for the stake verification key
--signing-key-fileYesOutput path for the stake signing key

build

Build a stake (reward) address from a stake verification key:

torsten-cli stake-address build \
  --stake-verification-key-file stake.vkey \
  --network testnet
FlagRequiredDefaultDescription
--stake-verification-key-fileYesPath to the stake verification key
--networkNomainnetNetwork: mainnet or testnet
--out-fileNoOutput file (prints to stdout if omitted)

registration-certificate

Create a stake address registration certificate:

# Conway era (with deposit)
torsten-cli stake-address registration-certificate \
  --stake-verification-key-file stake.vkey \
  --key-reg-deposit-amt 2000000 \
  --out-file stake-reg.cert

# Legacy Shelley era (no deposit parameter)
torsten-cli stake-address registration-certificate \
  --stake-verification-key-file stake.vkey \
  --out-file stake-reg.cert
FlagRequiredDescription
--stake-verification-key-fileYesPath to the stake verification key
--key-reg-deposit-amtNoDeposit amount in lovelace (Conway era; omit for legacy Shelley cert)
--out-fileYesOutput path for the certificate

The deposit amount should match the current stakeAddressDeposit protocol parameter (typically 2 ADA = 2000000 lovelace).

deregistration-certificate

Create a stake address deregistration certificate to reclaim the deposit:

torsten-cli stake-address deregistration-certificate \
  --stake-verification-key-file stake.vkey \
  --key-reg-deposit-amt 2000000 \
  --out-file stake-dereg.cert
FlagRequiredDescription
--stake-verification-key-fileYesPath to the stake verification key
--key-reg-deposit-amtNoDeposit refund amount (Conway era; omit for legacy Shelley cert)
--out-fileYesOutput path for the certificate

delegation-certificate

Create a stake delegation certificate to delegate to a stake pool:

torsten-cli stake-address delegation-certificate \
  --stake-verification-key-file stake.vkey \
  --stake-pool-id pool1abc... \
  --out-file delegation.cert
FlagRequiredDescription
--stake-verification-key-fileYesPath to the stake verification key
--stake-pool-idYesPool ID to delegate to (bech32 or hex)
--out-fileYesOutput path for the certificate

vote-delegation-certificate

Create a vote delegation certificate (Conway era) to delegate voting power to a DRep:

# Delegate to a specific DRep
torsten-cli stake-address vote-delegation-certificate \
  --stake-verification-key-file stake.vkey \
  --drep-verification-key-file drep.vkey \
  --out-file vote-deleg.cert

# Delegate to always-abstain
torsten-cli stake-address vote-delegation-certificate \
  --stake-verification-key-file stake.vkey \
  --always-abstain \
  --out-file vote-deleg.cert

# Delegate to always-no-confidence
torsten-cli stake-address vote-delegation-certificate \
  --stake-verification-key-file stake.vkey \
  --always-no-confidence \
  --out-file vote-deleg.cert
FlagRequiredDescription
--stake-verification-key-fileYesPath to the stake verification key
--drep-verification-key-fileNoDRep verification key file (mutually exclusive with --always-abstain/--always-no-confidence)
--always-abstainNoUse the special always-abstain DRep
--always-no-confidenceNoUse the special always-no-confidence DRep
--out-fileYesOutput path for the certificate

Complete Staking Workflow

# 1. Generate stake keys
torsten-cli stake-address key-gen \
  --verification-key-file stake.vkey \
  --signing-key-file stake.skey

# 2. Create registration certificate
torsten-cli stake-address registration-certificate \
  --stake-verification-key-file stake.vkey \
  --key-reg-deposit-amt 2000000 \
  --out-file stake-reg.cert

# 3. Create delegation certificate
torsten-cli stake-address delegation-certificate \
  --stake-verification-key-file stake.vkey \
  --stake-pool-id pool1abc... \
  --out-file delegation.cert

# 4. Submit both in a single transaction
torsten-cli transaction build \
  --tx-in "abc123...#0" \
  --tx-out "addr_test1qz...+5000000" \
  --change-address "addr_test1qp..." \
  --fee 200000 \
  --certificate-file stake-reg.cert \
  --certificate-file delegation.cert \
  --out-file tx.body

torsten-cli transaction sign \
  --tx-body-file tx.body \
  --signing-key-file payment.skey \
  --signing-key-file stake.skey \
  --out-file tx.signed

torsten-cli transaction submit \
  --tx-file tx.signed \
  --socket-path ./node.sock