get_active_tokens
function.starknet-staking
on GitHub (deployed tag)
Parameter | Mainnet | Sepolia |
---|---|---|
Minimum stake for validators | 20K STRK | 1 STRK |
Effective inflation coefficient () | 1.6% | 1.6% |
Withdrawal security lockup | 21 days | 5 minutes |
Epoch length () | 120 blocks | 231 blocks |
Epoch duration | 3600 seconds | 1200 seconds |
Attestation window () | 30 blocks | 30 blocks |
Number of epochs used for latency () | 1 epoch | 1 epoch |
Weight of BTC in staking power () | N/A | 0.25 |
attest
transaction, which must be included within the attestation window. For example, if and is the relative block number assigned to validator , then must submit an attest
transaction between the blocks whose relative number within the epoch are and .
attest
transaction includes the block hash of the attested block, ensuring validators actively use full nodes, as they need to continuously track block hashes. Additionally, the attestation is publicly verifiable, ensuring validators’ reliability is publicly tested — a crucial prerequisite before handing them any core responsibilities.
Contract | Description |
---|---|
Staking | The staking contract is the core of the staking system, managing the entire lifecycle of staking, from initial staking to claiming rewards and unstaking. The staking contract also stores the StakerInfo data structure, which holds detailed information about each validator, including their staked amount, unclaimed rewards, delegation details, and operational parameters, and helps to ensure that validators’ information is accurately tracked and updated. |
Delegation pooling | All delegation interactions, such as entering or exiting a pool, are enabled through the delegation pooling contract, which tracks each delegator’s contribution, calculates their rewards, and manages the delegation lifecycle. The delegation pooling contract also stores the PoolMemberInfo data structure, which holds information about each delegator’s contributions, rewards, and status within the pool, and helps manage and calculate the delegation and reward distribution processes for pool members. |
Reward Supplier | The reward supplier contract is responsible for calculating and supplying the staking rewards based on the minting curve, ensuring the rewards are distributed fairly and in accordance with the protocol’s economic parameters. |
Minting Curve | The minting curve contract defines the economic model that governs reward distribution, ensuring that the network’s inflation is managed while incentivizing participation of stakers. |
Attestation | The attestation contract manages the tracking of successful validator attestations, by verifying whether the validator has correctly attested to their assigned block within a designated attestation window. |
sncast
, Starkli, or a block explorer. To get the onchain addresses of the staking and STRK contracts, see Important addresses.
Procedure | Instructions | Notes |
---|---|---|
Staking | Invoke the staking contract’s stake function | • You should make sure you are running a fully synchronized node before staking • You must first approve the transfer of the amount of STRK tokens to be staked to the staking contract by invoking the STRK contract’s approve function• operational_address should have sufficient funds to pay for attestation transactions• amount should be equal or greater than the minimum stake for validators and denominated in FRI (i.e., 1*1018 = 1 STRK)• Attesting to blocks is only possible starting from the epoch following a successful stake |
Initializing or updating commission | Invoke the staking contract’s set_commission function | • commission should be entered as a percentage with precision, where 10,000 represents 100% (e.g., to set a 5% commission, you enter 500)• Commissions can be increased only after setting a commission commitment using set_commission_commitment |
Opening delegation | Invoke the staking contract’s set_open_for_delegation function | Opening delegation is is only possible after initializing the commission using set_commission |
Claiming rewards | Invoke the staking contract’s claim_rewards function | |
Increasing stake | Invoke the staking contract’s increase_stake function | • amount should be denominated in FRI (i.e., 1*1018 = 1 STRK)• You must first approve the transfer of STRK tokens to the staking contract by invoking the STRK contract’s approve function |
Changing reward address | Invoke the staking contract’s change_reward_address function | |
Changing operational address | Invoke the staking contract’s declare_operational_address and change_operational_address functions | declare_operational_address should be invoked by your new operational address and change_operational_address should be invoked by your staking address |
Unstaking | Invoke the staking contract’s unstake_intent and unstake_action functions | • Once an unstake intent is signaled: • Funds are removed from the total balance and are no longer part of the staking protocol • The same staking address cannot be used to “restake” (i.e., unstake_action is irreversible)• unstake_action should be invoked only after the appropriate waiting period has ended |
Procedure | Instructions | Notes |
---|---|---|
Entering a delegation pool | Invoke the delegation pool contract’s enter_delegation_pool function | • amount should be denominated in the token’s base unit (e.g., FRI for STRK)• You must first approve the transfer of STRK tokens to the delegation pool contract by invoking the STRK contract’s approve function |
Claiming rewards | Invoke the delegation pool contract’s claim_rewards function | |
Adding to a delegation pool | Invoke the delegation pool contract’s add_to_delegation_pool function | • Adding to a delegation pool is only possible after entering it using enter_delegation_pool • amount should be denominated in the token’s base unit (e.g., FRI for STRK)• You must first approve the transfer of STRK tokens to the delegation pool contract by invoking the STRK contract’s approve function |
Switching delegation pools | Invoke the delegation pool contract’s switch_delegation_pool function | To prevent delegator from switching too quickly between validators while still promoting a competitive delegation market, a switch intent that is signaled on epoch takes effect only on epoch . |
Changing reward address | Invoke the delegation pool contract’s change_reward_address function | |
Exiting a delegation pool | Invoke the delegation pool contract’s exit_delegation_pool_intent and exit_delegation_pool_action function | exit_delegation_pool_action should be invoked only after the appropriate waiting period has ended |