-
Notifications
You must be signed in to change notification settings - Fork 405
Open
Description
Summary
Add median-time-past (MTP) calculation capability to CheckPoint
for time-based validation in Bitcoin consensus rules.
Proposed Changes
- Extend
ToBlockHash
trait with optional block time:
fn block_time(&self) -> Option<u32> { None }
- Add
median_time_past()
method toCheckPoint
:- Calculate median of up to 11 previous block timestamps
- Return
None
if:- Data type doesn't support block times
- Required blocks are missing (sparse chain)
- Insufficient block history available
Use Cases
- Transaction time-lock verification (nLockTime, OP_CHECKLOCKTIMEVERIFY)
- BIP113 compliance
Notes
CheckPoint
represents a sparse chain, so required blocks may not be available- MTP = median of current block + up to 10 predecessors (sorted timestamps)
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
No status