From bbf992f7d399d7a529aabc998d2181ed6b5091fe Mon Sep 17 00:00:00 2001 From: nkohen Date: Thu, 27 Feb 2020 14:20:12 -0600 Subject: [PATCH] Specified squence numbers and locktimes to avoid fingerprinting and RBF Got rid of sequence and locktime restrictions on penalty tx --- Transactions.md | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Transactions.md b/Transactions.md index 2f12c8a..32be317 100644 --- a/Transactions.md +++ b/Transactions.md @@ -12,7 +12,6 @@ There is no strict constraint on how the two keys (Funding and ToLocal) and one * Remote Funding Inputs: `List[TransactionInput]` * Remote Change ScriptPubKey: `ScriptPubKey` * Remote Funding Public Key: `ECPublicKey` - * nLockTime: `UInt32` * Total Local Collateral: `CurrencyUnit` * Total Remote Collateral: `CurrencyUnit` * Fee Rate: `FeeUnit` @@ -21,14 +20,14 @@ Where - Local something something Remote - The sum of each `Funding Inputs`' value is at least that of its `Total Collateral` - `Funding Public Key`s are both 33-byte compressed public keys - - `nLockTime` is in the past (rather than just using 0) - - for privacy purposes and also to prevent [fee snipping](https://github.com/zkSNACKs/WalletWasabi/issues/2500) - Both `Change ScriptPubKey`s must be either `P2WSH/P2WPKH`, or `P2SH-P2WSH/P2SH-P2WPKH` ### Global - * nLockTime + * nLockTime is `0` ### Inputs * Local Funding Inputs + * All should have nSequence of `0xffffffff` * Remote Funding Inputs + * All should have nSequence of `0xffffffff` ### Outputs * P2WSH(DLC Funding Output) * Local Change ScriptPubKey @@ -68,6 +67,7 @@ Where * nLockTime ### Inputs * Input Spending(P2WSH(DLC Funding Output)) + * nSequence is `0xfffffffe` ### Outputs * P2WSH(ToLocalOutput) * ToRemoteOutput @@ -107,6 +107,7 @@ Where * nLockTime is `Timeout` ### Inputs * Input Spending(P2WSH(DLC Funding Output)) + * nSequence is `0xfffffffe` ### Outputs * ToLocalOutput * ToRemoteOutput @@ -116,7 +117,6 @@ Where - `ToRemoteOutput`'s value is `Total Remote Collateral + RefundFeeDelta/2` - `RefundFeeDelta = Computed CET Fee + Computed ToLocal Closing Fee - Computed Refund Tx Fee` (note that the Refund Transaction is smaller than any CET) - `ToLocalOutput`'s script is that of `Local Final Address` - - `ToRemoteOutput`'s script is that of `Remote Final Address` ## Mutual Closing Transaction @@ -125,7 +125,6 @@ Where * Local Payout: `CurrencyUnit` * Remote Final Address: `BitcoinAddress` * Remote Payout: `CurrencyUnit` - * nLockTime: `UInt32` * DLC Funding Output: `ScriptPubKey` * Fee Rate: `FeeUnit` @@ -133,13 +132,12 @@ Where - After the contract maturity time, Mutual Closing Transaction is created in cooperation for fee reduction and improvement in privacy - `Local Payout = (Contract Execution Transaction Local Payout).value` - `Remote Payout = (Contract Execution Transaction Remote Payout).value` - - `nLockTime` is in the past (rather than just using 0) - - for privacy purposes and also to prevent [fee snipping](https://github.com/zkSNACKs/WalletWasabi/issues/2500) - `DLC Funding Output` is of the form [specified above](#FundingOutputs) ### Global - * nLockTime + * nLockTime is `0` ### Inputs * Input Spending(P2WSH(DLC Funding Output)) + * nSequence is `0xffffffff` ### Outputs * ToLocalOutput * ToRemoteOutput @@ -162,30 +160,25 @@ Where Where - `ToLocalOutput` is of the form [specified above](#CETOutputs) - - `nLockTime` is in the past (rather than just using 0) - - for privacy purposes and also to prevent [fee snipping](https://github.com/zkSNACKs/WalletWasabi/issues/2500) ### Global - * nLockTime + * nLockTime is `0` ### Inputs * Input Spending(P2WSH(ToLocalOutput)) + * nSequence is `0xffffffff` ### Outputs * One output corresponding to `Local Final Address` with value `Local Payout` ## Closing Transaction (Penalty) ### Known Values * Local Address: `BitcoinAddress` - * nLockTime: `UInt32` * Remote's ToLocalOutput: `ScriptPubKey` * Fee Rate: `FeeUnit` Where - `Local Address` is any unused local address - `Remote's ToLocalOutput` is of the form [specified above](#CETOutputs) - - `nLockTime` is in the past (rather than just using 0) - - for privacy purposes and also to prevent [fee snipping](https://github.com/zkSNACKs/WalletWasabi/issues/2500) -### Global - * nLockTime ### Inputs * Input Spending(P2WSH(Remote's ToLocalOutput)) ### Outputs * One output corresponding to `LocalAddress` with value `P2WSH(Remote's ToLocalOutput).value - fee` +