Overview
TheAnchorBitcoinFill intent type (type ID: 1) enables trustless cross-chain value transfer from Bitcoin to Core Lane. Users lock value on Core Lane along with a Bitcoin address and payment requirements. Solvers fulfill the intent by sending Bitcoin to the specified address and proving the payment on-chain.
Data Structure
TheAnchorBitcoinFill struct contains all parameters for a Bitcoin fill request:
Field Descriptions
- bitcoin_address: UTF-8 encoded string of a valid Bitcoin address (any format: P2PKH, P2SH, P2WPKH, P2WSH, P2TR)
- amount: The exact amount of satoshis the user expects to receive
- max_fee: Maximum transaction fee the user is willing to accept (in satoshis)
- expire_by: Unix timestamp after which the intent can no longer be solved
Creating an AnchorBitcoinFill Intent
Using the Helper Function
Manual Construction
Submitting the Intent
Direct Submission
Via Blob Storage (for large data)
Bitcoin Address Validation
The system validates Bitcoin addresses when parsing:Solving the Intent
Solvers fulfill AnchorBitcoinFill intents by:- Locking the intent to prevent other solvers from claiming it
- Sending Bitcoin to the specified address
- Submitting proof of the Bitcoin transaction
Step 1: Lock the Intent
Step 2: Send Bitcoin
The solver sends Bitcoin to the address specified in the intent, ensuring:- Amount matches or exceeds the requested amount
- Transaction fee is within the max_fee limit
- Transaction is confirmed on Bitcoin L1
Step 3: Submit Proof
The solver submits proof data containing the Bitcoin block number and transaction ID:Proof Data Format
The proof data is exactly 40 bytes:| Offset | Length | Description |
|---|---|---|
| 0 | 8 | Block number (u64 little-endian) |
| 8 | 32 | Transaction ID (txid) |
L1 Verification
WhensolveIntent() is called with AnchorBitcoinFill proof data, Core Lane:
- Verifies the intent is in
Lockedstatus - Extracts the block number and txid from proof data
- Queries the Bitcoin RPC client to fetch the block and transaction
- Validates that the transaction:
- Sends the correct amount to the correct address
- Has fees within the max_fee limit
- Is confirmed in the specified block
- Transfers the locked value to the solver
- Marks the intent as
Solved
Cancellation
The intent creator can cancel an AnchorBitcoinFill intent if:- The intent has not been solved
- The cancellation is called by the creator
- The intent status changes to
Cancelled - The locked value is returned to the creator
- The intent can no longer be solved
Parsing Intent Data
To parse an AnchorBitcoinFill intent from CBOR:Example: Complete Flow
Error Handling
Common errors when working with AnchorBitcoinFill intents:| Error | Cause |
|---|---|
| ”Expected AnchorBitcoinFill intent type” | Wrong intent type in IntentData |
| ”Failed to parse AnchorBitcoinFill from CBOR” | Malformed CBOR data |
| ”Invalid UTF-8 in bitcoin_address” | Bitcoin address not valid UTF-8 |
| ”Invalid Bitcoin address” | Address fails Bitcoin validation |
| ”L1 fill not found in block” | Transaction not in specified block |
| ”Value too large (exceeds u64::MAX)“ | Locked value > ~18.4 ETH |
| ”Already locked” | Intent already locked by another solver |
| ”Already solved” | Intent already fulfilled |
Next Steps
- Intent System Overview - Core concepts and lifecycle
- RISC-V Program Intents - Programmable intent validation