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
    • Trustless Bridge for Native Tokens
    • Trustless Bridge For ERC20 Tokens
    • Brief Intro to the Cross-Chain Communication
    • Brief Intro to the Custodian Bridge Services
    • Custodian Bridge for Non-BTC Tokens
    • Custodian Bridge for BTC
  • πŸ–₯️User Guides
    • Wallet Setup
    • Bridge Your Assets
    • Earn Rewards via BTC Staking
    • Explore Our Ecosystem
  • Popular Token Contract Addresses
  • Set Up a Safe Wallet
  • πŸ“šReference
  • πŸ“¦Cutodian Guides
  • πŸ”Security Reports
    • Audit Report From Blocksec
    • Audit Report From CertiK
  • πŸ”‘Terms and Conditions
    • Terms Of Service
    • Privacy Policy
  • 🎁PR & Press
  • ☎️Contact US
Powered by GitBook
On this page
  • poolreg.xsat
  • Actions
  • Quickstart
  • Table Information
  • TABLE config
  • TABLE synchronizer
  • TABLE miners
  • TABLE stat
  • ACTION setdonateacc
  • ACTION updateheight
  • ACTION initpool
  • ACTION delpool
  • ACTION unbundle
  • ACTION config
  • ACTION buyslot
  • ACTION setdonate
  • ACTION setfinacct
  • ACTION claim
  1. Developer Guides
  2. Native Layer Developer Guides
  3. exSat consensus contracts

Pool Register Contract

poolreg.xsat

Actions

  • Initialize the synchronizer

  • Delete the synchronizer

  • Unbind the miner

  • Configure financial account and commission rate for the synchronizer

  • Purchase a slot

  • Claim rewards for validating blocks

  • Update the synchronizer with the latest block height

Quickstart

# setdonateacc @poolreg.xsat
$ cleos push action poolreg.xsat setdonateacc '{"donation_account": "alice", "min_donate_rate": 2000}' -p poolreg.xsat

# setdonate @synchronizer
$ cleos push action poolreg.xsat setdonate '{"synchronizer": "alice", "donate_rate": 100}' -p alice

# updateheight @utxomng.xsat
$ cleos push action poolreg.xsat updateheight '{"synchronizer": "alice", "height": 839999, "miners": ["3PiyiAezRdSUQub3ewUXsgw5M6mv6tskGv", "bc1p8k4v4xuz55dv49svzjg43qjxq2whur7ync9tm0xgl5t4wjl9ca9snxgmlt"]}' -p utxomng.xsat

# initpool @poolreg.xsat
$ cleos push action poolreg.xsat initpool '{"synchronizer": "alice", "latest_produced_block_height": 839999, "financial_account": "alice", "miners": [""]}' -p poolreg.xsat

# delpool @poolreg.xsat
$ cleos push action poolreg.xsat delpool '{"synchronizer": "alice"}' -p poolreg.xsat

# unbundle @poolreg.xsat
$ cleos push action poolreg.xsat unbundle '{"id": 1}' -p poolreg.xsat

# config @poolreg.xsat
$ cleos push action poolreg.xsat config '{"synchronizer": "alice", "produced_block_limit": 432}' -p poolreg.xsat

# setfinacct @synchronizer
$ cleos push action poolreg.xsat setfinacct '{"synchronizer": "alice", "financial_account": "alice"}' -p alice

# buyslot @synchronizer
$ cleos push action poolreg.xsat buyslot '{"synchronizer": "alice", "receiver": "alice", "num_slots": 2}' -p alice

# claim @evmutil.xsat or @financial_account
$ cleos push action poolreg.xsat claim '{"synchronizer": "alice"}' -p alice

Table Information

$ cleos get table poolreg.xsat poolreg.xsat synchronizer
$ cleos get table poolreg.xsat poolreg.xsat miners
$ cleos get table poolreg.xsat poolreg.xsat config
$ cleos get table poolreg.xsat poolreg.xsat stat

TABLE config

scope

poolreg.xsat

params

  • {string} donation_account - the account designated for receiving donations

  • {binary_extension<uint16_t>} min_donate_rate - minimum donation rate

example

{
  "donation_account": "donate.xsat",
  "min_donate_rate": 2000
}

TABLE synchronizer

scope

poolreg.xsat

params

  • {name} synchronizer - synchronizer account

  • {name} reward_recipient - receiving account for receiving rewards

  • {string} memo - memo when receiving reward transfer

  • {uint16_t} num_slots - number of slots owned

  • {uint64_t} latest_produced_block_height - the latest block number

  • {uint16_t} produced_block_limit - upload block limit, for example, if 432 is set, the upload height needs to be a synchronizer that has produced blocks in 432 blocks before it can be uploaded.

  • {uint16_t} donate_rate - the donation rate, represented as a percentage, ex: 500 means 5.00%

  • {asset} total_donated - the total amount of XSAT that has been donated

  • {asset} unclaimed - unclaimed rewards

  • {asset} claimed - rewards claimed

  • {uint64_t} latest_reward_block - the latest block number to receive rewards

  • {time_point_sec} latest_reward_time - latest reward time

example

{
   "synchronizer": "test.xsat",
   "reward_recipient": "erc2o.xsat",
   "memo": "0x4838b106fce9647bdf1e7877bf73ce8b0bad5f97",
   "num_slots": 2,
   "latest_produced_block_height": 840000,
   "produced_block_limit": 432,
   "donate_rate": 100,
   "total_donated": "100.00000000 XSAT",
   "unclaimed": "5.00000000 XSAT",
   "claimed": "0.00000000 XSAT",
   "latest_reward_block": 840001,
   "latest_reward_time": "2024-07-13T14:29:32"
}

TABLE miners

scope

poolreg.xsat

params

  • {uint64_t} id - primary key

  • {name} synchronizer - synchronizer account

  • {string} miner - associated btc miner account

example

{
   "id": 1,
   "synchronizer": "alice",
   "miner": "3PiyiAezRdSUQub3ewUXsgw5M6mv6tskGv"
}

TABLE stat

scope

poolreg.xsat

params

  • {asset} xsat_total_donated - the cumulative amount of XSAT donated

example

{
  "xsat_total_donated": "100.40000000 XSAT"
}

ACTION setdonateacc

  • authority: poolreg.xsat

Update donation account.

params

  • {string} donation_account - account to receive donations

  • {uint16_t} min_donate_rate - minimum donation rate

example

$ cleos push action poolreg.xsat setdonateacc '["alice", 2000]' -p poolreg.xsat

ACTION updateheight

  • authority: utxomng.xsat

Update synchronizer’s latest block height and add associated btc miners.

params

  • {name} synchronizer - synchronizer account

  • {uint64_t} latest_produced_block_height - the height of the latest mined block

  • {std::vector<string>} miners - list of btc accounts corresponding to synchronizer

example

$ cleos push action poolreg.xsat updateheight '["alice", 839999, ["3PiyiAezRdSUQub3ewUXsgw5M6mv6tskGv", "bc1p8k4v4xuz55dv49svzjg43qjxq2whur7ync9tm0xgl5t4wjl9ca9snxgmlt"]]' -p poolreg.xsat

ACTION initpool

  • authority: poolreg.xsat

Unbind the association between synchronizer and btc miner.

params

  • {name} synchronizer - synchronizer account

  • {uint64_t} latest_produced_block_height - the height of the latest mined block

  • {string} financial_account - financial account to receive rewards

  • {std::vector<string>} miners - list of btc accounts corresponding to synchronizer

example

$ cleos push action poolreg.xsat initpool '["alice", 839997, "alice", ["37jKPSmbEGwgfacCr2nayn1wTaqMAbA94Z", "39C7fxSzEACPjM78Z7xdPxhf7mKxJwvfMJ"]]' -p poolreg.xsat

ACTION delpool

  • authority: poolreg.xsat

Erase synchronizer.

params

  • {name} synchronizer - synchronizer account

example

$ cleos push action poolreg.xsat delpool '["alice"]' -p poolreg.xsat

ACTION unbundle

  • authority: poolreg.xsat

Unbind the association between synchronizer and btc miner.

params

  • {uint64_t} id - primary key of miners table

example

$ cleos push action poolreg.xsat unbundle '[1]' -p poolreg.xsat

ACTION config

  • authority: poolreg.xsat

Configure synchronizer block output limit.

params

  • {name} synchronizer - synchronizer account

  • {uint16_t} produced_block_limit - upload block limit, for example, if 432 is set, the upload height needs to be a synchronizer that has produced blocks in 432 blocks before it can be uploaded.

example

$ cleos push action poolreg.xsat config '["alice", 432]' -p poolreg.xsat

ACTION buyslot

  • authority: synchronizer

Buy slot.

params

  • {name} synchronizer - synchronizer account

  • {name} receiver - the account of the receiving slot

  • {uint16_t} num_slots - number of slots

example

$ cleos push action poolreg.xsat buyslot '["alice", "alice", 2]' -p alice

ACTION setdonate

  • authority: synchronizer

Configure donate rate.

params

  • {name} synchronizer - synchronizer account

  • {uint16_t} donate_rate - the donation rate, represented as a percentage, ex: 500 means 5.00%

example

$ cleos push action poolreg.xsat setdonate '["alice", 100]' -p alice

ACTION setfinacct

  • authority: synchronizer

Configure financial account.

params

  • {name} synchronizer - synchronizer account

  • {string} financial_account - financial account to receive rewards

example

$ cleos push action poolreg.xsat setfinacct '["alice", "alice"]' -p alice

ACTION claim

  • authority: synchronizer->to or evmutil.xsat

Receive award.

params

  • {name} synchronizer - synchronizer account

example

$ cleos push action poolreg.xsat claim '["alice"]' -p alice
PreviousexSat consensus contractsNextUTXO Management Contract

Last updated 1 month ago

πŸ‘¨β€πŸ’»