rust-bitcoin-unsafe-fast/primitives/src
Andrew Poelstra 4e3af5162f
units: add global `BlockMtp` type
For our relative locktime API, we are going to want to take differences
of arbitrary MTPs in order to check whether they meet some relative
timelock threshold.

However, the `locktime::absolute::Mtp` type can only represent MTPs that
exceed 500 million. In practice this is a non-issue; by consensus MTPs
must be monotonic and every real chain (even test chains) have initial
real MTPs well above 500 million, which as a UNIX timestamp corresponds
to November 5, 1985.

But in theory this is a big problem: if we were to treat relative MTPs
as "differences of absolute-timelock MTPs" then we will be unable to
construct relative timelocks on chains with weird timestamps (and on
legitimate chains, we'd have .unwrap()s everywhere that would be hard to
justify). But we need to treat them as a "difference of MTPs" in *some*
sense, because otherwise they'd be very hard to construct.
2025-05-06 15:19:35 +00:00
..
locktime Merge rust-bitcoin/rust-bitcoin#4431: units: rename relative locktime types, absolute::Time, and constructors 2025-05-05 09:08:30 +10:00
script Make Lower/Upper hex print scripts with len prefix 2025-04-28 13:43:07 +10:00
block.rs 2025-04-27 automated rustfmt nightly 2025-04-27 01:36:56 +00:00
lib.rs units: add global `BlockMtp` type 2025-05-06 15:19:35 +00:00
merkle_tree.rs primitives: Make hex optional 2025-04-11 10:55:34 +10:00
opcodes.rs 2025-03-16 automated rustfmt nightly 2025-03-16 01:25:25 +00:00
pow.rs primitives: Enable pedantic lints 2025-03-06 10:58:17 +11:00
sequence.rs units: rename relative::HeightInterval constructors 2025-05-03 03:12:08 +00:00
taproot.rs Move taproot back to bitcoin crate 2025-02-26 15:45:49 +11:00
transaction.rs Add regression tests for Display impl 2025-04-30 16:14:05 +01:00
witness.rs 2025-04-27 automated rustfmt nightly 2025-04-27 01:36:56 +00:00