☁️
Zus Docs
  • About Züs
  • System
    • Providers and Services
      • Miner
      • Sharder
      • Blobber
      • Validator
      • Authorizer
      • Node Locator (0DNS)
    • Storage
      • Architecture and Data Management
      • Protocol
        • Allocations
        • Reference Objects
        • Challenges
        • Write Markers
          • Chain Hashing
          • Two Commit
        • Blobber Repair Protocol
      • ZS3 Server
        • Backup, Recovery and Replication
        • Encryption and Compression
        • S3FS Setup and Usage
        • Backup & Recovery with Restic on Blimp + ZS3 Server
        • Backup & Recovery with Veeam on Blimp + ZS3 Server
      • File Operations
        • Upload
        • Download
        • File Sharing
        • Partial Error Recovery
        • Streaming
        • Rent a Blobber
    • Smart Contracts
      • Storage S.C.
      • Miner S.C.
      • ZCN S.C.
      • ERC-20 S.C.s
      • Bridge Protocol
    • Blockchain & Consensus
      • Entities
    • User Authentication and Wallet Management System
      • OKTA Integration
      • Key Management System (KMS)
  • APIs
    • 0DNS API
    • JS API
    • Mobile API
  • CLIs
    • Storage CLI
      • Quickstart
      • Configuring the tool
    • Wallet CLI
      • Wallet Configuration
      • Quickstart
      • Configuring the tool
  • SDKs
    • Go SDK
      • GO SDK Microservices
    • JS SDK
  • Tokenomics
    • Staking
    • Reward & Penalty
  • ✨Züs Apps
    • 🗝️Vult
      • Getting Started
        • Web
        • Mobile
      • Vult AI
        • Batch Processing
        • Memory Retention
        • Technical Implementation
        • Architecture Overview
      • Login / Register
      • File Management Pages
      • File Sharing
      • Storage Management Dashboard
      • Storage Maintenance and Troubleshooting
      • Züs Subscription
      • Wallet Management
      • Refer a friend
      • Settings
    • 🏗️Blimp
      • Getting Started
      • Login / Register
      • Configure Storage
        • Create Standard Storage Allocation
        • Create Enterprise Allocation
        • Create S3 Server Allocation
        • Create Cloud Migration Allocation
        • Allocation Maintenance and Troubleshooting
      • File Management Pages
      • File Sharing
      • Manage Allocations
      • Upgrade Storage
      • Blimp Vault
      • Refer a friend
      • Settings
      • Launching ZS3 Server
      • Using CLI to backup files into Blimp + ZS3 Server
    • 🏠Chimney
      • Getting Started
      • Login / Register
      • Create New Deployment
      • Manage Your Deployments
      • Homepage
      • Staking Dashboard
      • Rank Dashboard
      • Monitor Dashboard
      • Stats Dashboard
      • Logs Dashboard
      • Wallet Dashboard
      • Operations on your Deployments
      • Restricted Blobbers
      • Settings
        • Manage Profile
        • Wallet Settings
        • Update Blobber Settings
        • Update Blobber Version
        • Refer a friend
        • Help
    • 🌐Atlus
      • Getting Started
      • Home page
      • Service Providers Page
      • Charts Page
        • Market Charts
        • Network Charts
        • Storage Charts
      • Blockchain Page
      • Server Map Page
      • Storage Explainer Page
      • Details Pages
        • Block Details Page
        • Transaction Details Page
        • Wallet Details Page
        • Miner Details Page
        • Sharder Details Page
        • Blobber Details Page
        • Validator Details Page
        • Authorizer Details Page
        • Allocation Details Page
      • Appendix: Common Components
    • ⚡Bolt
      • Getting Started
        • Web
        • Mobile
      • Login / Register
      • Sign In with external wallet
      • Staking Dashboard
      • Staking/Unstaking a provider
      • Claiming Rewards
      • Send/Receive ZCN tokens
      • Buy ZCN
      • Deposit/Withdraw ZCN tokens
      • Activity Dashboard
      • Refer a friend
      • Settings
  • Releases
    • Hardfork
Powered by GitBook
On this page
  • Staking Mechanism
  • Staking Process
  • 4. Unlocking Tokens from the Write Pool
  1. Tokenomics

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:

  1. Blobbers - Storage providers who store and maintain user data.

  2. Validators - Verify storage challenges and ensure data integrity.

  3. Miners - Participate in transaction validation and block production.

  4. Sharders - Store blockchain metadata and help retrieve historical data.

  5. 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

  1. StakePoolLock - Locks tokens into a stake pool.

  2. StakePoolUnlock - Unlocks staked tokens when eligible.

  3. WritePoolLock - Locks tokens in a write pool for storage payments.

  4. 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.

func StakePoolLock(providerType ProviderType, providerID string, value, fee uint64) (hash string, nonce int64, err error)

Here is how it works:

  1. The function validates that the SDK is initialized.

  2. Ensures a valid provider type and ID.

  3. Constructs a stake pool request and identifies the correct smart contract:

    • Blobber/Validator: STORAGESC_STAKE_POOL_LOCK

    • Miner/Sharder: MINERSC_LOCK

    • Authorizer: ZCNSC_LOCK

  4. Calls transaction.SmartContractTxnValueFeeWithRetry to execute the staking transaction.

Example Usage

hash, nonce, err := StakePoolLock(ProviderBlobber, "blobber-123", 1000, 10)
if err != nil {
    fmt.Println("Error staking:", err)
} else {
    fmt.Println("Stake transaction successful! Hash:", hash)
}

Unlocking Tokens from a Stake Pool

The StakePoolUnlock function allows users to withdraw their staked tokens when eligible.

func StakePoolUnlock(providerType ProviderType, providerID, clientID string, fee uint64) (unstake int64, nonce int64, err error)

Here is how it works:

  1. The function validates that the SDK is initialized.

  2. Ensures the provider type and ID are valid.

  3. Calls the correct smart contract method:

    • Blobber/Validator: STORAGESC_STAKE_POOL_UNLOCK

    • Miner/Sharder: MINERSC_UNLOCK

    • Authorizer: ZCNSC_UNLOCK

  4. Executes the transaction and returns the amount unstaked.

Example Usage

goCopyEditunstake, nonce, err := StakePoolUnlock(ProviderBlobber, "blobber-123", "client-id", 10)
if err != nil {
    fmt.Println("Error unlocking stake:", err)
} else {
    fmt.Println("Stake unlocked:", unstake)
}

Locking Tokens in the Write Pool

The WritePoolLock function allows users to lock tokens into a write pool, which is used for storage payments.

func WritePoolLock(allocID string, tokens, fee uint64) (hash string, nonce int64, err error)

Here is how it works:

  1. Ensures the SDK is initialized.

  2. Locks tokens for a specific allocation (allocID).

  3. Calls the STORAGESC_WRITE_POOL_LOCK smart contract.

Example Usage

hash, nonce, err := WritePoolLock("allocation-456", 500, 5)
if err != nil {
    fmt.Println("Error locking write pool:", err)
} else {
    fmt.Println("Write pool locked successfully! Hash:", hash)
}

4. Unlocking Tokens from the Write Pool

The WritePoolUnlock function allows users to unlock all tokens from the write pool.

func WritePoolUnlock(allocID string, fee uint64) (hash string, nonce int64, err error)

Here is how it works:

  1. Ensures SDK is initialized.

  2. Unlocks all unused tokens from the write pool for a given allocation (allocID).

  3. Calls the STORAGESC_WRITE_POOL_UNLOCK smart contract.

Example Usage

hash, nonce, err := WritePoolUnlock("allocation-456", 5)
if err != nil {
    fmt.Println("Error unlocking write pool:", err)
} else {
    fmt.Println("Write pool unlocked successfully! Hash:", hash)
}
PreviousTokenomicsNextReward & Penalty

Last updated 1 month ago