Synchronizer (Mining Pools)
Synchronizer plays a key role in the Data Consensus Protocol and is typically coming from BTC mining pools. Synchronizer needs to run the Synchronizer Client to perform its tasks.
The Synchronizer client periodically queries the BTC RPC node to obtain the latest BTC block. If the BTC block needs to be uploaded, it (including block header, block body, and segwit data) will be splited into multiple shards (default size of each shard is 256kB) and uploaded to the exSat contract for verification and parsing.
Once the BTC block upload is completed, the client triggers the verification of the correctness and completeness of the data:
Verifying if the previous block hash in the block header is correct
Verifying if the mining data is correct (by checking the nonce and difficulty)
Verifying if the transaction data in the block is complete and correct (by reconstructing the Merkle tree of transactions and verifying if the root matches the transaction tree root in the block header)
Verifying if the witness data is correct (by reconstructing the Merkle tree of witness data and checking if it matches the witness data Merkle root stored in the Coinbase)
When all verifications pass, the BTC block is marked as verified.
After the block is verified, the client queries the contract to confirm if consensus is reached on this block (at least ⅔+1 of Validators vote on the hash of the uploaded BTC block). If consensus on this block is reached, and the block becomes irreversible (with at least 6 confirmations) ,block parsing begins. The block parsing work sequentially parses each transaction in the current block and updates the UTXO data stored in the exSat contract. It also allows DApps to register to take part in the parsing process, which enables DApps to keep trust on BTC network and perform business on exSat.
Last updated