From f9a61ab553e552ffb3afb320e3f0ab4d8b229f7c Mon Sep 17 00:00:00 2001 From: Dr Maxim Orlovsky Date: Sun, 8 Oct 2023 21:22:25 +0200 Subject: [PATCH] consensus: move nseq consensus-related methods from bp-std --- consensus/src/lib.rs | 10 ++--- consensus/src/segwit.rs | 4 +- consensus/src/stl.rs | 13 ++++-- consensus/src/taproot.rs | 3 +- consensus/src/timelocks.rs | 88 ++++++++++++++++++++++++++++--------- consensus/src/tx.rs | 20 +-------- stl/Bitcoin@0.1.0.sta | 88 +++++++++++++++++++------------------ stl/Bitcoin@0.1.0.stl | Bin 2868 -> 2948 bytes stl/Bitcoin@0.1.0.sty | 9 +++- 9 files changed, 138 insertions(+), 97 deletions(-) diff --git a/consensus/src/lib.rs b/consensus/src/lib.rs index 5be4c4f1..7d5fe62a 100644 --- a/consensus/src/lib.rs +++ b/consensus/src/lib.rs @@ -19,9 +19,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -// Version 0.10.10: -// TODO: Ensure all serde uses both string and binary version -// TODO: Move consensus-level timelocks and sequence locks from other libraries // Version 0.11.0: // TODO: Ensure script length control doesn't panic for data structures > 4GB // Version 1.0: @@ -85,14 +82,15 @@ pub use sigtypes::{Bip340Sig, LegacySig, SigError, SighashFlag, SighashType}; pub use taproot::{ ControlBlock, FutureLeafVer, InternalPk, IntoTapHash, InvalidLeafVer, InvalidParityValue, LeafScript, LeafVer, OutputPk, Parity, TapBranchHash, TapCode, TapLeafHash, TapMerklePath, - TapNodeHash, TapScript, XOnlyPk, TAPROOT_ANNEX_PREFIX, TAPROOT_LEAF_MASK, + TapNodeHash, TapScript, XOnlyPk, MIDSTATE_TAPSIGHASH, TAPROOT_ANNEX_PREFIX, TAPROOT_LEAF_MASK, TAPROOT_LEAF_TAPSCRIPT, }; pub use timelocks::{ - InvalidTimelock, LockHeight, LockTime, LockTimestamp, TimelockParseError, LOCKTIME_THRESHOLD, + InvalidTimelock, LockHeight, LockTime, LockTimestamp, SeqNo, TimelockParseError, + LOCKTIME_THRESHOLD, SEQ_NO_CSV_DISABLE_MASK, SEQ_NO_CSV_TYPE_MASK, }; pub use tx::{ - Outpoint, OutpointParseError, Sats, SeqNo, Tx, TxIn, TxOut, TxParseError, TxVer, Txid, Vout, + Outpoint, OutpointParseError, Sats, Tx, TxIn, TxOut, TxParseError, TxVer, Txid, Vout, }; pub use util::{Chain, ChainParseError, NonStandardValue}; pub use weights::{VBytes, Weight, WeightUnits}; diff --git a/consensus/src/segwit.rs b/consensus/src/segwit.rs index 90fe506c..9df0da17 100644 --- a/consensus/src/segwit.rs +++ b/consensus/src/segwit.rs @@ -213,7 +213,7 @@ impl WitnessVer { /// Witness program as defined in BIP141. #[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)] #[derive(StrictType, StrictEncode, StrictDecode, StrictDumb)] -#[strict_type(lib = LIB_NAME_BITCOIN, dumb = {Self::new(strict_dumb!(), vec![0; 32]).unwrap()})] +#[strict_type(lib = LIB_NAME_BITCOIN, dumb = Self::dumb())] pub struct WitnessProgram { /// The witness program version. version: WitnessVer, @@ -222,6 +222,8 @@ pub struct WitnessProgram { } impl WitnessProgram { + fn dumb() -> Self { Self::new(strict_dumb!(), vec![0; 32]).unwrap() } + /// Creates a new witness program. pub fn new(version: WitnessVer, program: Vec) -> Result { let len = program.len(); diff --git a/consensus/src/stl.rs b/consensus/src/stl.rs index 9df9cde4..c5a9f94d 100644 --- a/consensus/src/stl.rs +++ b/consensus/src/stl.rs @@ -22,11 +22,13 @@ use strict_types::{CompileError, LibBuilder, TypeLib}; +use crate::timelocks::TimeLockInterval; use crate::{ Bip340Sig, BlockHeader, ByteStr, Chain, CompressedPk, ControlBlock, FutureLeafVer, InternalPk, - LeafScript, LegacyPk, LegacySig, OpCode, OutputPk, PubkeyHash, RedeemScript, ScriptHash, - TapCode, TapLeafHash, TapNodeHash, TapScript, Tx, UncompressedPk, VBytes, VarInt, WPubkeyHash, - WScriptHash, WeightUnits, WitnessProgram, WitnessScript, WitnessVer, Wtxid, LIB_NAME_BITCOIN, + LeafScript, LegacyPk, LegacySig, LockHeight, LockTimestamp, OpCode, OutputPk, PubkeyHash, + RedeemScript, ScriptHash, TapCode, TapLeafHash, TapNodeHash, TapScript, Tx, UncompressedPk, + VBytes, VarInt, WPubkeyHash, WScriptHash, WeightUnits, WitnessProgram, WitnessScript, + WitnessVer, Wtxid, LIB_NAME_BITCOIN, }; #[deprecated(since = "0.10.8", note = "use LIB_ID_BP_TX instead")] @@ -35,7 +37,7 @@ pub const LIB_ID_BITCOIN: &str = pub const LIB_ID_BP_TX: &str = "urn:ubideco:stl:6GgF7biXPVNcus2FfQj2pQuRzau11rXApMQLfCZhojgi#money-pardon-parody"; pub const LIB_ID_BP_CONSENSUS: &str = - "urn:ubideco:stl:3NDewC9zBEosrNM82npGstFcvPhjg9E9nLoQZrQq6kwe#remark-shelter-weekend"; + "urn:ubideco:stl:4AXTqXq8jUDs244XbhvErdsG82Y8r9PiaPBPAmD5y9fQ#cheese-provide-morph"; #[deprecated(since = "0.10.8", note = "use _bp_tx_stl instead")] fn _bitcoin_stl() -> Result { _bp_tx_stl() } @@ -75,6 +77,9 @@ fn _bp_consensus_stl() -> Result { .transpile::() .transpile::() .transpile::() + .transpile::() + .transpile::() + .transpile::() .transpile::() .transpile::() .transpile::() diff --git a/consensus/src/taproot.rs b/consensus/src/taproot.rs index 6a4a77bc..7b2d46e7 100644 --- a/consensus/src/taproot.rs +++ b/consensus/src/taproot.rs @@ -55,8 +55,7 @@ const MIDSTATE_TAPTWEAK: [u8; 8] = *b"TapTweak"; // d129a2f3701c655d6583b6c3b941972795f4e23294fd54f4a2ae8d8547ca590b /// The SHA-256 midstate value for the TapSig hash. -#[warn(dead_code)] -const MIDSTATE_TAPSIGHASH: [u8; 10] = *b"TapSighash"; +pub const MIDSTATE_TAPSIGHASH: [u8; 10] = *b"TapSighash"; // f504a425d7f8783b1363868ae3e556586eee945dbc7888dd02a6e2c31873fe9f impl From> for DecodeError { diff --git a/consensus/src/timelocks.rs b/consensus/src/timelocks.rs index debe100f..6aba41ac 100644 --- a/consensus/src/timelocks.rs +++ b/consensus/src/timelocks.rs @@ -28,6 +28,25 @@ use chrono::Utc; use crate::LIB_NAME_BITCOIN; +/// The Threshold for deciding whether a lock time value is a height or a time +/// (see [Bitcoin Core]). +/// +/// `LockTime` values _below_ the threshold are interpreted as block heights, +/// values _above_ (or equal to) the threshold are interpreted as block times +/// (UNIX timestamp, seconds since epoch). +/// +/// Bitcoin is able to safely use this value because a block height greater than +/// 500,000,000 would never occur because it would represent a height in +/// approximately 9500 years. Conversely, block times under 500,000,000 will +/// never happen because they would represent times before 1986 which +/// are, for obvious reasons, not useful within the Bitcoin network. +/// +/// [Bitcoin Core]: https://github.com/bitcoin/bitcoin/blob/9ccaee1d5e2e4b79b0a7c29aadb41b97e4741332/src/script/script.h#L39 +pub const LOCKTIME_THRESHOLD: u32 = 500_000_000; + +pub const SEQ_NO_CSV_DISABLE_MASK: u32 = 0x80000000; +pub const SEQ_NO_CSV_TYPE_MASK: u32 = 0x00400000; + /// Error constructing timelock from the provided value. #[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display, Error)] #[display("invalid timelock value {0}")] @@ -54,22 +73,6 @@ pub enum TimelockParseError { NoRand, } -/// The Threshold for deciding whether a lock time value is a height or a time -/// (see [Bitcoin Core]). -/// -/// `LockTime` values _below_ the threshold are interpreted as block heights, -/// values _above_ (or equal to) the threshold are interpreted as block times -/// (UNIX timestamp, seconds since epoch). -/// -/// Bitcoin is able to safely use this value because a block height greater than -/// 500,000,000 would never occur because it would represent a height in -/// approximately 9500 years. Conversely, block times under 500,000,000 will -/// never happen because they would represent times before 1986 which -/// are, for obvious reasons, not useful within the Bitcoin network. -/// -/// [Bitcoin Core]: https://github.com/bitcoin/bitcoin/blob/9ccaee1d5e2e4b79b0a7c29aadb41b97e4741332/src/script/script.h#L39 -pub const LOCKTIME_THRESHOLD: u32 = 500_000_000; - #[derive(Copy, Clone, Eq, PartialEq, Hash, Debug, Default)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] @@ -372,9 +375,52 @@ impl FromStr for LockHeight { } } +#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] +#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] +#[strict_type(lib = LIB_NAME_BITCOIN)] +#[cfg_attr( + feature = "serde", + derive(Serialize, Deserialize), + serde(crate = "serde_crate", transparent) +)] +pub struct SeqNo(u32); + +impl SeqNo { + #[inline] + pub const fn from_consensus_u32(lock_time: u32) -> Self { SeqNo(lock_time) } + + #[inline] + pub const fn to_consensus_u32(&self) -> u32 { self.0 } + + /// Creates relative time lock measured in number of blocks (implies RBF). + #[inline] + pub const fn from_height(blocks: u16) -> SeqNo { SeqNo(blocks as u32) } + + /// Creates relative time lock measured in number of 512-second intervals + /// (implies RBF). + #[inline] + pub const fn from_intervals(intervals: u16) -> SeqNo { + SeqNo(intervals as u32 | SEQ_NO_CSV_TYPE_MASK) + } + + /// Gets structured relative time lock information from the `nSeq` value. + /// See [`TimeLockInterval`]. + pub const fn time_lock_interval(self) -> Option { + if self.0 & SEQ_NO_CSV_DISABLE_MASK != 0 { + None + } else if self.0 & SEQ_NO_CSV_TYPE_MASK != 0 { + Some(TimeLockInterval::Time((self.0 & 0xFFFF) as u16)) + } else { + Some(TimeLockInterval::Height((self.0 & 0xFFFF) as u16)) + } + } + + pub const fn is_timelock(self) -> bool { self.0 & SEQ_NO_CSV_DISABLE_MASK > 1 } +} + /// Time lock interval describing both relative (OP_CHECKSEQUENCEVERIFY) and /// absolute (OP_CHECKTIMELOCKVERIFY) timelocks. -#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, From)] +#[derive(Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash, Debug, Display)] #[derive(StrictType, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN, tags = order)] #[cfg_attr( @@ -384,12 +430,12 @@ impl FromStr for LockHeight { )] pub enum TimeLockInterval { /// Describes number of blocks for the timelock - #[from] - Height(LockHeight), + #[display("height({0})")] + Height(u16), /// Describes number of 512-second intervals for the timelock - #[from] - Time(LockTimestamp), + #[display("time({0})")] + Time(u16), } impl Default for TimeLockInterval { diff --git a/consensus/src/tx.rs b/consensus/src/tx.rs index c42e7789..a85c4a2d 100644 --- a/consensus/src/tx.rs +++ b/consensus/src/tx.rs @@ -31,7 +31,7 @@ use commit_verify::{DigestExt, Sha256}; use crate::{ ConsensusDecode, ConsensusDecodeError, ConsensusEncode, LockTime, NonStandardValue, - ScriptPubkey, SigScript, VarIntArray, Witness, Wtxid, LIB_NAME_BITCOIN, + ScriptPubkey, SeqNo, SigScript, VarIntArray, Witness, Wtxid, LIB_NAME_BITCOIN, }; #[derive(Wrapper, Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, From)] @@ -215,24 +215,6 @@ mod _serde_outpoint { } } -#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)] -#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] -#[strict_type(lib = LIB_NAME_BITCOIN)] -#[cfg_attr( - feature = "serde", - derive(Serialize, Deserialize), - serde(crate = "serde_crate", transparent) -)] -pub struct SeqNo(u32); - -impl SeqNo { - #[inline] - pub const fn from_consensus_u32(lock_time: u32) -> Self { SeqNo(lock_time) } - - #[inline] - pub const fn to_consensus_u32(&self) -> u32 { self.0 } -} - #[derive(Clone, Eq, PartialEq, Hash, Debug)] #[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)] #[strict_type(lib = LIB_NAME_BITCOIN)] diff --git a/stl/Bitcoin@0.1.0.sta b/stl/Bitcoin@0.1.0.sta index 9e7cc16f..6b4649f8 100644 --- a/stl/Bitcoin@0.1.0.sta +++ b/stl/Bitcoin@0.1.0.sta @@ -1,11 +1,11 @@ -----BEGIN STRICT TYPE LIB----- -Id: urn:ubideco:stl:3NDewC9zBEosrNM82npG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aXB0ATh1BLFLfA5GbUee +F0d9JHQkf/gDZOw9S6r3OiD3QXRrCHNlcXVlbmNlAQEZbYUpyPbaRE0VTo2cjL2e +D42JAlo7sJEhxj1SsB6HB3dpdG5lc3MBc3dDcDaTIEnNKJUIqnF844KdskUuVehO +1PwuPM0uAJ0FVHhPdXQGAgV2YWx1ZQGX9dcGQq4qM5IlO6hOHc7Ek+O/PtNxsYdz +hjVOzIiCawxzY3JpcHRQdWJrZXkBvvwe/GalGf1kUmo6E4dA5/EQLQu+/zrBRk7z +90B2dFwFVHhWZXIFAQAARARUeGlkBQEABwAAQCAADlVuY29tcHJlc3NlZFBrBQEA +BwAAQEEABlZCeXRlcwUBAAAEBlZhckludAUBAAAIBFZvdXQFAQAABAtXUHVia2V5 +SGFzaAUBAAcAAEAUAAtXU2NyaXB0SGFzaAUBAAcAAEAgAAtXZWlnaHRVbml0cwUB +AAAEB1dpdG5lc3MFAQAIAAgAAEAAAAAAAAAAAP////8AAAAAAAAAAAAAAAD///// +AAAAAA5XaXRuZXNzUHJvZ3JhbQYCB3ZlcnNpb24B0ezadmfkQu1NEmmmZwM25f70 +N69ezitprroMRlbE+q0HcHJvZ3JhbQAIAABAAgAAAAAAAAAoAAAAAAAAAA1XaXRu +ZXNzU2NyaXB0BQEBJav1uRIUF7qjOdRfexV1p3FL4Xp1GF3QMTV61Mkt6YYKV2l0 +bmVzc1ZlcgMRAnYwAAJ2MVECdjJSAnYzUwJ2NFQCdjVVAnY2VgJ2N1cCdjhYAnY5 +WQN2MTBaA3YxMVsDdjEyXAN2MTNdA3YxNF4DdjE1XwN2MTZgBVd0eGlkBQEABwAA +QCAAB1hPbmx5UGsFAQAHAABAIAA= -----END STRICT TYPE LIB----- diff --git a/stl/Bitcoin@0.1.0.stl b/stl/Bitcoin@0.1.0.stl index 6e7be1b36cdd20fa06bc1e5d11c584ceaf8fa6c2..939ab1b35849240f41e0213d1bc5ab26872d6127 100644 GIT binary patch delta 113 zcmdlY)*?P3lF@u)R4}s+mrs6jwnu7adPWH=BLf2q2Z$e%nVSmc@xpk;C5gEOo3}AP rVb&D@$%4c^^GZ^S$`W%}m>AeHz$P$&G%+!-y$|4lF?*iR4_9qhfjWTc1UJ!>gJowPnb8qVxPqf0JN_Q#Q*>R diff --git a/stl/Bitcoin@0.1.0.sty b/stl/Bitcoin@0.1.0.sty index e1937717..2d93bf01 100644 --- a/stl/Bitcoin@0.1.0.sty +++ b/stl/Bitcoin@0.1.0.sty @@ -1,5 +1,5 @@ {- - Id: urn:ubideco:stl:3NDewC9zBEosrNM82npGstFcvPhjg9E9nLoQZrQq6kwe#remark-shelter-weekend + Id: urn:ubideco:stl:4AXTqXq8jUDs244XbhvErdsG82Y8r9PiaPBPAmD5y9fQ#cheese-provide-morph Name: Bitcoin Version: 0.1.0 Description: Consensus library for bitcoin protocol @@ -51,8 +51,12 @@ data LeafVer :: U8 data LegacyPk :: compressed Std.Bool {- urn:ubideco:semid:7ZhBHGSJm9ixmm8Z9vCX7i5Ga7j5xrW8t11nsb1Cgpnx#laser-madam-maxwell -}, pubkey [Byte ^ 33] -- urn:ubideco:semid:89ux18kFuT9nT6LEWnvkpFBiWR9GJwBYVVBqFUPvrTuj#gondola-middle-style data LegacySig :: sig [Byte ^ ..0xff], sighash_type SighashType +-- urn:ubideco:semid:Gm9B1aVGcLG8MQ27bZrVg4mteg1AuKoFn1aFNkZ72Y2Y#greek-support-hawaii +data LockHeight :: U32 -- urn:ubideco:semid:4dDWWU4afiPN3q4AgCMuFRFhL4UDta2u5SrqrBzPvjby#tokyo-inch-program data LockTime :: U32 +-- urn:ubideco:semid:8h25q8Va3Sx3csGvq4reMPqG7w4QrEowpYxdMAwaErmF#compass-protein-barcode +data LockTimestamp :: U32 -- urn:ubideco:semid:F8WJfUNUgyVDSX6zXjrdi2pWBa54zLWorawtahJf33Hw#shampoo-rufus-tobacco data OpCode :: pushBytes0:0 | pushBytes32:32 | pushData1:76 | pushData2:77 | pushData4:78 | reserved:80 | pushNum1:81 | return:106 @@ -102,6 +106,9 @@ data TapMerklePath :: [TapBranchHash ^ ..0x80] data TapNodeHash :: [Byte ^ 32] -- urn:ubideco:semid:71AxyLFsoRG6hJ1c11gxad65nEbWfzkQBjWCPPrgCyjX#telecom-quest-helium data TapScript :: ScriptBytes +-- urn:ubideco:semid:EjaLfxk1qE5LgYWBnrg1tcYHAcmMnCXd2S1S3szJw666#texas-tommy-geneva +data TimeLockInterval :: height U16 + | time U16 -- urn:ubideco:semid:DynChojW1sfr8VjSoZbmReHhZoU8u9KCiuwijgEGdToe#milk-gloria-prize data Tx :: version TxVer , inputs [TxIn ^ ..0xffffffff]