Versions in this module Expand all Collapse all v0 v0.12.2 Mar 18, 2021 Changes in this version + const AcceptedHtlcPenaltyWitnessSize + const AcceptedHtlcPenaltyWitnessSizeConfirmed + const AcceptedHtlcScriptSize + const AcceptedHtlcScriptSizeConfirmed + const AcceptedHtlcSuccessWitnessSize + const AcceptedHtlcSuccessWitnessSizeConfirmed + const AcceptedHtlcTimeoutWitnessSize + const AcceptedHtlcTimeoutWitnessSizeConfirmed + const AnchorCommitWeight + const AnchorScriptSize + const AnchorWitnessSize + const BaseAnchorCommitmentTxSize + const BaseAnchorCommitmentTxWeight + const BaseCommitmentTxSize + const BaseCommitmentTxWeight + const BaseTxSize + const CommitWeight + const CommitmentAnchorOutput + const CommitmentDelayOutput + const CommitmentKeyHashOutput + const FundingInputSize + const HTLCSize + const HTLCWeight + const HtlcConfirmedScriptOverhead + const HtlcSuccessWeight + const HtlcSuccessWeightConfirmed + const HtlcTimeoutWeight + const HtlcTimeoutWeightConfirmed + const InputSize + const MaxHTLCNumber + const MultiSigSize + const MultiSigWitnessSize + const NestedP2WPKHSize + const NestedP2WSHSize + const OfferedHtlcPenaltyWitnessSize + const OfferedHtlcPenaltyWitnessSizeConfirmed + const OfferedHtlcScriptSize + const OfferedHtlcScriptSizeConfirmed + const OfferedHtlcSuccessWitnessSize + const OfferedHtlcSuccessWitnessSizeConfirmed + const OfferedHtlcTimeoutWitnessSize + const OfferedHtlcTimeoutWitnessSizeConfirmed + const P2PKHOutputSize + const P2PKHScriptSigSize + const P2SHOutputSize + const P2WKHOutputSize + const P2WKHWitnessSize + const P2WPKHSize + const P2WSHOutputSize + const P2WSHSize + const ToLocalPenaltyWitnessSize + const ToLocalScriptSize + const ToLocalTimeoutWitnessSize + const ToRemoteConfirmedScriptSize + const ToRemoteConfirmedWitnessSize + const WitnessCommitmentTxWeight + const WitnessHeaderSize + var ErrTweakOverdose = errors.New("sign descriptor should only have one tweak") + var SequenceLockTimeSeconds = uint32(1 << 22) + func CommitScriptAnchor(key *btcec.PublicKey) ([]byte, error) + func CommitScriptToRemoteConfirmed(key *btcec.PublicKey) ([]byte, error) + func CommitScriptToSelf(csvTimeout uint32, selfKey, revokeKey *btcec.PublicKey) ([]byte, error) + func CommitScriptUnencumbered(key *btcec.PublicKey) ([]byte, error) + func CommitSpendAnchor(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx) (wire.TxWitness, error) + func CommitSpendAnchorAnyone(script []byte) (wire.TxWitness, error) + func CommitSpendNoDelay(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx, tweakless bool) (wire.TxWitness, error) + func CommitSpendRevoke(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx) (wire.TxWitness, error) + func CommitSpendTimeout(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx) (wire.TxWitness, error) + func CommitSpendToRemoteConfirmed(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx) (wire.TxWitness, error) + func ComputeCommitmentPoint(commitSecret []byte) *btcec.PublicKey + func DeriveRevocationPrivKey(revokeBasePriv *btcec.PrivateKey, commitSecret *btcec.PrivateKey) *btcec.PrivateKey + func DeriveRevocationPubkey(revokeBase, commitPoint *btcec.PublicKey) *btcec.PublicKey + func EstimateCommitTxWeight(count int, prediction bool) int64 + func FindScriptOutputIndex(tx *wire.MsgTx, script []byte) (bool, uint32) + func GenFundingPkScript(aPub, bPub []byte, amt int64) ([]byte, *wire.TxOut, error) + func GenMultiSigScript(aPub, bPub []byte) ([]byte, error) + func HtlcSecondLevelSpend(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx) (wire.TxWitness, error) + func HtlcSpendRevoke(signer Signer, signDesc *SignDescriptor, revokeTx *wire.MsgTx) (wire.TxWitness, error) + func HtlcSpendSuccess(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx, csvDelay uint32) (wire.TxWitness, error) + func LockTimeToSequence(isSeconds bool, locktime uint32) uint32 + func ReadSignDescriptor(r io.Reader, sd *SignDescriptor) error + func ReceiverHTLCScript(cltvExpiry uint32, ...) ([]byte, error) + func ReceiverHtlcSpendRedeem(senderSig Signature, senderSigHash txscript.SigHashType, ...) (wire.TxWitness, error) + func ReceiverHtlcSpendRevoke(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx) (wire.TxWitness, error) + func ReceiverHtlcSpendRevokeWithKey(signer Signer, signDesc *SignDescriptor, revokeKey *btcec.PublicKey, ...) (wire.TxWitness, error) + func ReceiverHtlcSpendTimeout(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx, cltvExpiry int32) (wire.TxWitness, error) + func Ripemd160H(d []byte) []byte + func SecondLevelHtlcScript(revocationKey, delayKey *btcec.PublicKey, csvDelay uint32) ([]byte, error) + func SenderHTLCScript(senderHtlcKey, receiverHtlcKey, revocationKey *btcec.PublicKey, ...) ([]byte, error) + func SenderHtlcSpendRedeem(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx, ...) (wire.TxWitness, error) + func SenderHtlcSpendRevoke(signer Signer, signDesc *SignDescriptor, sweepTx *wire.MsgTx) (wire.TxWitness, error) + func SenderHtlcSpendRevokeWithKey(signer Signer, signDesc *SignDescriptor, revokeKey *btcec.PublicKey, ...) (wire.TxWitness, error) + func SenderHtlcSpendTimeout(receiverSig Signature, receiverSigHash txscript.SigHashType, signer Signer, ...) (wire.TxWitness, error) + func SingleTweakBytes(commitPoint, basePoint *btcec.PublicKey) []byte + func SpendMultiSig(witnessScript, pubA []byte, sigA Signature, pubB []byte, sigB Signature) [][]byte + func TweakPrivKey(basePriv *btcec.PrivateKey, commitTweak []byte) *btcec.PrivateKey + func TweakPubKey(basePoint, commitPoint *btcec.PublicKey) *btcec.PublicKey + func TweakPubKeyWithTweak(pubKey *btcec.PublicKey, tweakBytes []byte) *btcec.PublicKey + func WitnessScriptHash(witnessScript []byte) ([]byte, error) + func WriteSignDescriptor(w io.Writer, sd *SignDescriptor) error + type BaseInput struct + func MakeBaseInput(outpoint *wire.OutPoint, witnessType WitnessType, ...) BaseInput + func NewBaseInput(outpoint *wire.OutPoint, witnessType WitnessType, ...) *BaseInput + func NewCsvInput(outpoint *wire.OutPoint, witnessType WitnessType, ...) *BaseInput + func (bi *BaseInput) CraftInputScript(signer Signer, txn *wire.MsgTx, hashCache *txscript.TxSigHashes, txinIdx int) (*Script, error) + func (i *BaseInput) BlocksToMaturity() uint32 + func (i *BaseInput) HeightHint() uint32 + func (i *BaseInput) OutPoint() *wire.OutPoint + func (i *BaseInput) RequiredLockTime() (uint32, bool) + func (i *BaseInput) RequiredTxOut() *wire.TxOut + func (i *BaseInput) SignDesc() *SignDescriptor + func (i *BaseInput) UnconfParent() *TxInfo + func (i *BaseInput) WitnessType() WitnessType + type HtlcSecondLevelAnchorInput struct + SignedTx *wire.MsgTx + func MakeHtlcSecondLevelSuccessAnchorInput(signedTx *wire.MsgTx, signDetails *SignDetails, preimage lntypes.Preimage, ...) HtlcSecondLevelAnchorInput + func MakeHtlcSecondLevelTimeoutAnchorInput(signedTx *wire.MsgTx, signDetails *SignDetails, heightHint uint32) HtlcSecondLevelAnchorInput + func (i *HtlcSecondLevelAnchorInput) BlocksToMaturity() uint32 + func (i *HtlcSecondLevelAnchorInput) CraftInputScript(signer Signer, txn *wire.MsgTx, hashCache *txscript.TxSigHashes, txinIdx int) (*Script, error) + func (i *HtlcSecondLevelAnchorInput) HeightHint() uint32 + func (i *HtlcSecondLevelAnchorInput) OutPoint() *wire.OutPoint + func (i *HtlcSecondLevelAnchorInput) RequiredLockTime() (uint32, bool) + func (i *HtlcSecondLevelAnchorInput) RequiredTxOut() *wire.TxOut + func (i *HtlcSecondLevelAnchorInput) SignDesc() *SignDescriptor + func (i *HtlcSecondLevelAnchorInput) UnconfParent() *TxInfo + func (i *HtlcSecondLevelAnchorInput) WitnessType() WitnessType + type HtlcSucceedInput struct + func MakeHtlcSucceedInput(outpoint *wire.OutPoint, signDescriptor *SignDescriptor, preimage []byte, ...) HtlcSucceedInput + func (h *HtlcSucceedInput) CraftInputScript(signer Signer, txn *wire.MsgTx, hashCache *txscript.TxSigHashes, txinIdx int) (*Script, error) + func (i *HtlcSucceedInput) BlocksToMaturity() uint32 + func (i *HtlcSucceedInput) HeightHint() uint32 + func (i *HtlcSucceedInput) OutPoint() *wire.OutPoint + func (i *HtlcSucceedInput) RequiredLockTime() (uint32, bool) + func (i *HtlcSucceedInput) RequiredTxOut() *wire.TxOut + func (i *HtlcSucceedInput) SignDesc() *SignDescriptor + func (i *HtlcSucceedInput) UnconfParent() *TxInfo + func (i *HtlcSucceedInput) WitnessType() WitnessType + type Input interface + BlocksToMaturity func() uint32 + CraftInputScript func(signer Signer, txn *wire.MsgTx, hashCache *txscript.TxSigHashes, txinIdx int) (*Script, error) + HeightHint func() uint32 + OutPoint func() *wire.OutPoint + RequiredLockTime func() (uint32, bool) + RequiredTxOut func() *wire.TxOut + SignDesc func() *SignDescriptor + UnconfParent func() *TxInfo + WitnessType func() WitnessType + type MockSigner struct + NetParams *chaincfg.Params + Privkeys []*btcec.PrivateKey + func (m *MockSigner) ComputeInputScript(tx *wire.MsgTx, signDesc *SignDescriptor) (*Script, error) + func (m *MockSigner) SignOutputRaw(tx *wire.MsgTx, signDesc *SignDescriptor) (Signature, error) + type Script struct + SigScript []byte + Witness wire.TxWitness + type SignDescriptor struct + DoubleTweak *btcec.PrivateKey + HashType txscript.SigHashType + InputIndex int + KeyDesc keychain.KeyDescriptor + Output *wire.TxOut + SigHashes *txscript.TxSigHashes + SingleTweak []byte + WitnessScript []byte + type SignDetails struct + PeerSig Signature + SigHashType txscript.SigHashType + SignDesc SignDescriptor + type Signature interface + Serialize func() []byte + Verify func([]byte, *btcec.PublicKey) bool + type Signer interface + ComputeInputScript func(tx *wire.MsgTx, signDesc *SignDescriptor) (*Script, error) + SignOutputRaw func(tx *wire.MsgTx, signDesc *SignDescriptor) (Signature, error) + type StandardWitnessType uint16 + const CommitSpendNoDelayTweakless + const CommitmentAnchor + const CommitmentNoDelay + const CommitmentRevoke + const CommitmentTimeLock + const CommitmentToRemoteConfirmed + const HtlcAcceptedRemoteSuccess + const HtlcAcceptedRevoke + const HtlcAcceptedSuccessSecondLevel + const HtlcAcceptedSuccessSecondLevelInputConfirmed + const HtlcOfferedRemoteTimeout + const HtlcOfferedRevoke + const HtlcOfferedTimeoutSecondLevel + const HtlcOfferedTimeoutSecondLevelInputConfirmed + const HtlcSecondLevelRevoke + const NestedWitnessKeyHash + const WitnessKeyHash + func (wt StandardWitnessType) AddWeightEstimation(e *TxWeightEstimator) error + func (wt StandardWitnessType) SizeUpperBound() (int, bool, error) + func (wt StandardWitnessType) String() string + func (wt StandardWitnessType) WitnessGenerator(signer Signer, descriptor *SignDescriptor) WitnessGenerator + type TxInfo struct + Fee vclutil.Amount + Weight int64 + type TxWeightEstimator struct + func (twe *TxWeightEstimator) AddNestedP2WKHInput() *TxWeightEstimator + func (twe *TxWeightEstimator) AddNestedP2WSHInput(witnessSize int) *TxWeightEstimator + func (twe *TxWeightEstimator) AddP2PKHInput() *TxWeightEstimator + func (twe *TxWeightEstimator) AddP2PKHOutput() *TxWeightEstimator + func (twe *TxWeightEstimator) AddP2SHOutput() *TxWeightEstimator + func (twe *TxWeightEstimator) AddP2WKHInput() *TxWeightEstimator + func (twe *TxWeightEstimator) AddP2WKHOutput() *TxWeightEstimator + func (twe *TxWeightEstimator) AddP2WSHOutput() *TxWeightEstimator + func (twe *TxWeightEstimator) AddTxOutput(txOut *wire.TxOut) *TxWeightEstimator + func (twe *TxWeightEstimator) AddWitnessInput(witnessSize int) *TxWeightEstimator + func (twe *TxWeightEstimator) VSize() int + func (twe *TxWeightEstimator) Weight() int + type WitnessGenerator func(tx *wire.MsgTx, hc *txscript.TxSigHashes, inputIndex int) (*Script, error) + type WitnessType interface + AddWeightEstimation func(e *TxWeightEstimator) error + SizeUpperBound func() (int, bool, error) + String func() string + WitnessGenerator func(signer Signer, descriptor *SignDescriptor) WitnessGenerator