Staking
Staking in Züs Network involves locking tokens into a stake pool to support various network participants.
The primary objectives of staking are:
Security: Ensures only reliable and well-funded providers operate in the network.
Incentives: Rewards participants for providing services.
Decentralization: Enables users to participate in governance and network operation.
There are five main types of staking providers in Züs:
Blobbers - Storage providers who store and maintain user data.
Validators - Verify storage challenges and ensure data integrity.
Miners - Participate in transaction validation and block production.
Sharders - Store blockchain metadata and help retrieve historical data.
Authorizers - Manage token bridging between blockchains.
Each provider type has unique staking requirements and rewards based on network contribution.
Staking Mechanism
Users can stake tokens into stake pools of different providers, where tokens are locked and used to determine rewards and penalties.
Stake Pools
Each provider has a stake pool where staked tokens accumulate. The total stake affects:
The weight of the provider in earning rewards.
Their ability to participate in network operations.
The penalty mechanism for failing to meet obligations.
Stake Delegation
Users who do not run a provider node can still delegate their tokens to existing providers and earn a share of the rewards.
Higher stake → More rewards.
Stake remains locked for a defined period.
Providers take a commission before distributing rewards.
Staking Process
The Züs Network allows staking to different service providers, including blobbers, validators, miners, sharders, and authorizers.
Users can lock their tokens in stake pools to earn rewards based on the provider’s performance and stake weight. Here are key Stake-Related Functions in Go SDK
StakePoolLock
- Locks tokens into a stake pool.StakePoolUnlock
- Unlocks staked tokens when eligible.WritePoolLock
- Locks tokens in a write pool for storage payments.WritePoolUnlock
- Unlocks tokens from the write pool.
1. Locking Tokens in a Stake Pool
The StakePoolLock
function locks tokens into a stake pool, allowing users to delegate their stake to providers and earn rewards.
Here is how it works:
The function validates that the SDK is initialized.
Ensures a valid provider type and ID.
Constructs a stake pool request and identifies the correct smart contract:
Blobber/Validator:
STORAGESC_STAKE_POOL_LOCK
Miner/Sharder:
MINERSC_LOCK
Authorizer:
ZCNSC_LOCK
Calls
transaction.SmartContractTxnValueFeeWithRetry
to execute the staking transaction.
Example Usage
Unlocking Tokens from a Stake Pool
The StakePoolUnlock
function allows users to withdraw their staked tokens when eligible.
Here is how it works:
The function validates that the SDK is initialized.
Ensures the provider type and ID are valid.
Calls the correct smart contract method:
Blobber/Validator:
STORAGESC_STAKE_POOL_UNLOCK
Miner/Sharder:
MINERSC_UNLOCK
Authorizer:
ZCNSC_UNLOCK
Executes the transaction and returns the amount unstaked.
Example Usage
Locking Tokens in the Write Pool
The WritePoolLock
function allows users to lock tokens into a write pool, which is used for storage payments.
Here is how it works:
Ensures the SDK is initialized.
Locks tokens for a specific allocation (
allocID
).Calls the
STORAGESC_WRITE_POOL_LOCK
smart contract.
Example Usage
4. Unlocking Tokens from the Write Pool
The WritePoolUnlock
function allows users to unlock all tokens from the write pool.
Here is how it works:
Ensures SDK is initialized.
Unlocks all unused tokens from the write pool for a given allocation (
allocID
).Calls the
STORAGESC_WRITE_POOL_UNLOCK
smart contract.
Example Usage
Last updated