input: add production taproot witness types for final channels
What changed, and why it matters
This commit adds new witness types and size constants for production taproot channels in LND. It is a feature-completion change that mirrors existing staging taproot logic but uses slightly optimized scripts (OP_CHECKSIGVERIFY instead of OP_CHECKSIG + OP_DROP). There is no direct evidence in the commit that this fixes an active security vulnerability; it appears to be part of maturing taproot channel support.
Review as normal feature code. Ensure that the new production witness types are only selected for channels that actually use the production taproot script variant, and that existing staging channels continue to use the staging witness types. Verify test coverage for all new witness types and cross-check size constants against actual script sizes.
Security signals we found
New witness types for production taproot channels added alongside staging counterparts
Script optimization changes OP_CHECKSIG + OP_DROP to OP_CHECKSIGVERIFY
Witness generation logic reuses existing staging code paths for final types
Size constants added for fee/weight estimation of production taproot spends
No explicit security bug, vulnerability, or incident described in commit message or diff
Evidence from the diff
The commit introduces seven new StandardWitnessType values (TaprootLocalCommitSpendFinal, TaprootRemoteCommitSpendFinal, TaprootHtlcOfferedTimeoutSecondLevelFinal, TaprootHtlcAcceptedSuccessSecondLevelFinal, TaprootHtlcOfferedRemoteTimeoutFinal, TaprootHtlcAcceptedRemoteSuccessFinal, TaprootCommitmentRevokeFinal) and corresponding size constants in input/size.go. The witness generation logic in input/witnessgen.go is extended to handle these new types by falling through to the same generators used for staging taproot witness types. The production scripts differ by replacing OP_CHECKSIG + OP_DROP with OP_CHECKSIGVERIFY, saving one byte per script. Tests are added in input/size_test.go to verify witness sizes for the new production variants.
Changed components
input/size.goinput/witnessgen.goinput/size_test.goInspect captured patch +327 / −11
diff --git a/input/size.go b/input/size.go
index f1c56ff..e88a934 100644
--- a/input/size.go
+++ b/input/size.go
@@ -275,18 +275,30 @@ const (
HtlcTimeoutWeight = 663
// TaprootHtlcTimeoutWeight is the total weight of the taproot HTLC
- // timeout transaction.
+ // timeout transaction (using staging scripts).
TaprootHtlcTimeoutWeight = 645
+ // TaprootHtlcTimeoutWeightFinal is the total weight of the taproot HTLC
+ // timeout transaction using production scripts (with OP_CHECKSIGVERIFY
+ // instead of OP_CHECKSIG + OP_DROP). This is not referenced at runtime
+ // because taproot channels use zero-fee HTLC transactions.
+ TaprootHtlcTimeoutWeightFinal = 641
+
// HtlcSuccessWeight 703 weight
// HtlcSuccessWeight is the weight of the HTLC success transaction
// which will transition an incoming HTLC to the delay-and-claim state.
HtlcSuccessWeight = 703
// TaprootHtlcSuccessWeight is the total weight of the taproot HTLC
- // success transaction.
+ // success transaction (using staging scripts).
TaprootHtlcSuccessWeight = 705
+ // TaprootHtlcSuccessWeightFinal is the total weight of the taproot HTLC
+ // success transaction using production scripts (with OP_CHECKSIGVERIFY
+ // instead of OP_CHECKSIG + OP_DROP). This is not referenced at runtime
+ // because taproot channels use zero-fee HTLC transactions.
+ TaprootHtlcSuccessWeightFinal = 701
+
// HtlcConfirmedScriptOverhead 3 bytes
// HtlcConfirmedScriptOverhead is the extra length of an HTLC script
// that requires confirmation before it can be spent. These extra bytes
@@ -625,6 +637,16 @@ const (
TaprootToLocalWitnessSize = 1 + 1 + 65 + 1 + TaprootToLocalScriptSize +
1 + TaprootBaseControlBlockWitnessSize + 32
+ // TaprootToLocalScriptSizeFinal: 40 bytes (production scripts).
+ // Replaces OP_CHECKSIG + OP_CSV + OP_DROP with
+ // OP_CHECKSIGVERIFY + OP_CSV, saving 1 byte.
+ TaprootToLocalScriptSizeFinal = TaprootToLocalScriptSize - 1
+
+ // TaprootToLocalWitnessSizeFinal: 174 bytes (production scripts).
+ TaprootToLocalWitnessSizeFinal = 1 + 1 + 65 + 1 +
+ TaprootToLocalScriptSizeFinal +
+ 1 + TaprootBaseControlBlockWitnessSize + 32
+
// TaprootToLocalRevokeScriptSize: 68 bytes
// - OP_DATA: 1 byte
// - local key: 32 bytes
@@ -667,6 +689,16 @@ const (
TaprootToRemoteScriptSize + 1 +
TaprootBaseControlBlockWitnessSize)
+ // TaprootToRemoteScriptSizeFinal: 36 bytes (production scripts).
+ // Replaces OP_CHECKSIG + OP_1 + OP_CSV + OP_DROP with
+ // OP_CHECKSIGVERIFY + OP_1 + OP_CSV, saving 1 byte.
+ TaprootToRemoteScriptSizeFinal = TaprootToRemoteScriptSize - 1
+
+ // TaprootToRemoteWitnessSizeFinal: 138 bytes (production scripts).
+ TaprootToRemoteWitnessSizeFinal = (1 + 1 + 65 + 1 +
+ TaprootToRemoteScriptSizeFinal + 1 +
+ TaprootBaseControlBlockWitnessSize)
+
// TaprootAnchorWitnessSize: 67 bytes
//
// In this case, we use the custom sighash size to give the most
@@ -695,6 +727,17 @@ const (
TaprootSecondLevelHtlcScriptSize + 1 +
TaprootBaseControlBlockWitnessSize
+ // TaprootSecondLevelHtlcScriptSizeFinal: 40 bytes (production
+ // scripts). Replaces OP_CHECKSIG + OP_DROP with OP_CHECKSIGVERIFY,
+ // saving 1 byte.
+ //nolint:ll
+ TaprootSecondLevelHtlcScriptSizeFinal = TaprootSecondLevelHtlcScriptSize - 1
+
+ // TaprootSecondLevelHtlcWitnessSizeFinal: production scripts.
+ TaprootSecondLevelHtlcWitnessSizeFinal = 1 + 1 + 65 + 1 +
+ TaprootSecondLevelHtlcScriptSizeFinal + 1 +
+ TaprootBaseControlBlockWitnessSize
+
// TaprootSecondLevelRevokeWitnessSize
// - number_of_witness_elements: 1 byte
// - sig_len: 1 byte
@@ -729,6 +772,13 @@ const (
TaprootHtlcOfferedRemoteTimeoutScriptSize = (1 + 32 + 1 + 1 + 1 + 1 +
1 + 4 + 1 + 1)
+ // TaprootHtlcOfferedRemoteTimeoutScriptSizeFinal: 43 bytes
+ // (production scripts). Replaces OP_CHECKSIG with OP_CHECKSIGVERIFY
+ // (saves 1 byte by dropping the trailing OP_DROP), but
+ // OP_CHECKSEQUENCEVERIFY + OP_DROP becomes CSV + OP_VERIFY (same
+ // size). Net saving: 1 byte.
+ TaprootHtlcOfferedRemoteTimeoutScriptSizeFinal = TaprootHtlcOfferedRemoteTimeoutScriptSize - 1 //nolint:ll
+
// TaprootHtlcOfferedRemoteTimeoutwitSize: 176 bytes
// - number_of_witness_elements: 1 byte
// - sig_len: 1 byte
@@ -742,6 +792,11 @@ const (
TaprootHtlcOfferedRemoteTimeoutScriptSize + 1 +
TaprootBaseControlBlockWitnessSize + 32
+ // TaprootHtlcOfferedRemoteTimeoutWitnessSizeFinal: 174 bytes (production scripts)
+ TaprootHtlcOfferedRemoteTimeoutWitnessSizeFinal = 1 + 1 + 65 + 1 +
+ TaprootHtlcOfferedRemoteTimeoutScriptSizeFinal + 1 +
+ TaprootBaseControlBlockWitnessSize + 32
+
// TaprootHtlcOfferedLocalTmeoutScriptSize:
// - OP_DATA: 1 byte (pub key len)
// - local_key: 32 bytes
@@ -751,6 +806,12 @@ const (
// - OP_CHECKSIG: 1 byte
TaprootHtlcOfferedLocalTimeoutScriptSize = 1 + 32 + 1 + 1 + 32 + 1
+ // TaprootHtlcOfferedLocalTimeoutScriptSizeFinal is the same as the
+ // staging version since SenderHTLCTapLeafTimeout ignores script
+ // options (the script is already identical between staging and
+ // production).
+ TaprootHtlcOfferedLocalTimeoutScriptSizeFinal = TaprootHtlcOfferedLocalTimeoutScriptSize //nolint:ll
+
// TaprootOfferedLocalTimeoutWitnessSize
// - number_of_witness_elements: 1 byte
// - sig_len: 1 byte
@@ -766,6 +827,15 @@ const (
TaprootHtlcOfferedLocalTimeoutScriptSize + 1 +
TaprootBaseControlBlockWitnessSize + 32
+ // TaprootOfferedLocalTimeoutWitnessSizeFinal: 235 bytes
+ // (production scripts). Not currently referenced because there is no
+ // dedicated Final witness type for this spending path — the script is
+ // identical between staging and final as SenderHTLCTapLeafTimeout
+ // ignores script options.
+ TaprootOfferedLocalTimeoutWitnessSizeFinal = 1 + 1 + 65 + 1 + 65 + 1 +
+ TaprootHtlcOfferedLocalTimeoutScriptSizeFinal + 1 +
+ TaprootBaseControlBlockWitnessSize + 32
+
// TaprootHtlcAcceptedRemoteSuccessScriptSize:
// - OP_SIZE: 1 byte
// - OP_DATA: 1 byte
@@ -784,6 +854,11 @@ const (
TaprootHtlcAcceptedRemoteSuccessScriptSize = 1 + 1 + 1 + 1 + 1 + 1 +
1 + 20 + 1 + 32 + 1 + 1 + 1 + 1
+ // TaprootHtlcAcceptedRemoteSuccessScriptSizeFinal: 43 bytes
+ // (production scripts). Replaces OP_CHECKSIG + OP_CSV + OP_DROP with
+ // OP_CHECKSIGVERIFY + OP_CSV, saving 1 byte (the trailing OP_DROP).
+ TaprootHtlcAcceptedRemoteSuccessScriptSizeFinal = TaprootHtlcAcceptedRemoteSuccessScriptSize - 1 //nolint:ll
+
// TaprootHtlcAcceptedRemoteSuccessScriptSize:
// - number_of_witness_elements: 1 byte
// - sig_len: 1 byte
@@ -799,6 +874,13 @@ const (
TaprootHtlcAcceptedRemoteSuccessScriptSize + 1 +
TaprootBaseControlBlockWitnessSize + 32
+ // TaprootHtlcAcceptedRemoteSuccessWitnessSizeFinal: 166 bytes
+ // (production scripts).
+ TaprootHtlcAcceptedRemoteSuccessWitnessSizeFinal = 1 + 1 + 65 +
+ 1 + 32 + 1 +
+ TaprootHtlcAcceptedRemoteSuccessScriptSizeFinal + 1 +
+ TaprootBaseControlBlockWitnessSize + 32
+
// TaprootHtlcAcceptedLocalSuccessScriptSize:
// - OP_SIZE: 1 byte
// - OP_DATA: 1 byte
@@ -817,6 +899,12 @@ const (
TaprootHtlcAcceptedLocalSuccessScriptSize = 1 + 1 + 1 + 1 + 1 + 1 +
20 + 1 + 1 + 32 + 1 + 1 + 32 + 1
+ // TaprootHtlcAcceptedLocalSuccessScriptSizeFinal is the same as the
+ // staging version since ReceiverHtlcTapLeafSuccess ignores script
+ // options (the script is already identical between staging and
+ // production).
+ TaprootHtlcAcceptedLocalSuccessScriptSizeFinal = TaprootHtlcAcceptedLocalSuccessScriptSize //nolint:ll
+
// TaprootHtlcAcceptedLocalSuccessWitnessSize:
// - number_of_witness_elements: 1 byte
// - sig_len: 1 byte
@@ -833,6 +921,16 @@ const (
TaprootHtlcAcceptedLocalSuccessWitnessSize = 1 + 1 + 65 + 1 + 65 + 1 +
32 + 1 + TaprootHtlcAcceptedLocalSuccessScriptSize + 1 +
TaprootBaseControlBlockWitnessSize + 32
+
+ // TaprootHtlcAcceptedLocalSuccessWitnessSizeFinal: 271
+ // bytes (production scripts). Not currently referenced because there
+ // is no dedicated Final witness type for this spending path — the
+ // script is identical between staging and final as
+ // ReceiverHtlcTapLeafSuccess ignores script options.
+ TaprootHtlcAcceptedLocalSuccessWitnessSizeFinal = 1 + 1 +
+ 65 + 1 + 65 + 1 + 32 + 1 +
+ TaprootHtlcAcceptedLocalSuccessScriptSizeFinal + 1 +
+ TaprootBaseControlBlockWitnessSize + 32
)
// EstimateCommitTxWeight estimate commitment transaction weight depending on
diff --git a/input/size_test.go b/input/size_test.go
index 2fba2c7..2e80515 100644
--- a/input/size_test.go
+++ b/input/size_test.go
@@ -1019,6 +1019,49 @@ var witnessSizeTests = []witnessSizeTest{
return witness
},
},
+ {
+ name: "taproot second level htlc success+timeout final",
+ expSize: input.TaprootSecondLevelHtlcWitnessSizeFinal,
+ genWitness: func(t *testing.T) wire.TxWitness {
+ testKey, err := btcec.NewPrivateKey()
+ require.NoError(t, err)
+
+ signer := &dummySigner{}
+
+ scriptTree, err := input.SecondLevelHtlcTapscriptTree(
+ testKey.PubKey(), testCSVDelay,
+ input.NoneTapLeaf(),
+ input.WithProdScripts(),
+ )
+ require.NoError(t, err)
+
+ tapScriptRoot := scriptTree.RootNode.TapHash()
+
+ revokeKey, err := btcec.NewPrivateKey()
+ require.NoError(t, err)
+
+ tapLeaf := scriptTree.LeafMerkleProofs[0].TapLeaf
+ witnessScript := tapLeaf.Script
+ signDesc := &input.SignDescriptor{
+ KeyDesc: keychain.KeyDescriptor{
+ PubKey: revokeKey.PubKey(),
+ },
+ WitnessScript: witnessScript,
+ HashType: txscript.SigHashAll,
+ InputIndex: 0,
+ SignMethod: input.TaprootKeySpendSignMethod,
+ TapTweak: tapScriptRoot[:],
+ }
+
+ witness, err := input.TaprootHtlcSpendSuccess(
+ signer, signDesc, testTx, revokeKey.PubKey(),
+ scriptTree,
+ )
+ require.NoError(t, err)
+
+ return witness
+ },
+ },
{
name: "taproot second level htlc revoke",
expSize: input.TaprootSecondLevelRevokeWitnessSize,
@@ -1353,6 +1396,76 @@ var witnessSizeTests = []witnessSizeTest{
)
require.NoError(t, err)
+ return witness
+ },
+ },
+ // Production taproot (Final) variants. These use WithProdScripts()
+ // which replaces OP_CHECKSIG + OP_DROP with OP_CHECKSIGVERIFY in
+ // the remote timeout and remote success scripts.
+ {
+ name: "taproot to local sweep final",
+ expSize: input.TaprootToLocalWitnessSizeFinal,
+ genWitness: func(t *testing.T) wire.TxWitness {
+ testKey, err := btcec.NewPrivateKey()
+ require.NoError(t, err)
+
+ signer := &dummySigner{}
+ commitScriptTree, err := input.NewLocalCommitScriptTree(
+ testCSVDelay, testKey.PubKey(),
+ testKey.PubKey(), input.NoneTapLeaf(),
+ input.WithProdScripts(),
+ )
+ require.NoError(t, err)
+
+ signDesc := &input.SignDescriptor{
+ KeyDesc: keychain.KeyDescriptor{
+ PubKey: testKey.PubKey(),
+ },
+ WitnessScript: commitScriptTree.SettleLeaf.Script,
+ HashType: txscript.SigHashAll,
+ InputIndex: 0,
+ SignMethod: input.TaprootScriptSpendSignMethod,
+ }
+
+ witness, err := input.TaprootCommitSpendSuccess(
+ signer, signDesc, testTx,
+ commitScriptTree.TapscriptTree,
+ )
+ require.NoError(t, err)
+
+ return witness
+ },
+ },
+ {
+ name: "taproot to remote sweep final",
+ expSize: input.TaprootToRemoteWitnessSizeFinal,
+ genWitness: func(t *testing.T) wire.TxWitness {
+ testKey, err := btcec.NewPrivateKey()
+ require.NoError(t, err)
+
+ signer := &dummySigner{}
+ commitScriptTree, err := input.NewRemoteCommitScriptTree(
+ testKey.PubKey(), input.NoneTapLeaf(),
+ input.WithProdScripts(),
+ )
+ require.NoError(t, err)
+
+ signDesc := &input.SignDescriptor{
+ KeyDesc: keychain.KeyDescriptor{
+ PubKey: testKey.PubKey(),
+ },
+ WitnessScript: commitScriptTree.SettleLeaf.Script,
+ HashType: txscript.SigHashAll,
+ InputIndex: 0,
+ SignMethod: input.TaprootScriptSpendSignMethod,
+ }
+
+ witness, err := input.TaprootCommitRemoteSpend(
+ signer, signDesc, testTx,
+ commitScriptTree.TapscriptTree,
+ )
+ require.NoError(t, err)
+
return witness
},
},
diff --git a/input/witnessgen.go b/input/witnessgen.go
index c49328a..aa23493 100644
--- a/input/witnessgen.go
+++ b/input/witnessgen.go
@@ -255,6 +255,41 @@ const (
// settled output of a malicious counterparty's who broadcasts a
// revoked taproot commitment transaction.
TaprootCommitmentRevoke StandardWitnessType = 34
+
+ // TaprootLocalCommitSpendFinal is a witness type that allows us to spend
+ // our settled local commitment after a CSV delay when we force close
+ // a final taproot channel (using production scripts).
+ TaprootLocalCommitSpendFinal StandardWitnessType = 35
+
+ // TaprootRemoteCommitSpendFinal is a witness type that allows us to spend
+ // our settled remote commitment after a CSV delay when the remote party
+ // has force closed a final taproot channel (using production scripts).
+ TaprootRemoteCommitSpendFinal StandardWitnessType = 36
+
+ // TaprootHtlcOfferedTimeoutSecondLevelFinal is a witness that allows us to
+ // timeout an HTLC we offered to the remote party on our commitment
+ // transaction for final taproot channels (using production scripts).
+ TaprootHtlcOfferedTimeoutSecondLevelFinal StandardWitnessType = 37
+
+ // TaprootHtlcAcceptedSuccessSecondLevelFinal is a witness that allows us to
+ // sweep an HTLC we accepted on our commitment transaction after we go
+ // to the second level on chain for final taproot channels (using production scripts).
+ TaprootHtlcAcceptedSuccessSecondLevelFinal StandardWitnessType = 38
+
+ // TaprootHtlcOfferedRemoteTimeoutFinal is a witness that allows us to sweep
+ // an HTLC we offered to the remote party that lies on the commitment
+ // transaction for the remote party for final taproot channels (using production scripts).
+ TaprootHtlcOfferedRemoteTimeoutFinal StandardWitnessType = 39
+
+ // TaprootHtlcAcceptedRemoteSuccessFinal is a witness that allows us to
+ // sweep an HTLC that was offered to us by the remote party for final
+ // taproot channels (using production scripts).
+ TaprootHtlcAcceptedRemoteSuccessFinal StandardWitnessType = 40
+
+ // TaprootCommitmentRevokeFinal is a witness that allows us to sweep the
+ // settled output of a malicious counterparty's who broadcasts a
+ // revoked final taproot commitment transaction (using production scripts).
+ TaprootCommitmentRevokeFinal StandardWitnessType = 41
)
// String returns a human readable version of the target WitnessType.
@@ -367,6 +402,27 @@ func (wt StandardWitnessType) String() string {
case TaprootCommitmentRevoke:
return "TaprootCommitmentRevoke"
+ case TaprootLocalCommitSpendFinal:
+ return "TaprootLocalCommitSpendFinal"
+
+ case TaprootRemoteCommitSpendFinal:
+ return "TaprootRemoteCommitSpendFinal"
+
+ case TaprootHtlcOfferedTimeoutSecondLevelFinal:
+ return "TaprootHtlcOfferedTimeoutSecondLevelFinal"
+
+ case TaprootHtlcAcceptedSuccessSecondLevelFinal:
+ return "TaprootHtlcAcceptedSuccessSecondLevelFinal"
+
+ case TaprootHtlcOfferedRemoteTimeoutFinal:
+ return "TaprootHtlcOfferedRemoteTimeoutFinal"
+
+ case TaprootHtlcAcceptedRemoteSuccessFinal:
+ return "TaprootHtlcAcceptedRemoteSuccessFinal"
+
+ case TaprootCommitmentRevokeFinal:
+ return "TaprootCommitmentRevokeFinal"
+
default:
return fmt.Sprintf("Unknown WitnessType: %v", uint32(wt))
}
@@ -516,9 +572,16 @@ func (wt StandardWitnessType) WitnessGenerator(signer Signer,
case NestedWitnessKeyHash:
return signer.ComputeInputScript(tx, desc)
- case TaprootLocalCommitSpend:
- // Ensure that the sign desc has the proper sign method
- // set, and a valid prev output fetcher.
+ case TaprootLocalCommitSpend, TaprootLocalCommitSpendFinal:
+ // Production (Final) taproot witness types share the
+ // same generation logic as their staging counterparts.
+ // The script differences between staging and final
+ // are captured in the SignDescriptor's script tree
+ // (ControlBlock, TapLeaf, etc.) at commitment
+ // construction time, so the witness generator here
+ // simply signs against whatever scripts were
+ // pre-populated — no channel-type awareness is needed
+ // at this layer.
desc.SignMethod = TaprootScriptSpendSignMethod
// The control block bytes must be set at this point.
@@ -538,7 +601,7 @@ func (wt StandardWitnessType) WitnessGenerator(signer Signer,
Witness: witness,
}, nil
- case TaprootRemoteCommitSpend:
+ case TaprootRemoteCommitSpend, TaprootRemoteCommitSpendFinal:
// Ensure that the sign desc has the proper sign method
// set, and a valid prev output fetcher.
desc.SignMethod = TaprootScriptSpendSignMethod
@@ -583,7 +646,9 @@ func (wt StandardWitnessType) WitnessGenerator(signer Signer,
}, nil
case TaprootHtlcOfferedTimeoutSecondLevel,
- TaprootHtlcAcceptedSuccessSecondLevel:
+ TaprootHtlcAcceptedSuccessSecondLevel,
+ TaprootHtlcOfferedTimeoutSecondLevelFinal,
+ TaprootHtlcAcceptedSuccessSecondLevelFinal:
// Ensure that the sign desc has the proper sign method
// set, and a valid prev output fetcher.
desc.SignMethod = TaprootScriptSpendSignMethod
@@ -671,7 +736,8 @@ func (wt StandardWitnessType) WitnessGenerator(signer Signer,
Witness: witness,
}, nil
- case TaprootHtlcOfferedRemoteTimeout:
+ case TaprootHtlcOfferedRemoteTimeout,
+ TaprootHtlcOfferedRemoteTimeoutFinal:
// Ensure that the sign desc has the proper sign method
// set, and a valid prev output fetcher.
desc.SignMethod = TaprootScriptSpendSignMethod
@@ -693,7 +759,7 @@ func (wt StandardWitnessType) WitnessGenerator(signer Signer,
Witness: witness,
}, nil
- case TaprootCommitmentRevoke:
+ case TaprootCommitmentRevoke, TaprootCommitmentRevokeFinal:
// Ensure that the sign desc has the proper sign method
// set, and a valid prev output fetcher.
desc.SignMethod = TaprootScriptSpendSignMethod
@@ -715,6 +781,26 @@ func (wt StandardWitnessType) WitnessGenerator(signer Signer,
Witness: witness,
}, nil
+ case TaprootHtlcAcceptedRemoteSuccess,
+ TaprootHtlcAcceptedRemoteSuccessFinal:
+ desc.SignMethod = TaprootScriptSpendSignMethod
+
+ if desc.ControlBlock == nil {
+ return nil, fmt.Errorf("control block " +
+ "must be set for taproot spend")
+ }
+
+ witness, err := SenderHTLCScriptTaprootRedeem(
+ signer, desc, tx, nil, nil, nil,
+ )
+ if err != nil {
+ return nil, err
+ }
+
+ return &Script{
+ Witness: witness,
+ }, nil
+
default:
return nil, fmt.Errorf("unknown witness type: %v", wt)
}
@@ -832,11 +918,17 @@ func (wt StandardWitnessType) SizeUpperBound() (lntypes.WeightUnit,
case TaprootLocalCommitSpend:
return TaprootToLocalWitnessSize, false, nil
- // Sweeping a self output after the remote party fro ce closes. Must
+ case TaprootLocalCommitSpendFinal:
+ return TaprootToLocalWitnessSizeFinal, false, nil
+
+ // Sweeping a self output after the remote party force closes. Must
// wait 1 CSV.
case TaprootRemoteCommitSpend:
return TaprootToRemoteWitnessSize, false, nil
+ case TaprootRemoteCommitSpendFinal:
+ return TaprootToRemoteWitnessSizeFinal, false, nil
+
// Sweeping our anchor output with a key spend witness.
case TaprootAnchorSweepSpend:
return TaprootAnchorWitnessSize, false, nil
@@ -846,6 +938,11 @@ func (wt StandardWitnessType) SizeUpperBound() (lntypes.WeightUnit,
return TaprootSecondLevelHtlcWitnessSize, false, nil
+ case TaprootHtlcOfferedTimeoutSecondLevelFinal,
+ TaprootHtlcAcceptedSuccessSecondLevelFinal:
+
+ return TaprootSecondLevelHtlcWitnessSizeFinal, false, nil
+
case TaprootHtlcSecondLevelRevoke:
return TaprootSecondLevelRevokeWitnessSize, false, nil
@@ -858,16 +955,24 @@ func (wt StandardWitnessType) SizeUpperBound() (lntypes.WeightUnit,
case TaprootHtlcOfferedRemoteTimeout:
return TaprootHtlcOfferedRemoteTimeoutWitnessSize, false, nil
+ case TaprootHtlcOfferedRemoteTimeoutFinal:
+ return TaprootHtlcOfferedRemoteTimeoutWitnessSizeFinal, false,
+ nil
+
case TaprootHtlcLocalOfferedTimeout:
return TaprootOfferedLocalTimeoutWitnessSize, false, nil
case TaprootHtlcAcceptedRemoteSuccess:
return TaprootHtlcAcceptedRemoteSuccessWitnessSize, false, nil
+ case TaprootHtlcAcceptedRemoteSuccessFinal:
+ return TaprootHtlcAcceptedRemoteSuccessWitnessSizeFinal, false,
+ nil
+
case TaprootHtlcAcceptedLocalSuccess:
return TaprootHtlcAcceptedLocalSuccessWitnessSize, false, nil
- case TaprootCommitmentRevoke:
+ case TaprootCommitmentRevoke, TaprootCommitmentRevokeFinal:
return TaprootToLocalRevokeWitnessSize, false, nil
}
Why this scored 28/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.