how should p2tr script trees be formatted/ordered in bitcoinjs-lib

how should p2tr script trees be formatted/ordered in bitcoinjs-lib

Manage alerts

Loading saved threads...

jiamijiang · External communityPost link
External question — Bitcoin Stack Exchange Author: jiamijiang Original post: https://bitcoin.stackexchange.com/questions/130734 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. i'm looking at the p2tr examples in the bitcoinjs-lib repo and many of them are structuring the script trees in what seemingly seems arbitrary. check out the example below taken from this file on line 248: const scriptTree: Taptree = [ [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0 OP_CHECKSIG', ), }, [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac1 OP_CHECKSIG', ), }, { output: bitcoin.script.fromASM( '2258b1c3160be0864a541854eec9164a572f094f7562628281a8073bb89173a7 OP_CHECKSIG', ), }, ], ], [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac2 OP_CHECKSIG', ), }, [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac3 OP_CHECKSIG', ), }, [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac4 OP_CHECKSIG', ), }, { output: leafScript, }, ], ], ], ]; like how do i make sense of this?
Quote
Report

Post Reply

Quoted from Forex.com.bd-Editorial External question — Bitcoin Stack Exchange Author: jiamijiang Source score (net votes, not local likes): 0 Original post: https://bitcoin.stackexchange.com/questions/130734 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. i'm looking at the p2tr examples in the bitcoinjs-lib repo and many of them are structuring the script trees in what seemingly seems arbitrary. check out the example below taken from this file on line 248: const scriptTree: Taptree = [ [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0 OP_CHECKSIG', ), }, [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac1 OP_CHECKSIG', ), }, { output: bitcoin.script.fromASM( '2258b1c3160be0864a541854eec9164a572f094f7562628281a8073bb89173a7 OP_CHECKSIG', ), }, ], ], [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac2 OP_CHECKSIG', ), }, [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac3 OP_CHECKSIG', ), }, [ { output: bitcoin.script.fromASM( '50929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac4 OP_CHECKSIG', ), }, { output: leafScript, }, ], ], ], ]; like how do i make sense of this?

Cancel quote

Checking account access…