Programming with Bitcoin Blocks and Transactions
Rooch incorporates the bitcoin-move (opens in a new tab) framework, which allows developers to read Bitcoin blocks and transactions through the bitcoin-move framework and use the data carried in them for programming.
Reading Bitcoin Blocks and Transactions in Contracts
💡
TODO: This section of the document needs improvement
- How to read transactions, including explanations of transaction fields.
- How to read blocks, including explanations of block fields.
- An explanation of how Bitcoin hashes are expressed and differ in Move is required.
Application Scenarios
- Use a Bitcoin hash as a random number seed to implement a random number generator. Note, this scenario requires using the hash of future blocks to prevent predictability.
- Embed application data in Bitcoin via OP_RETURN, then read the OP_RETURN data from the transaction using a Move contract for processing.
- Validate Bitcoin transaction scripts in Move to enable mixed programming with Move and Bitcoin Script. This feature is still in development, and progress can be tracked at Issue #1651 (opens in a new tab).