( msgpackEncodedData: Buffer, pubkey: Buffer, network: bitcoin.Network )
| 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( |
| 149 | msgpackEncodedData: Buffer, |
| 150 | pubkey: Buffer, |
| 151 | network: bitcoin.Network |
| 152 | ): IAddressObject { |
| 153 | // Output script address |
| 154 | const {scriptP2TR} = generateP2TRCommitDataInfo( |
| 155 | msgpackEncodedData, |
| 156 | pubkey, |
| 157 | network |
| 158 | ); |
| 159 | |
| 160 | const script = scriptP2TR.output!.toString("hex"); |
| 161 | // with SHA256 hash |
| 162 | const scriptHash = calcScriptHash(scriptP2TR.output!); |
| 163 | |
| 164 | const type: AddressType = "P2TR-COMMIT-DATA"; |
| 165 | |
| 166 | return { |
| 167 | address: scriptP2TR.address!, |
| 168 | script, |
| 169 | scriptHash, |
| 170 | type, |
| 171 | }; |
| 172 | } |
no test coverage detected