Skip to main content

Overview

The AnchorBitcoinFill 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

The AnchorBitcoinFill 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

The locked value (1 ETH in this example) is what the solver will receive when they successfully fulfill the Bitcoin payment.

Via Blob Storage (for large data)

Bitcoin Address Validation

The system validates Bitcoin addresses when parsing:

Solving the Intent

Solvers fulfill AnchorBitcoinFill intents by:
  1. Locking the intent to prevent other solvers from claiming it
  2. Sending Bitcoin to the specified address
  3. 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:

L1 Verification

When solveIntent() is called with AnchorBitcoinFill proof data, Core Lane:
  1. Verifies the intent is in Locked status
  2. Extracts the block number and txid from proof data
  3. Queries the Bitcoin RPC client to fetch the block and transaction
  4. 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
  5. Transfers the locked value to the solver
  6. 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
Upon cancellation:
  • 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:

Next Steps