Skip to main content

Module ots_anchor

Module ots_anchor 

Source
Expand description

Bitcoin OTS anchor loop.

Periodically submits the current tree head to multiple OpenTimestamps calendar servers. The OTS proofs are stored in the database and served via GET /v1/head/<N>/ots.

ยงFrequency

Every 10 minutes by default. OTS aggregation means the per-batch Bitcoin cost is amortized across many log submitters; the actual on-chain footprint is one OP_RETURN per calendar per hour.

ยงCalendar servers

The default set mirrors what opentimestamps-client ships:

  • https://a.pool.opentimestamps.org
  • https://b.pool.opentimestamps.org
  • https://a.eternity.college
  • https://ots.btc.cat

A calendar failure is non-fatal โ€” the anchor proceeds with whichever calendars respond.

Functionsยง

anchor_once ๐Ÿ”’
One anchor cycle: snapshot the current tree head, submit to OTS calendars, store the result. Returns Ok if at least one calendar accepted.
build_placeholder_proof ๐Ÿ”’
Build a placeholder OTS proof for testing. The real implementation would parse the calendar server responses and assemble the proof per the OTS wire format (RFC opentimestamps).
run_anchor_loop
Run the OTS anchor loop in the background. Submits the current tree root to calendar servers at the configured interval.