mirror of
https://github.com/aljazceru/ark.git
synced 2026-02-15 08:04:19 +01:00
* v0 unilateral redemption * add fee outputs to congestion tree * unilateral exit * rework unilateral exit verbosity * substract fee from vtxo amount * remove unused functions and variables * fix after reviews * Update noah/explorer.go Co-authored-by: Pietralberto Mazza <18440657+altafan@users.noreply.github.com> Signed-off-by: Louis Singer <41042567+louisinger@users.noreply.github.com> * remove bufferutils --------- Signed-off-by: Louis Singer <41042567+louisinger@users.noreply.github.com> Co-authored-by: Pietralberto Mazza <18440657+altafan@users.noreply.github.com>
24 lines
634 B
Go
24 lines
634 B
Go
package common
|
|
|
|
import (
|
|
"github.com/btcsuite/btcd/btcec/v2/schnorr"
|
|
"github.com/btcsuite/btcd/txscript"
|
|
"github.com/decred/dcrd/dcrec/secp256k1/v4"
|
|
"github.com/vulpemventures/go-elements/taproot"
|
|
)
|
|
|
|
func checksigScript(pubkey *secp256k1.PublicKey) ([]byte, error) {
|
|
key := schnorr.SerializePubKey(pubkey)
|
|
return txscript.NewScriptBuilder().AddData(key).AddOp(txscript.OP_CHECKSIG).Script()
|
|
}
|
|
|
|
func VtxoScript(pubkey *secp256k1.PublicKey) (*taproot.TapElementsLeaf, error) {
|
|
script, err := checksigScript(pubkey)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
tapLeaf := taproot.NewBaseTapElementsLeaf(script)
|
|
return &tapLeaf, nil
|
|
}
|