Start here · Glossary · Test yourself · Feed
#Since and time locks ✕
18 lessons found. All lessons
PreviousPage 2 of 2
The deployed Cheque lock (RFC 0039) accepts a sender withdrawal only when the Cheque input's since is exactly 0xA000000000000006 (relative epoch, 6 epochs after the cell was committed). A since of 0 fails with Cheque error 11 (WithdrawChequeInputSinceError), so the sender cannot reclaim for about 24h after each create or renew.
#Since and time locks #Testing and devnet · Sources (1) · 2026-11-09
A raw since u64 can carry the reserved metric flag 0b11 (e.g. 0x6000_0000_0000_0000), for which ckb_sdk::Since::extract_metric() returns None, and a timestamp metric value can exceed what chrono can represent. Code that formats since values received from RPC should handle both cases instead of unwrapping, as ckb-cli now does by printing "invalid since" or "invalid".
#Since and time locks #Data encoding (molecule, hex, bigints) · Sources (1) · 2026-11-09
Under RFC 0017 since encoding, bit 63 marks relative and bits 61 to 62 select the metric (00 is block number), so a relative block count is RELATIVE_BLOCK_FLAG (0x8000000000000000) OR the count, and 256 blocks becomes 0x8000000000000100. In this commit the type script checks since >> 56 == 0x80, so reusing the absolute epoch form (top byte 0x20) is rejected on chain with an error code that does not name the since as the cause.
#Since and time locks · Sources (2) · 2026-10-02
When checking a transaction that uses header_deps for entropy (for example, headers at fixed offsets from a cell's inclusion block), derive the expected headers yourself: get the creating tx with get_transaction, then get_header on its block_hash, then get_header_by_number for the scheduled heights. Only then compare them to the tx's header_deps. Taking the headers from header_deps makes the check circular, since it only confirms the transaction agrees with itself.
#Since and time locks #Network and RPC reliability · Sources (1) · 2026-10-02
An input's since meant as an absolute epoch must have bit 61 set (0x2000000000000000) with bit 63 (relative) and bit 62 clear (RFC 0017). With all three top bits zero the node reads the same number as an absolute block number. The epoch number is in the low 24 bits (raw & 0xffffff), with index and length above it, so check the epoch number inclusively against the required epoch before signing.
since flag bits, not covered
#Since and time locks · Sources (1) · 2026-09-25
An input since meaning "not before epoch N" must be 0x2000000000000000 | N: top byte 0x20 (absolute, epoch metric) with the epoch number in the low 24 bits. Without the flag the node reads the value as an absolute block number, which for any realistic epoch is already past, so the node enforces no epoch bound. A script that reads since as an epoch must check the metric flag itself, as this project's contract does by refusing a since whose top byte is not 0x20.
Builder side rule for setting the epoch flag.
#Since and time locks · Sources (2) · 2026-09-25
PreviousPage 2 of 2
Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. JSON · Want a lesson changed or removed? Open an issue.