exSat Network
  • 🔗Important Links
  • 🌌Our Approach
    • What is exSat
      • exSat’s Docking Layer Approach
      • The Paradigm Shift of the Bitcoin Economic Ecosystem
      • Challenges Addressed by exSat
    • Architecture
      • Data Consensus Protocol
        • Network launch phases
        • Decentralized UTXO index
        • Synchronizers and Validators
        • Hybrid Consensus Mechanism
        • Decentralized execution
      • Decentralized Asset Custody (Coming soon)
      • Enhancing the Bitcoin Ecosystem with Smart Contract Capabilities
      • Expanding Possibilities with Rollups
    • $XSAT Tokenomics
      • Total Supply and Issuance
      • Rewards to Synchronizers and Validators
  • 🛠️Guides of Data Consensus
    • Quick Start
    • UTXO Initialization
      • Data preparation
      • Analysis on the UTXO data tobe uploaded
      • Verify the data uploaded to exSat
    • Run a Sychronizer
      • Requirements for Synchronizers
      • Rewards for synchronizers
      • Run as Synchronizer
        • Run from source code
        • Run with Docker
    • Run a BTC Validator
      • Requirements and rewards for BTC Validators
      • Run as BTC validator
        • Run from source code
        • Run with docker
    • Run a XSAT Validator
      • Run as XSAT Validator
        • Run from source code
        • Run with docker
      • Run multiple XSAT Validators
    • Others
      • Operation references
        • Preparation Before You Start
          • Account Preparation
          • Run a BTC node
          • Environment requirements
          • Prerequisites
        • Synchronizer operations
          • Create New Synchronizer Account
          • Synchronizer Registration
          • Execute the synchronizer client
          • Revote For Consensus
          • Change Reward Address
          • Check and claim rewards for synchronizer
          • Update to new Docker version for Synchronizer
        • Validator operations
          • Create New BTC Validator Account
          • Create New XSAT Validator Account
          • Stake for Validator and claim rewards
          • Change Stake Address
          • Change Commission Address
          • Change Commission Ratio
          • Configure Display Information for Your Validator Account
          • Execute the validator client
          • Update to new Docker version for Validator
        • Common operations
          • Import from seed phrase
          • Import from Private Key
          • Set BTC RPC Node
          • Refill BTC for Gas Fees
          • Export private key
          • Remove Your Account
          • Upgrade to new version
          • View Logs
          • Environment variables
  • 👨‍💻Developer Guides
    • Quick Start
    • Native Layer Developer Guides
      • exSat consensus contracts
        • Pool Register Contract
        • UTXO Management Contract
        • Reward Distribution Contract
        • Block Consensus Contract
        • Block Synchronization Contract
        • Validator Management Contract
        • Staking Contract
      • Run exSat native layer RPC Node
  • 🖥️User Guides
    • Wallet Setup
    • Bridge Your Assets
    • Earn Rewards via BTC Staking
    • Explore Our Ecosystem
  • Popular Token Contract Addresses
  • 📚Reference
  • 📦Cutodian Guides
  • 🔐Security Reports
    • Audit Report From Blocksec
  • 🔡Terms and Conditions
    • Terms Of Service
    • Privacy Policy
  • 🎁PR & Press
  • ☎️Contact US
Powered by GitBook
On this page
  • staking.xsat
  • Actions
  • Quickstart
  • Table Information
  • TABLE globalid
  • TABLE tokens
  • TABLE staking
  • TABLE releases
  • ACTION addtoken
  • ACTION deltoken
  • ACTION setstatus
  • ACTION release
  • ACTION withdraw
  1. Developer Guides
  2. Native Layer Developer Guides
  3. exSat consensus contracts

Staking Contract

staking.xsat

Actions

  • Add a staking token

  • Remove a staking token

  • Set the token's staking disable status

  • Unstake tokens

  • Withdraw tokens that have reached their expiration time

Quickstart

# addtoken @staking.xsat
$ cleos push action staking.xsat addtoken '[{ "sym": "8,BTC", "contract": "btc.xsat" }]' -p staking.xsat

# deltoken @staking.xsat
$ cleos push action staking.xsat deltoken '[1]' -p staking.xsat

# setstatus @staking.xsat
$ cleos push action staking.xsat setstatus '{"id": 1, "disabled_staking": true}' -p staking.xsat

# staking @staker
$ cleos push action btc.xsat transfer '{"from":"alice","to":"staking.xsat","quantity":"1.00000000 BTC", "memo":"alice"}' -p alice

# release @staker
$ cleos push action staking.xsat release '{"staking_id": 1, "staker": "alice", "validator": "alice", "quantity": "1.00000000 BTC"}' -p alice

# withdraw @staker
$ cleos push action staking.xsat withdraw '{"staker": "alice"}' -p alice

Table Information

$ cleos get table rescmng.xsat staking.xsat globalid
$ cleos get table rescmng.xsat staking.xsat tokens
$ cleos get table rescmng.xsat <staker> staking
$ cleos get table rescmng.xsat <staker> releases

TABLE globalid

scope

staking.xsat

params

  • {uint64_t} staking_id - the latest staking id

  • {uint64_t} release_id - the latest release id

example

{
  "staking_id": 1,
  "release_id": 1
}

TABLE tokens

scope

staking.xsat

params

  • {uint64_t} id - token id

  • {uint64_t} token - whitelist token

  • {bool} disabled_staking - whether to disable staking

example

{
  "id": 1,
  "token": { "sym": "8,BTC", "contract": "btc.xsat" },
  "disabled_staking": false
}

TABLE staking

scope staker

params

  • {uint64_t} id - staking id

  • {extended_asset} quantity - total number of staking

example

{
  "id": 1,
  "quantity": {"quantity":"1.00000000 BTC", "contract":"btc.xsat"}
}

TABLE releases

scope staker

params

  • {uint64_t} id - release id

  • {extended_asset} quantity - unpledged quantity

  • {time_point_sec} expiration_time - cancel pledge expiration time

example

{
  "id": 1,
  "quantity": {
      "quantity": "1.00000000 BTC",
      "contract": "btc.xsat"
  },
  "expiration_time": "2024-08-12T08:09:57"
}

ACTION addtoken

  • authority: staking.xsat

Add whitelist token

params

  • {extended_symbol} token - token to add

example

$ cleos push action staking.xsat addtoken '[{ "sym": "8,BTC", "contract": "btc.xsat" }]' -p staking.xsat

ACTION deltoken

  • authority: staking.xsat

Delete whitelist token

params

  • {uint64_t} id - token id to be deleted

example

$ cleos push action staking.xsat deltoken '[1]' -p staking.xsat

ACTION setstatus

  • authority: staking.xsat

Set the token’s disabled staking status.

params

  • {uint64_t} id - token id

  • {bool} disabled_staking - whether to disable staking

example

$ cleos push action staking.xsat setstatus '[1, true]' -p staking.xsat

ACTION release

  • authority: staker

Cancel the pledge and enter the unlocking period.

params

  • {uint64_t} staking_id - staking id

  • {name} staker - staker account

  • {name} validator - the validator account to be pledged to

  • {extended_asset} quantity - unpledged quantity

example

$ cleos push action staking.xsat release '[1, "alice", "alice", "1.00000000 BTC"]' -p alice

ACTION withdraw

  • authority: staker

Withdraw expired staking tokens.

params

  • {name} staker - staker account

example

$ cleos push action staking.xsat withdraw '["alice"]' -p alice
PreviousValidator Management ContractNextRun exSat native layer RPC Node

Last updated 18 days ago

👨‍💻