Seedelf Wallet reads Cardano mainnet through this API, at https://mainnet.seedelf.logicalmechanism.io. Seedelf Wallet is a Cardano wallet for Chrome with Seedelf built in; Seedelf is a stealth wallet that hides who receives and who spends (what Seedelf is). The API sits in front of its own Cardano node, db-sync (the chain in a Postgres database) and Kupo (an index of only the outputs it’s set to match).
Mainnet only, for the chain. On preprod the wallet reads Koios (koios.rest, a public Cardano API). On mainnet it reads Koios alone when Settings → Read Cardano through Koios only is on. Seedelf Messaging’s relay keeps a preprod pool beside mainnet’s, since its envelopes need no chain; its preprod list of certificates is checked against Koios preprod.
The wallet falls back to Koios part by part. When a part of this API can’t answer, the wallet reads that part from Koios instead. The parts are the three the wallet’s Settings name: the private balance, the public account, and sending. The public routes and the submit part take Koios’s own paths and JSON, so for them the fallback is only a change of base URL.
/api/v1/ paths and JSON. They take only the requests the wallet makes./api/v1/submittx and /api/v1/ogmios paths, passed to a cardano-submit-api and an Ogmios, for sending./health: each part’s state.Every request passes the edge first: a bucket per IP, a monthly traffic ceiling, and CORS for the wallet’s origins only. The relay has buckets and a ceiling of its own.
It’s its own Cargo workspace, with the Rust that rust-toolchain.toml pins.
cp .env.example .env # then fill it in; git ignores it
cargo run -p seedelf-data-api
curl http://127.0.0.1:8099/health
cargo build --release -p seedelf-data-api builds the binary. It reads its settings from the environment, or from a .env file in the folder it runs from or any folder above it:
| Variable | What it is |
|---|---|
MAINNET_DATABASE_URL |
db-sync’s Postgres, through a read-only role. The only one required. |
MAINNET_KUPO_URL |
a Kupo that matches the contract and the mix box: the private index’s second source. Without it, the private index reads db-sync alone. |
PREPROD_KOIOS_URL |
Koios preprod’s API, which the relay asks at each preprod certificate post (below): https://preprod.koios.rest/api/v1 unset. Anything but an https:// URL is refused at start: Koios is reached over TLS alone, and no redirect is followed. |
MAINNET_SUBMIT_API_URL, MAINNET_OGMIOS_URL |
cardano-submit-api and Ogmios, for the submit part. submittx needs both and ogmios needs Ogmios; a route missing one answers 503. |
DATA_LISTEN |
where it listens: 127.0.0.1:8099 by default |
DATA_ORIGINS, DATA_TRUST_PROXY, DATA_EGRESS_GB_MONTH, DATA_MESSAGING_GB_MONTH, DATA_STATE_DIR |
the edge’s settings (below) |
DATA_IN_FLIGHT_MESSAGING_ADDRESS, DATA_IN_FLIGHT_DATA_ADDRESS, DATA_IN_FLIGHT_MESSAGING, DATA_IN_FLIGHT_DATA, DATA_ANSWERS_MIB, DATA_COMPRESSING, DATA_CONNECTIONS |
the edge’s caps (below) |
DATA_MESSAGING_READ_MIB_DAY, DATA_MESSAGING_READ_POOLS_DAY, DATA_MESSAGING_RESERVE_PERCENT, DATA_MESSAGING_RESERVE_PAGE_KIB, DATA_MESSAGING_RESERVE_READ_MIB_DAY, DATA_MESSAGING_OFF |
the relay’s reading, its reserve, and its off switch (below) |
RUST_LOG |
the log level: info by default |
What the services need, as templates in deploy/home/:
db-sync-insert-options.json, the read-only role in seedelf_reader.sql, and the extra indexes in db-sync-indexes.sql;kupo_seedelf.service runs it;tx-submit-mainnet-config.yaml, and Ogmios.It listens on loopback by default. On the VPS, Caddy is in front of it, for TLS. Never expose it without TLS.
Tests:
cargo test # offline
cargo test -- --ignored --test-threads=1 # live, against the services in .env
cargo clippy --all-targets -- -D warnings
cargo fmt --check
The live tests run one at a time: the database role allows 10 connections, and a running server holds some of them.
The API runs on a VPS, behind Caddy. The services it reads run on a separate machine, which the VPS reaches through a WireGuard tunnel.
default_transaction_read_only, a 60 s timeout. That Postgres has neither Koios’s own SQL functions (its grest schema) nor the pg_cardano extension they use, so the SQL is the API’s own./health also says whether the node is synced.api/data/token-decimals.json), and the wallet’s mainnet token list, which says which tokens’ Lovejoin pools are shown.What the code does is in this repository; what runs on the servers isn’t something a user can check. The deployed binary is built from main by .github/workflows/data-layer-deploy.yml, whose run prints its SHA-256.
api/src/edge.rs), and forgotten once the bucket is full again and nothing of its is open. The relay also counts what each address has posted, in memory and never tied to a message: lately, to price its next post, forgotten as the count decays; and in each hour, to cap what it has in a pool, forgotten 36 hours after the hour ends. And how many bytes of pages it was sent in each hour, to cap what it reads in a day, and of those, the reserve’s, to cap its share of that: forgotten a day after the hour ends, counts alone, never which pages or cursors (the relay).RUST_LOG directive can turn them up (api/src/main.rs).deploy/edge/Caddyfile). Postgres’s log holds no statement (deploy/home/postgresql-seedelf.conf), and Kupo’s HTTP log, set to Warning, no request path (deploy/home/kupo_seedelf.service).api/src/submit.rs).egress.json, and the relay’s messaging-egress.json), so a restart doesn’t forget them, and the relay’s pools (messaging-<pool>.pool): the envelopes it holds and when each came, which anyone can download anyway, saved every minute so a deploy keeps what’s waiting. Beside each, its list (messaging-<pool>.list): the certificates posted to it, in the order they came and never when, which anyone can download too; the day each removal was made, which it keeps a week; the first 8 bytes of the listing digests of those withdrawn, with the name and register each named; and, on preprod, where its slow re-check stands, the time its round began and the last Seedelf it asked about, by a hash of its name and register, and the Unix day’s count of requests to Koios. A list file that can’t be read is moved aside, as messaging-<pool>.list.unreadable.<Unix seconds>, never overwritten, and the list starts empty, numbered above every cursor it gave out (below). When each envelope came is public to anyone who polls a pool, to the second; what the relay says of it otherwise is to the 10 minutes, no closer: a re-post’s already gives its copy’s expiry rounded down, and a full pool’s Retry-After its wait rounded up.Cache-Control: no-store.What stands between the internet and the routes, in api/src/edge.rs, and the listener under them, in api/src/serve.rs. Caddy in front does TLS and its own timeouts, over HTTP/1.1 and HTTP/2 alone (deploy/edge/Caddyfile), so every limit on what a client may ask is in this repository’s code.
| Setting | What it does |
|---|---|
DATA_ORIGINS |
the origins CORS lets read answers, comma-separated: the wallet’s chrome-extension://<id>. The wallet then needs no host permission. Retry-After is exposed, and a 429 carries CORS too, so the wallet can read why it waits. None by default. |
DATA_TRUST_PROXY=true |
behind Caddy on loopback: the client is the last X-Forwarded-For address. From anywhere else the header is ignored. Any value but true or false is refused at start. |
DATA_EGRESS_GB_MONTH |
the API’s own traffic a calendar month (UTC), in GB, before every route but /health answers 503. Each day gets an equal share of what’s left, so a flood costs a day, not the rest of the month. The count is kept in egress.json in DATA_STATE_DIR, or systemd’s StateDirectory, so a restart doesn’t forget it; with neither, the count starts from zero at each restart. Unset, there’s no ceiling. It counts response bodies alone: TLS and headers come on top. A value that isn’t a number above 0, 0 included, is refused at start, and the API doesn’t run. |
DATA_IN_FLIGHT_MESSAGING_ADDRESS, DATA_IN_FLIGHT_DATA_ADDRESS |
the most requests one client has in flight at once on the relay’s routes and on the rest, from 1 to 4,096: 16 and 64 unset. Below 16 on the relay, Caddy’s own idle connections can hold a client’s last answers counted for up to 2 minutes (below). |
DATA_IN_FLIGHT_MESSAGING, DATA_IN_FLIGHT_DATA |
the most in flight from every client together, from 1 to 65,536: 512 and 2,048 unset |
DATA_ANSWERS_MIB |
the most bytes of the data routes’ answers held at once, not yet handed to a connection, in MiB, from 1 to 4,096: 256 unset, at least 8 times the largest answer |
DATA_COMPRESSING |
the most answers compressed at once, from 0 (none) to 4,096: 64 unset |
DATA_CONNECTIONS |
the most connections open at once, from 16 to 60,000: 8,192 unset |
DATA_MESSAGING_GB_MONTH |
the relay’s share of that, at most, counted the same way (in messaging-egress.json). Past it, the relay’s routes answer 503 and every other route goes on: a flood of messages can spend messaging’s allowance, never the wallet’s reads. The last tenth of each day’s share is a reserve for posts and short pages. Its traffic counts toward DATA_EGRESS_GB_MONTH too. Unset, the relay has no ceiling of its own, and no reserve: it spends the API’s allowance, and /health says "ceiling":false. As with that one, 0 is refused at start and the API doesn’t run, so it never stops Messages alone: DATA_MESSAGING_OFF does (the relay). |
A bucket per client: 300 units, refilled at 10 a second. IPv6 addresses are taken by their /64.
| Request | Costs |
|---|---|
the private index, /health, and the public answers that are the same for everyone: tip, epoch_params, totals, pool_list, proposal_list |
1 |
| any other public route: one user’s live SQL | 4 |
submittx, ogmios |
10 |
The relay’s routes have buckets of their own, the same size, so catching up on messages never makes the wallet’s other reads wait: a page costs 1 and a post 4, and a page’s bytes are charged as every answer’s are.
Retry-After. The wallet paces itself under this: it keeps to 80 units every 10 s, by these weights (DATA_LIMIT in the wallet’s data-layer.ts).no-cors fetch, a page load), or one from an origin that isn’t the wallet’s. The browser would hide the answer from the page but still download it, so any site’s visitors could spend the month’s traffic. A request with neither header (curl, a monitor) passes, and /health always does.Access-Control-Max-Age is 24 h, which Chrome caps at 2, so the wallet needn’t send one before every POST.too many requests at once with Retry-After: 1, before the bucket, so it costs nothing. One wallet’s reads fan out to under 20 at once, each answered in moments, so only requests held open reach a cap. Every wallet behind one address (a household, a carrier’s NAT) shares its caps.busy with Retry-After: 30, before the bucket, so it costs nothing; a data answer whose length is known and would pass the bytes’ total is that 503 too. Each part has its own, so a flood of one never takes the other’s places, and /health is outside them all, so the deploy’s check reads it during a flood. About 32 IPv4 addresses holding requests open fill a part: then it refuses at once, rather than the droplet running out of ports or memory.api/src/serve.rs). Past it, a new one is closed at once, and Caddy answers that request 502.TCP_USER_TIMEOUT, set on the listener with a 32 KiB send buffer): 60 s without progress, not 60 s an answer, so a slow reader that keeps reading gets its answer, and a stalled one holds at most 64 KiB in the kernel. Through Caddy, whose write ends an answer 60 s after its head, a full page (264,208 bytes) needs about 35 kbit/s.Content-Length.DATA_COMPRESSING): past that, an answer goes out uncompressed, as if the client had asked for no encoding. Brotli’s encoder held about four times gzip’s memory while its answer was in flight.submittx (16 KiB), ogmios (64 KiB), and the public routes’ POSTs (16 KiB). A request with a body on any other route, by any method, is a 400 this route takes no body, unread, before the bucket. One whose declared length is past its route’s is a 413 in JSON, unread, at once. Both close the connection.api/src/serve.rs): at SIGTERM no new connection is taken, and what’s under way has 10 s to finish. What’s still open then is dropped, and the month’s traffic and the relay’s pools are written down, the pools marked clean. systemd’s own limit is 30 s (deploy/edge/seedelf-data-api.service).GET /health says each part’s state:
private, public and submit: ok or down;source: which source the private index answers from, db-sync or kupo;egress: over once the month’s traffic ceiling is passed;messaging: the relay’s relay, off while DATA_MESSAGING_OFF stops every pool, partly while it stops one (each pool’s stopped says which), and on otherwise; egress, over past its own ceiling; ceiling, whether DATA_MESSAGING_GB_MONTH is set at all (false: the relay spends the API’s own allowance); day_left, the percent of today’s share still unspent (null without a ceiling); reserve, true once the day is down to its reserve; and each pool’s stopped (true while the off switch stops it), its envelopes and bytes, the certificates its list holds and the withdrawn digests it keeps, and chain, where it checks a certificate against the chain: index (mainnet’s, the private index), koios (preprod’s) or none (every certificate refused). Nothing of any one client;db_sync and kupo: each source’s tip and its age;node: the node’s tip as Ogmios says it, its age, and whether Ogmios is connected to it;network: always mainnet.It answers 200 while the private index and the public routes answer and the month’s traffic is under its ceiling, and 503 otherwise. The submit part’s and the relay’s states are said but don’t change the status.
It lists every UTxO at two payment credentials (api/src/constants.rs): the Seedelf wallet contract, 94bca9c099e84ffd90d150316bb44c31a78702239076a0a80ea4a469, and the mix box of Lovejoin’s classic pool, c145c10ff4bcaef7f5a4dbb3fcbfddca4b6c7b08191b0690b12f1fad. The routes take no parameter but a cursor (api/src/private.rs), so no request says which rows are the asker’s.
What a cursor is: a point on the chain the server hands out, written <slot>.<block hash>. Its slot is a multiple of 200, at least 200 slots below the tip (about 10 blocks), and its hash is the newest block’s at or before that slot. The server refuses any other slot with a 400. 200 slots is deeper than the forks mainnet usually sees, so a cursor almost never rolls back; when one does, the answer says reset. Wallets that read within the same 200 slots hold the same cursor, so one answer serves them all, and a request shows only roughly when its wallet last read.
Every route is under /seedelf/v1/mainnet/, and every answer carries network and the source’s tip (its slot, hash and time).
| Route | Answer |
|---|---|
contract/snapshot |
the contract’s rows unspent as of the stable cursor |
contract/since/{cursor} |
what changed after that cursor, which the answer repeats as from: created (each with its spent, if it’s gone since) and spent (older rows spent after it, each its ref, slot, time and by), plus the new stable cursor |
names |
every Seedelf unspent at the tip, with the row that holds it. A Seedelf is a token under the Seedelf policy, 84967d911e1a10d5b4a38441879f374a07f340945bcf9e7697485255, whose name starts with 5eed0e1f |
lovejoin/pool and lovejoin/since/{cursor} |
the same for Lovejoin’s classic pool, at its mix box. Each box carries made_by: whether its transaction spent a box itself, and each input’s payment and stake credentials |
For example, the contract’s rows, then what changed since:
api=https://mainnet.seedelf.logicalmechanism.io
curl -s "$api/seedelf/v1/mainnet/contract/snapshot" # {"network", "tip", "cursor", "rows"}
curl -s "$api/seedelf/v1/mainnet/contract/since/<cursor>" # <cursor> from the answer above
How a wallet reads it:
C.since/C gives the changes after it. The settled view plus created minus every spend is the view at the tip.cursor is the new settled point C'. Apply only the entries at or below C' to the settled view. Everything above it is recomputed from the next answer, so a fork above a cursor never needs undoing.reset: true means the cursor’s own block was rolled back: start again from a snapshot. A reset carries no cursor, so none can be taken by mistake.An answer’s cursor never goes back. A source a little behind the one that handed out from answers with from itself as the cursor.
Two sources, one answer. db-sync answers first. Kupo answers instead while db-sync is down, its tip over 3 minutes old, or more than 60 slots (about 3 blocks) behind Kupo’s, and whenever a db-sync read fails.
made_by.inputs is null. Kupo indexes the outputs at the contract and the mix box, not who paid for a transaction. The live tests compare the two sources row for row (api/tests/live_private.rs).Retry-After, and the wallet goes to Koios.X-Most-Recent-Checkpoint) moves between the reads, they’re made again, 3 tries in all; after that the read counts as failed.reset from Kupo.Caching: each source’s answers are kept until its tip moves. Both tips are read every 2 s, so one set of reads per block serves every request.
since answer from an old cursor can be hundreds of KB, and anyone can ask for one. The answers every wallet reads (the snapshots, the token pools’ included, the names, epoch_params, totals) are kept whatever the budget holds.Beside the classic pool, anyone can launch a Lovejoin pool, each with its own box value: ADA, or ADA and a token. These routes are under /seedelf/v1/mainnet/lovejoin/ too, and db-sync alone answers them: Kupo indexes neither the pools nor the holder, where every launch puts its pool’s reference UTxO (below). While db-sync can’t answer, they answer 503, the wallet reads the token pools from Koios, and the classic pool’s routes go on answering from Kupo.
| Route | Answer |
|---|---|
lovejoin/pools |
every shown pool as of the stable cursor: its id, its version (its template set, below: v2 or tokenV1), its reference UTxO, the seed its launch spent, its mix_box and mix_logic reference scripts at the holder (each row with its script_hash; the wallet derives the bytes), where its launch is (tx, block, index in the block, slot and time), and its crowd; and the classic pool’s crowd |
lovejoin/tokens and lovejoin/tokens/since/{cursor} |
the boxes of every shown pool, read as lovejoin/pool and lovejoin/since are, with pools: the mix_box hashes covered, those shown as of the cursor (or from’s). A box’s made_by.mixed is whether its transaction spent from its own pool |
What a launch is: it spends a seed UTxO, and the seed fixes the pool’s scripts. Applied to the seed, one_shot_mint hashes to P, mix_logic to L and mix_box to M. P is the policy of the pool’s lovejoin NFT and the pool’s id; M is where the boxes sit. The launch puts the pool’s reference UTxO at the holder, reference_holder: an always-false script with no parameters, so whatever is put there stays for good.
Two template sets: the versions of Lovejoin’s token-pool scripts the API recognises. v2 is the one the wallet launches pools on. tokenV1 is an older set: the wallet no longer launches on it, and only brings boxes back from its pools. They differ only in mix_logic, and a seed makes the same P on either, so a pool’s datum’s L says which set it runs.
A pool is shown (listed here, and offered by the wallet) when it’s standard and the earliest standard pool launched with its values on its template set (its box’s ADA and token), ordered by block, then place in the block, then id. A later standard pool with the same values on the same set is a copy, and isn’t shown. The sets are separate: a v2 pool is never a copy of a tokenV1 pool, and a tokenV1 pool shown stays shown, for the boxes the wallet brings back from it. Standard means:
lovejoin NFT and ADA alone, and its datum has the shape one_shot_mint requires of a launch;tokens/list.json, built in), or it’s an ADA pool at any amount but the classic pool’s 10 ₳;mix_box and mix_logic at the holder’s script (its payment part, whatever the stake part; never the key address under the holder’s hash), each under no datum or a datum nested at most 128 levels deep (the deepest the wallet reads), and registered L as a stake credential, unless L was registered in an earlier block. The wallet passes over a script row under a deeper datum and never shows its pool, so this rule leaves the pool out too; if the launch also put a readable copy of the script at the holder, that copy is the one listed.The rule is in api/src/lovejoin/standard.rs. None of it changes once it’s on chain, so each candidate is checked once and its verdict kept in memory, and a pool shown stays shown. Everything at the holder is locked for good, so spam there is burned, and costs this server one check.
A pool’s crowd is its boxes, the deposits they could have come from, and how many of the boxes a mix made (mixed). A transaction that pays a pool’s mix_box without spending from it is a deposit; one that spends from it is a mix, and each box it makes could have come from any deposit behind any of its inputs. The deposits counted are those some box in the pool now could have come from, worked backwards from the boxes through each mix. A box is an output at the pool’s mix_box script, whatever its stake part, holding exactly the box value, under a datum that’s constructor 0 of two different 48-byte values, written either way the ledger reads it (tag 121, or 102([0, fields])). The key address under mix_box’s hash holds no box: nothing can spend it. The two values are meant as BLS12-381 G1 points; checking that they’re on the curve is left to the wallet. The crowd is the same for everyone; the wallet leaves its own boxes out of the count it shows.
For example, every shown pool and its crowd:
curl -s "https://mainnet.seedelf.logicalmechanism.io/seedelf/v1/mainnet/lovejoin/pools" # {"network", "cursor", "classic", "pools"}
Kept: a cursor’s pool list, for an hour. It’s worked out once per cursor, in the background rather than inside a request, with a minute’s budget. A request waits at most 5 s; past that, or when its cursor or the list can’t be read, it gets the last list worked out, and a 503 only before the first one exists. The boxes’ feed is kept for db-sync’s tip.
Koios’s paths and JSON, so a wallet falls back by changing its base URL. The code is api/src/public/.
| Route | What the wallet asks | Kept |
|---|---|---|
credential_utxos |
up to 75 payment credentials’ unspent outputs, 1,000 a page by outpoint, optionally only blocks after a height; at most 20,000 in all (but the contract’s and mix box’s) | a block, for the contract’s or mix box’s; otherwise never |
address_utxos |
up to 20 addresses’ unspent outputs, paged the same way; at most 20,000 in all | never |
utxo_info |
up to 60 outputs, spent or not | never |
datum_info |
up to 60 datums’ CBOR | never |
tip |
the newest block | read every 2 s |
tx_status |
up to 100 transactions’ confirmations | never |
epoch_params |
the newest epoch’s parameters | a block |
totals |
the newest epoch’s supply | a block |
account_addresses |
up to 20 stake keys’ addresses, empty ones too | never |
account_info |
one stake key’s standing | never |
account_reward_history |
one stake key’s rewards, oldest first, 1,000 a page: the wallet’s Staking screen, Rewards history, read only when it’s opened | never |
account_update_history |
one stake key’s certificates (registered, staked, vote delegated, stopped), oldest first, 1,000 a page: the Staking screen’s Delegation history, read only when it’s opened | never |
account_txs |
one stake key’s transactions: a page of 20, at most 10,000 in, or up to 1,000 from a block on; for a key with at most 200,000 outputs. The wallet’s restore scan | never |
credential_txs |
up to 75 payment credentials’ transactions, whatever their addresses’ staking part, paged as account_txs is; for at most 200,000 outputs in all. The wallet’s Activity screen for the public account, by its payment keys |
never |
tx_info |
up to 20 transactions, in Activity’s shape or inputs alone | never |
pool_list |
the registered pools, 1,000 a page | an hour, within its epoch |
pool_info |
up to 5 pools’ details and live stake | 10 minutes, within its epoch |
pool_history |
one pool’s last 18 epochs whose rewards are final: active stake, blocks, and what it paid its stake. A pool’s Return on stake | every pool’s epoch, worked out once and kept for the server’s life |
drep_info |
up to 5 DReps’ standing | 10 minutes, within its epoch; the account’s own (deposit,meta_url,meta_hash selected) never |
drep_metadata |
up to 5 DReps’ profile names | 10 minutes; the account’s own profile (is_valid selected) never |
proposal_list |
the live governance actions | 5 minutes, within its epoch |
vote_list |
one DRep’s votes on up to 40 actions | never |
asset_nft_address |
the address holding one NFT (an ADA Handle) | never |
asset_info |
one token’s CIP-25 and CIP-68 metadata | never |
What one request may cost is bounded. Any credential, address or stake key may be asked about, and some on mainnet hold hundreds of thousands of outputs. So a listing gathers at most 20,000 unspent outputs, and account_txs and credential_txs at most 200,000 outputs, with a page starting at most 10,000 transactions in. Past any of these, the answer is a 503, {"error":"too large for this server"}, with no Retry-After: it would be as large again, so the wallet reads Koios, for that request alone. They’re set far above what one wallet’s own accounts hold. Requests are also held to the wallet’s own sizes (one account’s standing, 20 keys probed).
Answers kept for a time are kept within their epoch, since a pool’s status, a DRep’s activity and the live actions turn at an epoch’s start. Not-found answers aren’t kept: anyone can ask about made-up IDs. When the store is full, the answer due to expire soonest makes room. A request waits at most 5 s for a shared answer, its queue included, then gets a 503.
An ID has one spelling: the lowercase bech32 the wallet sends. The server re-encodes what it decodes and takes the ID only if the two match: the decoder alone would also take a Bech32m checksum and stray padding bits, which would let one pool be asked for, cached and worked out under several names.
Only the wallet’s requests. Each route takes exactly the query string and body the wallet’s koios.ts sends: its parameters, in its order, at its sizes. Anything else is a 400, {"error":"not a request Seedelf Wallet makes"}, before any query runs, so no caller can compose an expensive one. A POST’s body is application/json. api/tests/public_grammar.rs holds a request each route takes, and ones it refuses. For example:
api=https://mainnet.seedelf.logicalmechanism.io
curl -s "$api/api/v1/tip"
curl -s "$api/api/v1/epoch_params?limit=1"
# one stake key's standing
curl -s -X POST -H 'content-type: application/json' \
-d '{"_stake_addresses":["stake1u9c0yhlklkdd7vcwkvv2cjrgnw48y82jmm2ulk3vxe2qupsv2va8g"]}' \
"$api/api/v1/account_info"
# the Seedelf contract's first 1,000 UTxOs
curl -s -X POST -H 'content-type: application/json' \
-d '{"_payment_credentials":["94bca9c099e84ffd90d150316bb44c31a78702239076a0a80ea4a469"],"_extended":true}' \
"$api/api/v1/credential_utxos?order=tx_hash.asc,tx_index.asc&limit=1000"
# a pool's last 18 epochs
curl -s "$api/api/v1/pool_history?_pool_bech32=pool1gaztx97t53k47fr7282d70tje8323vvzx8pshgts30t9krw62tm&select=epoch_no,active_stake,block_cnt,deleg_rewards&order=epoch_no.desc&limit=18"
Answers use Koios’s names and types for every field the wallet reads. Fields it never reads are left out:
value is null). The wallet drops both and reads registers from the bytes, and anyone can nest a datum thousands of levels deep;tx_info: collateral, reference inputs, mints, scripts and proposals, and every certificate but the seven an account’s own transactions make.The SQL is written after Koios’s grest functions (koios-artifacts, CC-BY-4.0): an account’s standing, a pool’s state and live stake, a DRep’s activity and delegators, a token’s minting metadata. The live tests hold some answers to Koios’s recorded ones: a token’s metadata, a delegation history, a pool’s history (api/tests/live_public.rs). CIP-129 DRep, committee and governance action IDs are made in Rust (api/src/ids.rs).
What stands in for Koios’s caches:
pool_delegators_list counts them. Each account’s reward sums change only at an epoch’s start, so they’re kept in memory for the epoch.
pool_stat table) while they’re finished in the background and kept.The public routes have their own connections: 6, beside the private index’s 2 and the tip’s own 1, so a burst of them never holds the private index up.
The histories are read oldest first, sorted in SQL by the order the wallet asks for, so the pages stay still while db-sync adds rows; the wallet shows them newest first.
account_reward_history is Koios’s: every reward paid to the key, by a pool or not. The next epoch’s rewards are listed before they’re paid, as Koios’s are.account_update_history is Koios’s, less withdrawals: a stake key’s registration, deregistration, delegation_pool and delegation_drep rows, each with its transaction’s hash and its block’s epoch, slot and time. The request filters out Koios’s fifth kind (action_type=neq.withdrawal): the wallet withdraws rewards with nearly every payment, and its Activity screen has them. A transaction’s certificates of one kind for the key are one row, as in Koios’s.pool_history follows Koios’s pool history function (grest.get_pool_history_data_bulk), with every pool’s epoch worked out at once and kept. Each row is an epoch’s active stake, the blocks made by slot leader, and deleg_rewards: the members’ rewards earned in it and the leader’s, less the pool’s fees by the terms active then, rounded half to even. The 18 epochs are those whose rewards are final: the 18 ending two epochs ago.
deleg_rewards. A pool that made blocks and was paid nothing (a pledge not met) paid "0", where Koios says null. Koios lists a pool’s newest 18 epochs with stake, however old; this lists those of the 18 newest it had stake in.| Route | Upstream | The server’s own checks |
|---|---|---|
POST /api/v1/submittx |
cardano-submit-api, POST /api/submit/tx |
the body is application/cbor (415 if not) and at most 16 KiB, the ledger’s max_tx_size (413 if more); at most 4 in flight (503 past it) |
POST /api/v1/ogmios |
Ogmios, POST / |
application/json (415 if not: a text/plain POST needs no CORS preflight, so a web page could send one); a JSON-RPC 2.0 evaluateTransaction and no other method (400); at most 64 KiB; at most 2 in flight |
Retry-After: nothing reached the node, so the wallet sends through Koios at once.The requests, as api/tests/live_submit.rs sends them: a submit is the transaction’s raw bytes; an evaluation, its CBOR in hex.
curl -s -X POST -H 'content-type: application/cbor' --data-binary @tx.cbor \
https://mainnet.seedelf.logicalmechanism.io/api/v1/submittx
curl -s -X POST -H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","method":"evaluateTransaction","params":{"transaction":{"cbor":"<tx hex>"}}}' \
https://mainnet.seedelf.logicalmechanism.io/api/v1/ogmios
/health is read every 2 s, and both paths answer 503 behind with Retry-After while the node’s tip is more than 3 minutes old, while Ogmios can’t reach the node, or once /health has failed two reads in a row. The wallet then goes to Koios at once. Without an Ogmios configured, the node’s sync is unknown, and the submit part answers 503.Seedelf Messaging’s relay, in api/src/messaging/ (web wallet chunk 54’s 54c). The protocol is protocol.md: §10 says what the relay is for, and §17 every byte of what it takes and gives.
mainnet and preprod, each with its own prices, cap and traffic. They were made two when one key, the Seedelf key, read Messages on both networks; since chunk 55 Messages has a key for each. Preprod’s is for testing: a lower price and a smaller cap.| Route | Takes | Answers |
|---|---|---|
POST /messaging/v1/{pool}/envelopes |
nonce (8, big-endian) ‖ envelope, as application/octet-stream, at most 32,776 bytes |
200 {"kept": "new" \| "already", "expires": <Unix time>} |
GET /messaging/v1/{pool}/envelopes?after=<cursor> |
the cursor from the last page; none for the first | a page, as application/octet-stream: below |
POST /messaging/v1/{pool}/certificates |
nonce (8, big-endian) ‖ certificate, as application/octet-stream, at most 312 bytes |
200 {"kept": "new" \| "already"} |
GET /messaging/v1/{pool}/certificates?after=<cursor> |
the cursor from the last page; none for the first | a page of the list, as application/octet-stream: below |
POST /messaging/v1/{pool}/withdrawals |
nonce (8, big-endian) ‖ withdrawal, as application/octet-stream, exactly 106 bytes |
200 {"withdrawn": true} |
A post is checked, cheapest first:
already, whatever its stamp: a wallet re-posts the same bytes after a restart. Its expires is the copy’s, rounded down to 10 minutes; a new post’s is exact, the relay’s now and 36 hours.Retry-After: too many posts from this address for now when its own posts took the price there, too many posts to this pool for now when everyone’s did. Then the proof of work over the envelope’s bytes and the pool’s name (§17): too little is a 402 with the price in bits. The 429 comes first, so a post with nonce 0 learns how long to wait without solving.Retry-After, until the oldest expire, rounded up to 10 minutes and at most an hour. Before the points, so a post to a full pool costs no point check, however often it comes; looked at again as the post is kept.p (bytes 1 to 48) and c (bytes 81 to 128) each a valid point of G1, so a reader never meets garbage. Else 400, counted against the address’s own price (below), so one solved stamp pays for only so many point checks. Checked last, since it’s the costly check. The 32 bytes between them (49 to 80) are a tag, which isn’t checked: only the envelope’s reader can tell it from any other 32 bytes.The price is a number of bits: 2^bits SHA-256 attempts on average, about 425 ns each in a browser’s WebAssembly. Mainnet’s base is 18 bits (about 0.1 s), and its ceiling 24 (about 7 s). What’s counted is units, an address’s and everyone’s, halving every 10 minutes (api/src/messaging/price.rs): 1 for an envelope of 512 or 2,048 bytes, so a short message padded to 2 KiB costs what a short one does, 16 for 8,192 bytes and 64 for 32,768. A bit more for every 32 of the address’s recent units, this post’s included, and a bit more for every doubling of everyone’s past 1,000. A kept post counts in both; one refused at its points in its address’s alone, so nobody raises the price everyone pays with posts that are never kept. An IPv6 address is counted by its /56, so the /64s of one allocation are one address (the edge’s buckets take a /64). The counts live in memory, an address’s while it’s above a hundredth of a unit, and nothing logs them.
The window (api/src/messaging/window.rs): what one address may have in a pool over its 36 hours, whatever work it does, since every reader downloads and scans every envelope. At most 1,000 envelopes and 4,096 units of 512 bytes (2 MiB), whatever the price counts, on both pools (POOLS in api/src/messaging/mod.rs, the owner’s to tune). The relay counts each address’s kept posts in hourly buckets, envelopes and units, and drops a bucket 36 hours after its hour ends, when all it counted has expired. Past either limit, a 429 whose Retry-After is when enough of the oldest buckets age out: at most 37 hours. Checked again as the post is kept, so posts at once can’t pass it together. The buckets are counts, never which envelopes; in memory only, never in the pool’s file, so a restart starts them empty. At most 200,000 addresses each, the prices’ and the window’s; past it, a new address’s post is a 503 busy.
A page holds whole envelopes, at most 256 KiB of them (always at least one), in the order they came:
version (1) = 1 | flags (1) | cursor (8) | prices (4) | count (2) | count × (length (4) | envelope)
A day’s reading (api/src/messaging/reading.rs): a page costs no work, so what one address is sent of a pool is bounded instead, over the last 24 hours in hourly buckets: at most 256 MiB, or 8 times the pool’s cap where that’s more, so 512 MiB of mainnet’s and 256 MiB of preprod’s. An honest reader downloads each envelope once; the rest is room for the wallets behind one address, and a fresh sync or two each. Keyed as posts are, an IPv4 address whole and an IPv6 address by its /56. A page counts as it’s made, whether or not its reader downloads it. The page that passes the budget is sent; after it, a page is a 429 whose Retry-After is when enough of the address’s oldest hours have aged out, at most 25 hours. Posts are counted apart, and go on. A page of the list counts in the same day as the pool’s pages. The counts are bytes an hour, never which pages or cursors, in memory only, so a restart starts every reader’s day again. At most 200,000 addresses; past it, the one seen least recently goes and its day starts again, so no reader is refused for the table’s sake.
The reserve (Reserve in api/src/edge.rs): once nine tenths of today’s share of DATA_MESSAGING_GB_MONTH is spent, a page is at most 16 KiB, its framing included: as many whole envelopes as fit, with the flag that says another page follows now. An envelope longer than that by itself, one of 32 KiB, is a page alone, so no reader stops at it. Posts go on, and so do pages, until the share is gone. A fresh sync then takes 16 pages where it took one, while a conversation under way, whose wallet reads a few envelopes a page, reads as before. A page of the list is cut the same way, to whole entries, and counts against the same share. Each address reads at most 16 MiB of the reserve in a day, both pools together (about three days of a busy pool’s envelopes), counted as the day’s reading is: past it, its pages are the day’s reading’s 429, this address has read its share of the pool for the day, whose Retry-After is when enough of its oldest hours of the reserve age out, or a minute past midnight UTC, when the next day’s share begins and the reserve lifts, whichever is first. The wallet holds that pool’s pages until then, as for its day’s reading; a 503 would read as the relay out of reach, asked again at every sync. So one address can’t spend what’s kept for conversations, though many can: about 190 IPv4 addresses spend a 3.2 GB reserve, and about 40 to 45 the nine tenths before it, by asking alone. Without a ceiling of its own there’s no day’s share, and no reserve.
| Setting | What it does |
|---|---|
DATA_MESSAGING_READ_MIB_DAY |
the least one address may read of a pool in a day, in MiB, from 1 to 1,048,576: 256 unset |
DATA_MESSAGING_READ_POOLS_DAY |
and at least this many times the pool’s cap, from 0 to 1,000: 8 unset |
DATA_MESSAGING_RESERVE_PERCENT |
the part of each day’s share kept for posts and short pages, from 0 (none) to 100: 10 unset |
DATA_MESSAGING_RESERVE_PAGE_KIB |
the longest page the reserve sends, in KiB, from 1 to 512: 16 unset |
DATA_MESSAGING_RESERVE_READ_MIB_DAY |
what one address may read of the reserve in a day, both pools together, in MiB, from 1 to 1,024: 16 unset |
DATA_MESSAGING_OFF |
true stops Seedelf Messaging, as the off switch below says; false, or unset, runs it; a pool’s name, preprod or mainnet, stops that pool alone, and preprod,mainnet (either order, whitespace trimmed, each once) is true |
A value that isn’t a whole number in its range, or true, false or a list of pools for the switch, is refused at start. All six are the owner’s to set, DATA_MESSAGING_OFF only through the runbook’s drop-in, never in the environment file, whose value would override it (Stopping Messages); the start’s log line says what the relay runs with.
The off switch. With DATA_MESSAGING_OFF=true, every route under /messaging/ answers 410 Gone, {"error":"messaging is stopped"}, with CORS, before any other limit. A post’s body isn’t read, so nothing is kept. Every other route answers as before, and /health says "relay":"off". By network: DATA_MESSAGING_OFF=preprod (or mainnet) stops that pool alone. Its routes, /messaging/v1/preprod/… (the envelopes, the list and withdrawals), answer the same 410, and the other pool’s answer as ever. A path that names no pool is the routes’ to answer, as with none stopped. A path under /messaging/ spelled with a percent-encoding is a 400 encoded paths aren't taken here, with CORS, before the switch is looked at, since the routes decode a pool’s name (the wallet never sends one); and each route checks the switch by the name as it decodes it too. /health says "relay":"partly", and each pool’s "stopped" says which. Preprod’s test ADA is free, so the price that bounds a flood on mainnet bounds none there: this lets preprod stop while mainnet goes on, or the reverse. The runbook’s Actions flip it one network at a time. The pools are still read at start and saved, and what they hold expires as ever. A wallet reads a 410 on a network’s relay routes as Messages stopped on that network, and shows that network’s Messages as paused: it solves and posts nothing there, keeps what’s queued, and asks one page an hour, and one at each unlock, until a page gets an answer other than the 410. So a stopped relay still sees those pages, and now and then a post a wallet made as it unlocked. The lever and its undo are the runbook’s Stopping Messages.
The pools are saved to the state directory (messaging-<pool>.pool) every minute and at shutdown, and read at start, so a deploy keeps what’s waiting. A pool that hasn’t kept anything yet is written too. A shutdown leaves a mark beside each file (messaging-<pool>.clean) saying it holds everything; without the mark, a pool read at start tells every earlier cursor of a gap, since what came after the last save is gone, and numbers what comes next far above that save’s numbers, should the clock have gone back. Where its numbering then stands is saved at once, at the first minute’s save, so a second crash numbers above it again. A pool whose file is there but can’t be read, or isn’t one this build reads, starts empty and leaves the file as it was, and gets no clean mark until a save of it succeeds: so the next start that reads the file tells every earlier cursor of a gap, rather than silently skipping what it held. A save writes to messaging-<pool>.partial (its mark to messaging-<pool>.clean.partial), syncs it, renames it into place and syncs the folder, so a power loss keeps the rename too, and leaves nothing behind when that fails; a start removes what one left. A folder that can’t be synced is a save that failed. Each pool’s list is saved the same way, in files of its own: messaging-<pool>.list, its mark messaging-<pool>.list.clean, and their partials .list.partial and .list.clean.partial. A list read at start has each certificate’s shape read again, to index it, but not its proof: the file is the relay’s own, and some 200,000 proofs would hold a start for minutes.
Times are the server’s clock. An envelope kept while the clock ran ahead counts its time as now at the next look after the clock is right, so it’s kept 36 hours from then and holds back nothing that came after it; a pool read from its file drops each envelope whose own 36 hours are over, wherever it is. A clock that’s behind at a start shortens what’s kept by as much: the waiting envelopes’ times count as that start’s now, so once the clock is put right each is that much older. A clock set back while the API runs, then put right, shortens the same way what came in the step’s length before it. So the API starts after time sync (the runbook’s block).
The checks are a copy of seedelf-messaging’s relay module, which the data layer can’t depend on. Both are held to seedelf-platform/seedelf-messaging/tests/vectors/messaging_relay_v1.json, which the crate writes: every envelope it holds, kept or refused and why, and stamps with their work. So are a certificate’s and a withdrawal’s (api/src/messaging/certificate.rs), of the crate’s session::certificate, held to messaging_certificate_v1.json: every good certificate and withdrawal in it checks and gives its h_S and digests, and every refusal is refused with its kind. A datum register is read as Lovejoin’s box is (api/src/lovejoin/datum.rs), held to the wallet’s register-spellings.json. The Seedelf policy they take is the data layer’s copy of variant 1’s (api/src/constants.rs), held to seedelf-core’s. Its G1 library, blst, is built portable, so one binary runs on any x86-64 server: it picks the ADX code at start where the CPU has it, and the plain code where it doesn’t.
A load test, on two cores, the droplet’s size: RELAY_LOAD=1 taskset -c 0,1 cargo test --release --locked --test messaging_load -- --nocapture. It runs the server in the test as main.rs serves it, on a local port, with no source. On an Intel Core i5-12400F, with the test’s clients on the same two cores: about 13,000 posts a second (p50 about 4.5 ms, p99 16 to 21 ms, 64 at once), and fresh syncs of a 3,000-envelope pool at about 600 MB/s. Before the listener’s 32 KiB send buffers and the edge’s pacing (the 1.10.0 gate), it was 2.0 GB/s, and posts as many. Traffic, not the relay, is the droplet’s limit: every reader downloads every envelope. It posts certificates, each one’s proof checked and each Seedelf looked up in a Koios on loopback at most 4 at once, as on preprod, and reads the list whole too: those figures are still to measure.
api/src/messaging/list.rs, protocol.md §21.7. A certificate binds a Seedelf’s messaging register M_S = (h_S, m_S) to its datum’s register (g_S, u_S), with one proof of both keys (§21.4). Writers read the list to find whom to write to. A post, nonce (8, big-endian) ‖ certificate, is checked cheapest first, and the first that fails answers:
the body is larger than this route takes, unread, before the route.{"kept":"already","digest":"<hex>"}, whatever its stamp or its proof, so a wallet’s own repost, or one with a fresh aux, isn’t asked to pay. digest is the listing digest of the certificate the list holds, which may be another posting’s bytes: a withdrawal must name it.
withdrawn, whoever posts those bytes again (below).this Seedelf was withdrawn too often at this register: move it to list it again. Listed ones count, since each could be withdrawn: at 127 withdrawn one more is listed and a second isn’t, so its withdrawn never pass 128. So a loop of posting and withdrawing, each time with a fresh aux, can’t fill the list; moving the Seedelf, a new register, starts it fresh.SHA-256("Seedelf-Messaging|v1|listing-stamp|" ‖ len(pool) ‖ pool ‖ certificate), which is also what a removal names it by: too little is a 402 with the price.two certificates for this Seedelf already; and the list under its cap, 64 MiB of entries on mainnet and 8 MiB on preprod, else a 503 the list is full, Retry-After an hour. A certificate held is never pushed out for another: a full list refuses. Before the proof, so a post that can’t be listed costs no proof check.api/src/messaging/view.rs, chunk 55’s call 6): (g_S, u_S) is the datum register of the one contract UTxO that holds the Seedelf’s token now, under an inline datum read as a register is everywhere in the workspace. Else 409 not this Seedelf's register now. When the relay can’t read the chain, a 503 can't check the chain now, Retry-After 60, or on preprod however long Koios’s day’s budget, the address’s share of it or its back-off has to run (Where the chain is read, below): a certificate is never listed unchecked. On preprod an ask that would take the address past its window is check 4’s 429, Koios not asked. Last, since it reads another part of the API or another server.Every post that reaches check 7 is counted against its address’s price, whatever comes of it: a bad proof, a 409 or a 503 from the chain, a request whose client hangs up while the chain is read (a guard counts it as it’s dropped), or a kept certificate. So one solved stamp can’t be posted again and again for proofs and reads of the chain. On preprod a post that asks Koios is counted in its address’s window as it asks, as a listed certificate is, whatever comes of it (a 409, a 503, a hang-up), and not again once listed; one whose answer is kept from the last minute asks nothing, and counts there only if it’s listed.
Listed, 200 {"kept":"new","digest":"<hex>"}, its own listing digest. Posts at once are checked again as they’re listed, so they can’t pass the window, a name’s two, the cap or a withdrawal together.
Where the chain is read:
/seedelf/v1/mainnet/names, every Seedelf unspent at the contract at a source’s tip with its row) is made once a tip and kept with it. The relay reads every register from it, once a tip, into memory, so a post reads no database of its own. While the index can’t answer (db-sync and Kupo both down or behind), posts are 503s. Every 2 minutes a sweep drops each listed certificate whose Seedelf has moved or gone, a removal entry taking its place, all in one pass over the list, and forgets a withdrawn digest once its Seedelf has been found elsewhere three sweeps in a row, each on a new tip (the chain check refuses those bytes then): one view that passes, a rollback, a source behind or one stuck on a tip, forgets nothing. A sweep that can’t read the index drops nothing, and neither does one that reads no Seedelf at all, which on mainnet is a broken read.PREPROD_KOIOS_URL) as seedelf-koios’s nft_utxo does: POST asset_utxos {"_asset_list": [[<Seedelf policy>, <name hex>]], "_extended": true}, and reads the one unspent row’s payment_cred and inline_datum.bytes (more than one row is none). Within 5 s, its wait for a place included, never retried, over TLS alone with no redirect followed, at most 4 at once, and each answer kept a minute, so a Seedelf’s second certificate or a repeated post asks once; a failure isn’t kept, and the minute’s tidy drops every answer past its minute, so no name is held longer. A Seedelf minted or moved within that minute is seen when it’s over. A slow re-check (Relay::recheck_step): each Seedelf the list knows, listed or withdrawn, is asked about again at most once a day, one every 2 s, through the same client, places and answers. One found elsewhere is asked again at least 10 minutes on, and only an answer then that finds it elsewhere too drops its certificates, removal entries taking their place, and counts toward its withdrawn digests, which go once it’s been found elsewhere three times in a row, as on mainnet; one back by then is kept. A round walks the Seedelfs by key, its place and the time it began saved with the list (messaging-<pool>.list), so a restart goes on from where it was; the next begins once it’s over and a day after it began. An ask that fails is made again at the next step, and a second failure passes that Seedelf for the next round.
KOIOS_BUDGET): at most 4,000 requests a Unix day, under the public tier’s 5,000 for one address, of which the re-check never takes the last 1,000, kept for posts’ asks, and one address’s posts (an IPv4 address, an IPv6 /56, as the window counts them) at most 100. So neither the re-check nor one address keeps another’s post from its check, and a round of more than 3,000 Seedelfs takes as many days as it needs; many addresses together can still spend the day. A post past the whole day’s, or past its address’s 100, is a 503 whose Retry-After is the day’s end. The day’s count is saved with the list, so a restart within the day doesn’t give it again (after a crash, at most the minute since the last save’s is); each address’s count is in memory alone, gone with the day or a restart.Retry-After (at most a day), or an hour if it names none; so does a run of 5 failures in a row, counting only requests that went (a wait for one of the 4 places isn’t Koios failing). Meanwhile a post is a 503 whose Retry-After says how long, and the re-check asks nothing.What Koios learns: that the relay, from its own address, asked about that one Seedelf name, and when; never who posted, nor the certificate. Koios could match the relay’s ask to that wallet’s own reads of Koios by their times (on preprod the wallet reads Koios alone). The re-check asks again about names Koios was asked about at their posts.
A writer checks every certificate against its own read of the contract (§21.5): the relay’s checks keep garbage and crowds out of the list, and are never what a writer trusts.
A page of the list holds whole entries, at most 64 KiB of them, their framing aside (always at least one), in the order the list took them:
version (1) = 1 | flags (1) | cursor (8) | price (1) | count (2) | count × (kind (1) | length (2) | entry)
next where its first bytes still give one, as after a crash, and in any case some 51 days of microseconds above the clock, since those bytes may be broken too: every cursor from before is a gap, and stays one through a clean restart later.The cap counts the entries’ bytes, certificates’ and removals’, and for the withdrawn digests it keeps, 8 bytes each and their Seedelf’s name and register once (1 + its length + 96). The indexes beside them, by name and register and by listing digest, add about as much again: 647 bytes of heap for a 273-byte certificate, measured, so mainnet’s 64 MiB list would hold about 150 MiB. /health gives each pool’s certificates, withdrawn and chain.
A wallet turning Messages or a Seedelf off withdraws each of its own certificates the list holds (chunk 55’s call 9). A withdrawal is version (1) = 1 ‖ network (1) ‖ digest (32) ‖ c (32) ‖ z (32), 98 bytes: the withdrawn certificate’s listing digest, and a proof of its messaging key x_m on that certificate’s own messaging register (h_S, m_S), never the Seedelf key. A post, nonce (8, big-endian) ‖ withdrawal, is checked cheapest first:
no such certificate, which tells a poster only what the list shows. One a withdrawal took that no save holds yet is checked as the first post was, against the certificate taken, and answered as that save says (below), never 404.SHA-256("Seedelf-Messaging|v1|unlisting-stamp|" ‖ len(pool) ‖ pool ‖ withdrawal): too little is a 402 with the price.Seedelf-Messaging|v1|withdrawal ‖ version ‖ network ‖ digest ‖ h_S ‖ m_S ‖ T) mod q. Else 400. Every post that reaches it is counted against the address’s own price, whatever comes after, a dropped request’s too.Taken, 200 {"withdrawn": true}: the certificate goes, a removal entry naming it is the list’s next, its Seedelf has room for another, and the post counts as a kept short envelope. The list is saved before the answer, its folder synced too, so neither a crash nor a power loss after it can bring the certificate back. A save that fails puts the certificate back in memory, listed again after its removal (so a reader who read the removal reads it again) and its digest not kept, and the answer is 503 can't save now, Retry-After 60: a 200 is only given for a withdrawal the file holds. The save settles it itself, so a post whose client hung up meanwhile (the wallet’s own timeout) still has its certificate put back; and a post of the same withdrawal while the save runs, a retry or another browser’s, waits for it and is answered as it says, 200 or that 503, never the 404 the wallet takes for done. A withdrawal lasts: the digest is kept, as its first 8 bytes with its name and register, saved with the list and 8 bytes in the cap’s count, and a post of those same bytes is refused at check 3′, so whoever kept them while they were listed can’t list the Seedelf again. An owner who turns Messages on again posts a new certificate, with a fresh aux, so another digest: at most 128 times at one register (check 3’s withdrawn too often). The digest goes once the relay’s view of the chain has found its Seedelf elsewhere three times in a row, each on a view that changed since the last. The checks are a copy of the crate’s Withdrawal, held to messaging_certificate_v1.json’s withdrawals and their refusals.
{
"ref": "<tx hash>#<index>",
"address": "addr1…",
"lovelace": "1749860",
"assets": [["<policy>", "<name>", "1", 0]],
"datum": "d8799f5830…",
"script": true,
"created": { "slot": 144889937, "time": 1736456228 },
"spent": { "slot": 199943000, "time": 1791509291, "by": "<tx hash>" },
"made_by": { "mixed": true, "inputs": [["<payment cred>", "<stake cred or null>"]] }
}
assets, datum, script, spent and made_by (Lovejoin only).made_by.mixed says whether the box’s transaction spent from its own pool’s mix box: the classic pool’s on its routes, each token pool’s own on lovejoin/tokens.[policy, name, quantity, decimals]: hex, hex, a decimal string, and the token registry’s decimals, 0 for a token it doesn’t list, as Koios gives them in an asset_list. The wallet shows a token its own list lacks by these, without asking about the token. Both sources fill them from the same file, so their rows stay the same.datum is the inline datum’s raw CBOR. The wallet’s own parser decides what it means.script is true when the output carries a reference script.made_by.inputs is null when Kupo answered.drep_info reads every account’s latest vote delegation, then keeps the answer.account_txs or credential_txs joins every newer transaction too, so the deeper it starts, the more it costs. That’s why none starts more than 10,000 in.drep_info comes back far faster than one worked out, so a prober could tell someone asked about that DRep in the last 10 minutes. The same holds for every kept answer, and it’s accepted: sharing answers is what keeps the load on the services behind the API flat.For support and bugs, open a GitHub issue or a support ticket in the Seedelf Discord. Security vulnerabilities go by email only: see SECURITY.md.
.github/workflows/data-layer-deploy.yml alone.