ADA to TAO Staking Technical Details: Cardano’s staking certificates and their role in transaction metadata

🔍 1. Overview

Cardano uses staking certificates to manage the lifecycle of stake keys and their association with stake pools. These certificates are CBOR-encoded structures embedded in the transaction body metadata.

Three main certificate types:

  1. stake_key_registration_certificate Registers a stake key on-chain so it can participate in delegation or staking rewards.
  2. stake_delegation_certificate Delegates the registered stake key to a specific stake pool.
  3. stake_deregistration_certificate Deregisters a stake key from the ledger, which effectively ceases its staking capabilities and may refund the deposit.

🔧 2. Sample: Generating a Delegation Certificate

cardano-cli stake-address delegation-certificate \
--stake-verification-key-file stake.vkey \
--cold-verification-key-file pool.vkey \
--out-file delegation.cert

This generates a CBOR-encoded file (delegation.cert) containing:

  • The hash of the stake key (derived from stake.vkey)
  • The pool ID (hash of the pool’s cold key from pool.vkey)
  • The network ID (mainnet/testnet identifier)

📦 3. CBOR Serialization Format

Internally, the certificate is serialized according to Cardano’s CBOR format, as specified in Cardano Ledger specifications (Shelley Era).

For a stake delegation certificate, the CBOR structure is typically:

[
2, // Certificate type: Delegation
[
0, // Credential type: KeyHash (as opposed to ScriptHash)
<28-byte Stake Key Hash> // Hash of the stake verification key
],
<28-byte Pool Key Hash> // Pool ID (cold key hash)
]

For reference:

Certificate TypeCBOR Tag
stake key registration0
stake key deregistration1
stake delegation2

Each of these structures is embedded in the transaction body, which itself is CBOR-encoded and includes:

  • Inputs
  • Outputs
  • Fee
  • TTL (time-to-live)
  • [Certificates] (array of staking certificates)
  • Withdrawals (optional)
  • Auxiliary data hash (optional)

🛠️ 4. Important Metadata Fields in Delegation Certificate

FieldDescription
Stake Key Hash28-byte Blake2b-224 hash of the stake key
Pool ID28-byte Blake2b-224 hash of the pool’s cold key
Network IDDistinguishes mainnet (1) from testnet (0)

⚠️ 5. Additional Notes:

  • cardano-cli abstracts the complexity of generating this CBOR structure.
  • When submitting a transaction with this certificate, the transaction must also be signed by the corresponding stake key (for proof of ownership) and by the payment key funding the transaction (to pay fees).
  • These certificates are essential for controlling staking rights and rewards without transferring ADA.

Here’s a real example showing how to generate a stake delegation certificate, then inspect and decode its CBOR structure manually to understand what’s inside.

Do you know what staking is ? Staking on the blockchain refers to the process where participants lock up a certain amount of cryptocurrency to support the operations and security of a blockchain network. In return, they earn rewards, typically in the form of additional cryptocurrency. Staking is often associated with proof-of-stake (PoS) or similar consensus mechanisms used by many blockchains.

INVEST