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
  • blkendt.xsat
  • Actions
  • QuickStart
  • Table Information
  • STRUCT requested_validator_info
  • STRUCT provider_validator_info
  • TABLE config
  • TABLE endorsements
  • TABLE revote_record
  • ACTION config
  • ACTION endorse
  • ACTION erase
  • ACTION revote
  • ACTION setqualify
  • ACTION setconheight
  1. Developer Guides
  2. Native Layer Developer Guides
  3. exSat consensus contracts

Block Consensus Contract

blkendt.xsat

This contract processes votes from validators on the hash of each Bitcoin block. When more than two-thirds of the validators submit the same hash for a block, and it matches the hash of the block data submitted by the Synchronizer, the block is considered to have reached consensus.

Actions

  • Endorse a block

QuickStart

# config @blkendt.xsat
$ cleos push action blkendt.xsat config '{"limit_endorse_height": 840000, "limit_num_endorsed_blocks": 4, "min_validators": 15, "consensus_interval_seconds": 480, "xsat_stake_activation_height": 860000}' -p blkendt.xsat

# erase @utxomng.xsat
$ cleos push action blkendt.xsat erase '{"height": 840000}' -p utxomng.xsat

# endorse @validator
$ cleos push action blkendt.xsat endorse '{"validator": "alice", "height": 840000, "hash": "0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5"}' -p alice

# setqualify @auth get_self()
$ cleos push action blkendt.xsat setqualify '{"min_xsat_qualification": "2100.00000000 XSAT", "min_btc_qualification": "100.00000000 BTC"}' -p blkendt.xsat

# setconheight @auth get_self()
$ cleos push action blkendt.xsat setconheight '{"xsat_stake_activation_height": 890000, "xsat_reward_height": 890000}' -p blkendt.xsat  

# revote @auth synchronizer
$ cleos push action blkendt.xsat revote '{"synchronizer": "synchronizer", "height": 840000}' -p synchronizer

Table Information

$ cleos get table blkendt.xsat <height> endorsements

# by hash
$ cleos get table blkendt.xsat <height> endorsements --index 2 --key-type sha256 -L <hash> -U <hash>

STRUCT requested_validator_info

  • {name} account - validator account

  • {uint64_t} staking - the validator's staking amount

{
  "account": "test.xsat",
  "staking": "10200000000"
}

STRUCT provider_validator_info

  • {name} account - validator account

  • {uint64_t} staking - the validator's staking amount

  • {time_point_sec} created_at - created at time

example

{
  "account": "test.xsat",
  "staking": "10200000000",
  "created_at": "2024-08-13T00:00:00"
}

TABLE config

scope

blkendt.xsat

params

  • {uint64_t} limit_endorse_height - limit the endorsement height. If it is 0, there will be no limit. If it is greater than this height, endorsement will not be allowed.

  • {uint16_t} limit_num_endorsed_blocks - limit the endorsement height to no more than the number of blocks of the parsed height. If it is 0, there will be no limit.

  • {uint16_t} min_validators - the minimum number of validators, which limits the number of validators that pledge more than 100 BTC at the time of first endorsement.

  • {uint16_t} consensus_interval_seconds - the interval in seconds between consensus rounds.

  • {uint64_t} xsat_stake_activation_height - block height at which XSAT staking feature is activated

  • {asset} min_xsat_qualification - minimum XSAT amount required for qualification

  • {asset} min_btc_qualification - minimum BTC amount required for qualification

  • {uint64_t} xsat_reward_height - block height at which XSAT rewards are activated

  • {uint64_t} validator_active_vote_count - count of active validator votes

example

{
  "limit_endorse_height": 840000,
  "limit_num_endorsed_blocks": 10,
  "min_validators": 15,
  "consensus_interval_seconds": 480,
  "xsat_stake_activation_height": 860000,
  "min_xsat_qualification": "2100.00000000 XSAT",
  "min_btc_qualification": "100.00000000 BTC",
  "xsat_reward_height": 890000,
  "validator_active_vote_count": 0
}

TABLE endorsements

scope

height

params

  • {uint64_t} id - primary key

  • {checksum256} hash - endorsement block hash

  • {std::vector<requested_validator_info>} requested_validators - list of unendorsed validators

  • {std::vector<provider_validator_info>} provider_validators - list of endorsed validators

example

{
  "id": 0,
  "hash": "00000000000000000000da20f7d8e9e6412d4f1d8b62d88264cddbdd48256ba0",
  "requested_validators": [{
      "account": "alice",
      "staking": "10000000000"
   }
  ],
  "provider_validators": [{
      "account": "test.xsat",
      "staking": "10200000000",
      "created_at": "2024-08-13T00:00:00"
     }
  ]
}

TABLE revote_record

scope

blkendt.xsat

params

  • {uint64_t} id - primary key

  • {uint64_t} height - height

  • {std::vector<name>} synchronizers - synchronizers

  • {uint8_t} status - status

  • {time_point_sec} created_at - created at time

  • {time_point_sec} updated_at - updated at time

example

{
  "id": 0,
  "height": 840000,
  "synchronizers": ["alice", "bob"],
  "status": 0,
  "created_at": "2024-08-13T00:00:00",
  "updated_at": "2024-08-13T00:00:00"
}

ACTION config

  • authority: blkendt.xsat

Configure endorsement status

params

  • {uint64_t} limit_endorse_height - limit the endorsement height. If it is 0, there will be no limit. If it is greater than this height, endorsement will not be allowed.

  • {uint16_t} limit_num_endorsed_blocks - limit the endorsement height to no more than the number of blocks of the parsed height. If it is 0, there will be no limit.

  • {uint16_t} min_validators - the minimum number of validators, which limits the number of validators that pledge more than 100 BTC at the time of first endorsement.

  • {uint64_t} xsat_stake_activation_height - block height at which XSAT staking feature is activated

  • {uint16_t} consensus_interval_seconds - the interval in seconds between consensus rounds.

example

$ cleos push action blkendt.xsat config '[840003, 10, 15, 860000, 480]' -p blkendt.xsat

ACTION endorse

  • authority: validator

Endorsement block

params

  • {name} validator - validator account

  • {uint64_t} height - to endorse the height of the block

  • {checksum256} hash - to endorse the hash of the block

example

$ cleos push action blkendt.xsat endorse '["alice", 840000, "0000000000000000000320283a032748cef8227873ff4872689bf23f1cda83a5"]' -p alice

ACTION erase

  • authority: utxomng.xsat

To erase high endorsements

params

  • {uint64_t} height - to endorse the height of the block

example

$ cleos push action blkendt.xsat erase '[840000]' -p utxomng.xsat

ACTION revote

  • authority: synchronizer

To initiate a revote for a specific height

params

  • {name} synchronizer - synchronizer account

  • {uint64_t} height - height

example

$ cleos push action blkendt.xsat revote '["alice", 840000]' -p alice

ACTION setqualify

  • authority: endrmng.xsat or blkendt.sat

Set the minimum pledge amount of xast to become a validator

params

  • {asset} min_xsat_qualification - the minimum pledge amount of xast to become a validator

  • {asset} min_btc_qualification - the minimum pledge amount of btc to become a validator

example

$ cleos push action blkendt.xsat setqualify '["21000.00000000 XSAT", "100.00000000 BTC"]' -p endrmng.xsat

ACTION setconheight

  • authority: blkendt.sat

Set the XSAT stake activation height and XSAT reward height

params

  • {uint64_t} xsat_stake_activation_height - block height at which XSAT staking feature is activated

  • {uint64_t} xsat_reward_height - block height at which XSAT reward feature is activated

example

$ cleos push action blkendt.xsat setconheight '[860000, 870000]' -p blkendt.xsat
PreviousReward Distribution ContractNextBlock Synchronization Contract

Last updated 18 days ago

πŸ‘¨β€πŸ’»