sybiliCC slot s+0

Docs

A call is read, scored and sealed before anything happens. These pages show how to pull one and check it yourself, with nothing but SHA-256.

Test the API

01 Quickstart

  1. Read the stream

    Newest mint first. p and leaf are empty while the first 8 slots are being read.

    GET /v1/stream?limit=3
  2. Take a proof

    Pick a sealed mint and ask for its merkle path to the window root.

    GET /v1/mints/{id}/proof
  3. Recompute the leaf

    After the reveal the salt is public. Hash the fields yourself, or let /v1/verify do it.

    POST /v1/verify
    { "mint": "...", "first_trade_slot": 123, "horizon": 40, "q": 1800, "salt": "...", "leaf": "..." }
  4. Seal your own

    Hash your odds for the same mint with a salt only you hold. It opens next to the model.

    POST /v1/calls
    { "mint": "...", "p": 0.35 }

02 The five words

Window

The first 8 slots after a mint's first trade. Everything inside is frozen when it closes.

Leaf

One hash per mint: the model version, the mint, the slot, the horizon, the odds and a salt.

Root

Twelve leaves are folded into one root, and the root is what goes on-chain.

Horizon

40 slots after the first trade. When it passes, the outcome is known.

Reveal

The salt opens. Anyone can rebuild the leaf and see that it matches the root.

03 Check a call

Ten lines in any browser console or Node. The leaf is the SHA-256 of seven fields joined with a pipe.

// salt, q and the slots come from GET /v1/mints/{id} after the reveal
async function leaf(m) {
  const s = ['00', 'v1', m.id, m.first_trade_slot, 40, m.q, m.salt].join('|');
  const h = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(s));
  return [...new Uint8Array(h)].map((x) => x.toString(16).padStart(2, '0')).join('');
}
const m = (await (await fetch('https://api.sybili.cc/v1/mints/' + id)).json());
console.log(await leaf(m) === m.leaf);   // true

Run it on the latest revealed mint

This runs the snippet above against the current stream, in this tab.

04 Endpoints

routewhat

Full schema: openapi.json. Every route can be run on the API page.

05 Errors

statuserrorwhen
404mint_not_foundThe id is not in the recent stream.
404window_not_foundWindows start at w-0001.
409not_sealedThe leaf is hashed when the score lands, after the first 8 slots.
409window_openThe window is still filling, so it has no root yet.
422bad_requestA field is missing or out of range.

06 Access

Closed for now. The explorer runs the routes against the stream clock inside your tab, so what you see there is how the public host will answer. The host opens with the first reveal, and every wallet connected on the home page is in the draw for the first seats.

Connect on the home page

— sealed —