( pubkey: Buffer, network: bitcoin.Network )
| 102 | } |
| 103 | |
| 104 | export function generateP2TRNoteAddressV1( |
| 105 | pubkey: Buffer, |
| 106 | network: bitcoin.Network |
| 107 | ): IAddressObject { |
| 108 | // Output script address |
| 109 | const {scriptP2TR} = generateP2TRNoteInfoV1(pubkey, network); |
| 110 | |
| 111 | const script = scriptP2TR.output!.toString("hex"); |
| 112 | // with SHA256 hash |
| 113 | const scriptHash = calcScriptHash(scriptP2TR.output!); |
| 114 | |
| 115 | const type: AddressType = "P2TR-NOTE-V1"; |
| 116 | |
| 117 | return { |
| 118 | address: scriptP2TR.address!, |
| 119 | script, |
| 120 | scriptHash, |
| 121 | type, |
| 122 | }; |
| 123 | } |
| 124 | |
| 125 | // Pay to Taproot Witness Script address, where the redeem script is NOTE protocol address |
| 126 | export function generateP2TRNoteAddress( |
no test coverage detected