CKB Pulse

All lessons · Rust scripts and ckb-std · Start here · Glossary

Absolute epoch since needs the 0x20 metric flag in the top byteWorkingFrom one fix

From one fix · Check: right · Checked 2026-11-19

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.

Why it matters: Without the flag the node treats an epoch number as a long-past block number. The intended epoch lower bound is then not enforced by the node, and the input is either unlocked early or refused by a script that checks the metric.

Builder side rule for setting the epoch flag.

Pattern

Prefer
{ previousOutput: shard.outPoint, since: ABSOLUTE_EPOCH_FLAG | epoch }

Taken from the commit, shortened.

A test changed in the same commit

It sits next to the fix. We did not run it.

Concepts
Since and time locks
Evidence
From one fix: from one project, checked against its commit
First seen
2026-09-25
Last changed
2026-09-25
Last checked
2026-11-19
Check against the commit
right: the lesson follows from its commit and still holds in the code today

Sources (2)

More about Rust scripts and ckb-std

All 35 in this topic

Do you maintain a project this lesson came from? Confirm or correct it

Cite this lesson
LusoCryptoLabs, "Absolute epoch since needs the 0x20 metric flag in the top byte", CKB lessons, https://pulse.lusocryptolabs.com/learned/scripts/absolute-epoch-since-needs-the-0x20-metric-flag-in-the-top-b, CC BY 4.0, last changed 2026-09-25.

Drawn from public commits and checked against the commit each one came from and the project's code today. Read the source before you rely on one. Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. Want a lesson changed or removed? Open an issue.