( pubkey: Buffer, network: bitcoin.Network )
| 124 | |
| 125 | // Pay to Taproot Witness Script address, where the redeem script is NOTE protocol address |
| 126 | export function generateP2TRNoteAddress( |
| 127 | pubkey: Buffer, |
| 128 | network: bitcoin.Network |
| 129 | ): IAddressObject { |
| 130 | // Output script address |
| 131 | const {scriptP2TR} = generateP2TRNoteInfo(pubkey, network); |
| 132 | |
| 133 | const script = scriptP2TR.output!.toString("hex"); |
| 134 | // with SHA256 hash |
| 135 | const scriptHash = calcScriptHash(scriptP2TR.output!); |
| 136 | |
| 137 | const type: AddressType = "P2TR-NOTE"; |
| 138 | |
| 139 | return { |
| 140 | address: scriptP2TR.address!, |
| 141 | script, |
| 142 | scriptHash, |
| 143 | type, |
| 144 | }; |
| 145 | } |
| 146 | |
| 147 | // Pay to Taproot Witness Script address with full Payload embedding, where the redeem script contains the entire NOTE Payload |
| 148 | export function generateP2TRCommitDataAddress( |
no test coverage detected