Evolution SDK
Staking

Stake Key Registration

Register stake credentials on the Cardano blockchain

Stake Key Registration

Before you can delegate or earn rewards, your stake credential must be registered on-chain. Registration requires a deposit (currently 2 ADA on mainnet) which is refunded when you deregister.

Basic Registration

import { ,  } from "@evolution-sdk/evolution"

const  = ({
  : "preprod",
  : { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
  : { : "seed", : ..!, : 0 }
})

declare const : .

const  = await 
  .()
  .({  })
  .()

const  = await .()
await .()

The deposit amount is fetched automatically from protocol parameters.

Register and Delegate Together

The Conway era introduced combined certificates that register and delegate in one step, saving a certificate fee:

import { ,  } from "@evolution-sdk/evolution"

const  = ({
  : "preprod",
  : { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
  : { : "seed", : ..!, : 0 }
})

declare const : .
declare const : any
declare const : any

// Register + delegate to pool in one certificate
const  = await 
  .()
  .({
    ,
    
  })
  .()

const  = await .()
await .()

You can also combine registration with DRep delegation or both:

import { ,  } from "@evolution-sdk/evolution"

const  = ({
  : "preprod",
  : { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
  : { : "seed", : ..!, : 0 }
})

declare const : .
declare const : any
declare const : any

// Register + delegate to both pool and DRep
const  = await 
  .()
  .({
    ,
    ,
    
  })
  .()

const  = await .()
await .()

Script-Controlled Registration

For stake credentials controlled by Plutus scripts, provide a redeemer:

import { , ,  } from "@evolution-sdk/evolution"

const  = ({
  : "preprod",
  : { : "blockfrost", : "https://cardano-preprod.blockfrost.io/api/v0", : ..! },
  : { : "seed", : ..!, : 0 }
})

declare const : .
declare const : any

const  = await 
  .()
  .({
    : ,
    : .(0n, []),
    : "register-script-stake"
  })
  .({ :  })
  .()

const  = await .()
await .()

Next Steps