Skip to content

Commit

Permalink
consensus: move nseq consensus-related methods from bp-std
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-orlovsky committed Oct 8, 2023
1 parent 1963ee9 commit 5a15bc9
Show file tree
Hide file tree
Showing 9 changed files with 138 additions and 94 deletions.
7 changes: 4 additions & 3 deletions consensus/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,14 +85,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};
Expand Down
4 changes: 3 additions & 1 deletion consensus/src/segwit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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<u8>) -> Result<Self, SegwitError> {
let len = program.len();
Expand Down
13 changes: 9 additions & 4 deletions consensus/src/stl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]
Expand All @@ -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<TypeLib, CompileError> { _bp_tx_stl() }
Expand Down Expand Up @@ -75,6 +77,9 @@ fn _bp_consensus_stl() -> Result<TypeLib, CompileError> {
.transpile::<TapScript>()
.transpile::<ControlBlock>()
.transpile::<BlockHeader>()
.transpile::<TimeLockInterval>()
.transpile::<LockTimestamp>()
.transpile::<LockHeight>()
.transpile::<Tx>()
.transpile::<VarInt>()
.transpile::<ByteStr>()
Expand Down
3 changes: 1 addition & 2 deletions consensus/src/taproot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<const LEN: usize> From<InvalidPubkey<LEN>> for DecodeError {
Expand Down
88 changes: 67 additions & 21 deletions consensus/src/timelocks.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]

Check warning on line 51 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L51

Added line #L51 was not covered by tests
#[display("invalid timelock value {0}")]
Expand All @@ -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)]
Expand Down Expand Up @@ -372,9 +375,52 @@ impl FromStr for LockHeight {
}

Check warning on line 375 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L375

Added line #L375 was not covered by tests
}

#[derive(Copy, Clone, Eq, PartialEq, Hash, Debug)]

Check warning on line 378 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L378

Added line #L378 was not covered by tests
#[derive(StrictType, StrictDumb, StrictEncode, StrictDecode)]
#[strict_type(lib = LIB_NAME_BITCOIN)]
#[cfg_attr(
feature = "serde",
derive(Serialize, Deserialize),

Check warning on line 383 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L383

Added line #L383 was not covered by tests
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) }

Check warning on line 397 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L397

Added line #L397 was not covered by tests

/// 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)
}

Check warning on line 404 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L402-L404

Added lines #L402 - L404 were not covered by tests

/// Gets structured relative time lock information from the `nSeq` value.
/// See [`TimeLockInterval`].
pub const fn time_lock_interval(self) -> Option<TimeLockInterval> {
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))

Check warning on line 412 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L408-L412

Added lines #L408 - L412 were not covered by tests
} else {
Some(TimeLockInterval::Height((self.0 & 0xFFFF) as u16))

Check warning on line 414 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L414

Added line #L414 was not covered by tests
}
}

Check warning on line 416 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L416

Added line #L416 was not covered by tests

pub const fn is_timelock(self) -> bool { self.0 & SEQ_NO_CSV_DISABLE_MASK > 1 }

Check warning on line 418 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L418

Added line #L418 was not covered by tests
}

/// 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)]

Check warning on line 423 in consensus/src/timelocks.rs

View check run for this annotation

Codecov / codecov/patch

consensus/src/timelocks.rs#L423

Added line #L423 was not covered by tests
#[derive(StrictType, StrictEncode, StrictDecode)]
#[strict_type(lib = LIB_NAME_BITCOIN, tags = order)]
#[cfg_attr(
Expand All @@ -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 {
Expand Down
20 changes: 1 addition & 19 deletions consensus/src/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)]
Expand Down Expand Up @@ -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)]
Expand Down
88 changes: 45 additions & 43 deletions stl/[email protected]
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
-----BEGIN STRICT TYPE LIB-----
Id: urn:ubideco:stl:3NDewC9zBEosrNM82npGstFcvPhjg9E9nLoQZrQq6kwe
Id: urn:ubideco:stl:4AXTqXq8jUDs244XbhvErdsG82Y8r9PiaPBPAmD5y9fQ
Name: Bitcoin
Dependencies:
urn:ubideco:stl:9KALDYR8Nyjq4FdMW6kYoL7vdkWnqPqNuFnmE9qHpNjZ

B0JpdGNvaW4Be4SAPJ764hElp3wsObxw0v3o+UOuDf2c9OaC7cdmynADU3RkAQNT
dGQBAGGGItF7rvBmAt/ndcmA4LNrbrroCQ2AdfdRO+xLk/ZNBEJvb2w0AAlCaXAz
dGQBAGGGItF7rvBmAt/ndcmA4LNrbrroCQ2AdfdRO+xLk/ZNBEJvb2w3AAlCaXAz
NDBTaWcGAgNzaWcABwAAQEAADHNpZ2hhc2hfdHlwZQAEAgAEbm9uZQAAAAEEc29t
ZQAFAQHbF2Q+dwkTJ+gEmSSB1dxgFSMIlVM55Yszn9RMT3JIKglCbG9ja0hhc2gF
AQAHAABAIAALQmxvY2tIZWFkZXIGBgd2ZXJzaW9uAABEDXByZXZCbG9ja0hhc2gB
Expand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Z3JhbQYCB3ZlcnNpb24B0ezadmfkQu1NEmmmZwM25f70
N69ezitprroMRlbE+q0HcHJvZ3JhbQAIAABAAgAAAAAAAAAoAAAAAAAAAA1XaXRu
ZXNzU2NyaXB0BQEBJav1uRIUF7qjOdRfexV1p3FL4Xp1GF3QMTV61Mkt6YYKV2l0
bmVzc1ZlcgMRAnYwAAJ2MVECdjJSAnYzUwJ2NFQCdjVVAnY2VgJ2N1cCdjhYAnY5
WQN2MTBaA3YxMVsDdjEyXAN2MTNdA3YxNF4DdjE1XwN2MTZgBVd0eGlkBQEABwAA
QCAAB1hPbmx5UGsFAQAHAABAIAA=

-----END STRICT TYPE LIB-----

Binary file modified stl/[email protected]
Binary file not shown.
9 changes: 8 additions & 1 deletion stl/[email protected]
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 5a15bc9

Please sign in to comment.