hBK Smart Contract
π Overview
The Hemi Bitcoin Kit smart contract provides utilities for interacting with Bitcoin data on the Hemi blockchain.
It includes methods to retrieve Bitcoin address balances, UTXOs, transaction details, and block headers.
The contract leverages hVM's new precompiles to perform Bitcoin-related queries.
Latest hBK release on Hemi: 0x7007dd1C09527B92AEcd8Ae6570B73d09E0B8F12
Latest hBK release on Hemi testnet: 0xeC9fa5daC1118963933e1A675a4EEA0009b7f215
π§ Phase 0 - Essentials
This initial phase is focused on core Bitcoin protocol data:
Script/Address Balances
UTXO Set
Full Transactions w/ Output Availability
Transaction Confirmations
BTC Headers (Last and N)
ποΈ Struct Definitions
UTXO
Represents an unspent transaction output (UTXO).
Transaction
Represents a Bitcoin transaction.
Input
Represents a Bitcoin transaction input.
Output
Represents a Bitcoin transaction output.
SpentDetail
Represents details of a spent output.
BitcoinHeader
Represents a Bitcoin block header.
π§βπ» IBitcoinKit Interface
The IBitcoinKit interface defines the methods available for interacting with the BitcoinKit contract.
getBitcoinAddressBalance
Retrieves the balance of a given Bitcoin address.
Precompile Address: 0x40
getUTXOsForBitcoinAddress
Precompile Address: 0x41
Retrieves UTXOs for a given Bitcoin address, page number, and page size.
getTransactionByTxId
Retrieves UTXOs for a given Bitcoin address, page number, and page size.
Precompile Address: 0x42
getTxConfirmations
Retrieves the number of confirmations for a given transaction ID.
Precompile Address: 0x43
getLastHeader
Retrieves the latest Bitcoin block header.
Precompile Address: 0x44
getHeaderN
Precompile Address: 0x45
Retrieves the Bitcoin block header at a specific height.
Last updated
Was this helpful?