mirror of
https://github.com/btcsuite/btcd.git
synced 2025-02-23 14:40:44 +01:00
txscript: add new PayToTaprootScript function
This commit is contained in:
parent
f6e8292402
commit
5e0de1c539
1 changed files with 8 additions and 0 deletions
|
@ -774,3 +774,11 @@ func AssembleTaprootScriptTree(leaves ...TapLeaf) *IndexedTapScriptTree {
|
|||
|
||||
return scriptTree
|
||||
}
|
||||
|
||||
// PayToTaprootScript creates a pk script for a pay-to-taproot output key.
|
||||
func PayToTaprootScript(taprootKey *btcec.PublicKey) ([]byte, error) {
|
||||
return NewScriptBuilder().
|
||||
AddOp(OP_1).
|
||||
AddData(schnorr.SerializePubKey(taprootKey)).
|
||||
Script()
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue