Skip to content

Latest commit

 

History

History
160 lines (67 loc) · 4.4 KB

taproot_builder.md

File metadata and controls

160 lines (67 loc) · 4.4 KB

Module 0x4::taproot_builder

Taproot is a module that provides Bitcoin Taproot related functions.

Struct TaprootBuilder

struct TaprootBuilder has drop, store

Struct NodeInfo

struct NodeInfo has drop, store

Constants

const ErrorNodeNotInDfsOrder: u64 = 2;

const ErrorOverCompleteTree: u64 = 3;

const ErrorUnreachable: u64 = 4;

const TAG_TAP_BRANCH: vector<u8> = [84, 97, 112, 66, 114, 97, 110, 99, 104];

const TAG_TAP_LEAF: vector<u8> = [84, 97, 112, 76, 101, 97, 102];

Tapscript leaf version.

const TAPROOT_LEAF_TAPSCRIPT: u8 = 192;

Function new

Function add_leaf

Function finalize

Finalize the builder, return the state root, We use the address to represent the hash.