How it works
Users pay nothing in 0.5. Sponsored placements pay workers, and wallets are used for ads and tips. The escrow/session wording below describes 0.2; see Ads, wallets and languages.
A session has four steps: discovery, connection, inference and settlement. No step is operated by GenKaKu Labs.
1. Discovery
A worker registers in the program with one account per wallet (["worker", wallet]), holding:
- the peer ID, stored as its multihash bytes — the same ed25519 key as the wallet,
- the rate: micro-USDC per started minute. This is the worker's most expensive model, because one account has to serve a catalogue,
- an optional locator: the multiaddrs a client can dial,
- an active flag and two counters,
earnedandsettlements.
A client reads the whole directory with one getProgramAccounts call filtered
by the account discriminator. There is no directory API to trust and no log to
replay: the account state is the listing.
Locators are optional. A worker publishes its address only when the operator
turns publishAddress on, and publishing is permanent once it is on chain.
The rate written on chain is a ceiling. A worker sells several models at different prices but has one rate field, so it lists its highest one, and every session has to be priced at or below it. The worker's own sidecar refuses a session that undercuts the model's quote before it generates a token.
Private workers
A worker can leave the market without leaving the program. In private mode it
- stops announcing to the seed (its answer set is public, so a listing there would publish exactly the peer id the mode exists to hide),
- keeps its chain row active but with an empty locator, because
open_sessionrefuses an inactive worker and settlement still pays that account, - answers only wallets on its allowlist. The check runs on the
transport-authenticated
connection.remotePeer, converted to a wallet, so an allowlisted user needs no token and a stolen pairing code is useless from another machine.
The allowlist is filled by one-time pairing codes: the worker mints one, the user redeems it once, and the code is then spent. A retry from the same wallet is idempotent; a retry from a different wallet is refused. Unpairing removes a wallet immediately.
Discovery is unchanged for everyone else: the client's list is the public directory plus the seed, and a private worker only enters it through a pairing the user completed.
What the client shows
The user plugin keeps its own view of the board, local to the profile:
- search across model, worker display name and wallet,
- sort by recommended, price, measured latency, sessions served, model name or worker name,
- a tick list of
(worker, model)keys, capped at ten, which is exactly what the chat model picker offers. A tick is per worker, so the same model from two workers is two rows — the picker therefore labels themworker · model.
The first time a profile opens the panel, the ten best rows by the chosen sort are ticked for it, so the plugin works before anyone configures it. After that the list is whatever the user ticked, including empty.
2. Connection
A user plugin opens a libp2p connection to the worker's peer ID. The hello
exchange (/genkaku/hello/0) pins:
- the peer ID, which must encode the wallet it claims (checked, not assumed),
- a signature over a fresh nonce, proving the process holds that key,
- the hourly quote and billing mode.
If the two peers can reach each other directly — same LAN, a public IPv4, a global IPv6 — tokens travel straight between them. If they cannot, the session runs through the public seed relay.
The relay forwards encrypted libp2p traffic. It cannot read prompts or output, but its operator can see connection metadata: peer addresses, timing and volume. Treat a relayed session as private in content, not in who is talking to whom.
There is no NAT hole punching (no DCUtR) in this build. Either the peers are directly dialable or the relay carries the session.
3. Inference
The worker runs the model locally with Ollama and streams tokens back over the same connection. The marketplace never sees the prompt; the worker operator does.
A zero-price offer skips the chain entirely and is served for free.
4. Sponsored minutes
In 0.5 the user pays nothing. The money comes from the advertiser:
- The advertiser funds a campaign on Solana.
accruecan never promise more than the campaign holds. - When an answer shows a sponsored card, the ads service books one sponsored minute to the worker that served it.
- Every day the attestor writes those minutes on chain as accruals, one row per campaign and worker.
- The worker claims its accrual from the panel. The transaction is signed by the worker, the fee is paid by the worker, and the USDC goes straight into its wallet. No approval from GenKaKu exists or is needed.
- A worker can see its ads in Ad earnings; an owner can see the campaign budget and remaining amount in the advertiser panel.
The program's guarantees are arithmetic: accrue refuses an amount the campaign
cannot cover, and close_campaign can only return funded - accrued, after the
campaign has been paused for a day and the pause day has been settled. A minute
that has been promised cannot be taken back.
What replaces the orchestrator
| Old model | GenKaKu |
|---|---|
| Server assigns jobs | User picks a worker from the program's accounts |
| Server stores prompts | Direct peer connection |
| Server meters usage | Started-minute accrual, signed receipts |
| Server pays out | Escrow released on-chain |
The trust assumptions are smaller because there is less in the middle. They are not zero: you still trust the worker with the prompt, the relay with metadata if your session is relayed, and the code you run.