MCPcopy Create free account
hub / github.com/dfinity/examples / create_script_path_witness

Function create_script_path_witness

rust/basic_bitcoin/src/ordinals.rs:162–226  ·  view source on GitHub ↗

Creates the witness stack for Taproot script-path spending. This function handles the complex process of: 1. Computing the signature hash for script-path spending 2. Signing with the appropriate private key 3. Constructing the witness stack in the correct order The witness stack must be ordered correctly for script validation: - Signature (top of stack, consumed by OP_CHECKSIG) - Script (the cod

(
    ctx: &BitcoinContext,
    reveal_transaction: &mut Transaction,
    commit_output: &TxOut,
    reveal_script: &ScriptBuf,
    control_block: &ControlBlock,
    internal_key_path: Vec<Vec<u8>>,
)

Source from the content-addressed store, hash-verified

source not stored for this graph (policy: none)

Callers 2

inscribe_ordinalFunction · 0.85
inscribe_brc20Function · 0.85

Calls 2

sign_with_schnorrFunction · 0.85
to_bytesMethod · 0.45

Tested by

no test coverage detected