Technical · Raw markdown

Source: pcoc services/bari/README.md at aaa8946, with Hashcash and plant-tag detail from OPERATING.md and plant-attribution.md.

bari

One binary, bari. Crate pcoc-bari, library pcoc_bari, version 0.6.8, tag bari-v0.6.8.

It accepts 32-byte waypoints and later serves a Merkle path. It writes the index cache. It does not serve GET /index. The index HTTP reader is services/index.

Bari timestamps waypoints by sealing each tip's pool into one Bitcoin transaction. The plant fee buys position, not work. Bitcoin's proof-of-work does not secure a PCOC and does not pay for the hike.

Routes

Surface Role
POST /waypoint Append a 32-byte waypoint to the live tip's pool (Hashcash required)
GET /path/{leaf} Serve the Merkle path for a confirmed leaf
GET /ops Operator page

Hashcash

Required on POST /waypoint only. Header: X-Bari-Hashcash-Nonce: <u64 decimal>.

Item Value
Message SHA256(challenge ‖ waypoint ‖ nonce_le_u64)
Challenge SHA256(b"bari-hc-v1" ‖ tip_hash) from the live tip
Difficulty 21 leading zero bits (fixed; shared with produce)

A 204 means the waypoint was appended or was already held. It is not a promise that a path will be served.

Plant tag

Each plant is one Bitcoin transaction. The commitment is a 39-byte output script:

OP_RETURN ‖ push-37 ‖ BARI ‖ 0x02 ‖ the 32-byte Merkle root

That tag alone marks a plant for the initial release. Operator key attribution on funding inputs is a later, optional step (plant-attribution.md, proposed, not normative).

Cycle (short)

  1. Clients POST /waypoint into the pool for the live tip.
  2. While the mempool next-block minimum is below 1.1 sat/vB, Bari seals the pool into one tree and broadcasts a plant.
  3. The anchor window is 5 blocks from the broadcast height. Inside that window, GET /path/{leaf} returns inclusion height, txid, and Merkle path.
  4. A confirmed path stays servable after the window. There is no fee bump and no second broadcast of the same tree.

Tip modes

Mode What it is
Live BARI_TIP_SOURCE=bitcoin-gossip, plus a Bitcoin Core plant
Test BARI_TIP_SOURCE=synth, plus a simulated commit
Unset BARI_TIP_SOURCE remains the RPC poll and is not the live tip

Pins

hike and hike-net are pinned at ref-rust-v2.0.5.

More


From pcoc services/bari/README.md at aaa8946, plus OPERATING Hashcash and plant tag. Raw markdown.