Nostr publication
Every orangecheck sibling publishes its public artifacts as NIP-78 (opens in a new tab) parameterized-replaceable addressable events. The original kind, 30078, is the namesake of this page and still carries Attest attestations, Lock device records, and Pledge envelopes. As more siblings shipped, the family expanded into the 30078–30115 range with one kind per artifact type. This page is the public roll-up.
This page is the family kind registry. Each protocol's own spec is the source of truth for the kinds it claims; the table below rolls them up.
Kind registryLink to this section
| Kind | Owner | Purpose |
|---|---|---|
30078 | OC Attest | Attestation envelope (the original family event kind) |
30078 | OC Lock | Device record (binds an X25519 device key to a Bitcoin address) |
30078 | OC Pledge | Pledge envelope, outcome envelope, abandonment envelope (disambiguated by d tag) |
30078 | OC Chat | Session device record of a did: identity (oc-, OC Chat SPEC §8.6) |
30079 | — | Archived; do not use |
30080 | OC Vote | Poll |
30081 | OC Vote | Ballot |
30082 | OC Vote | Reveal (secret-mode tally) |
30083 | OC Stamp | Stamp envelope |
30083 | OC Agent | Agent delegation (co-claim with OC Stamp; disambiguated by disjoint d-tag prefixes) |
30084 | OC Agent | Agent action (claimed exclusively; reuses OC Stamp envelope structure but on a distinct kind) |
30085 | OC Agent | Agent revocation |
30086 | OC Agent | Agent sub-delegation (v1.1) — chained narrowing of authority |
30087 | OC Me | me.ochk.io billable-event, payment, rebind, trust, payout-binding, distribution, distribution-void and drop envelopes |
30088–30093 | — | Free |
30094–30109 | — | Reserved, unratified (OC Find, an unbuilt research idea) |
30110 | OC Chat | Channel descriptor |
30111 | OC Chat | Channel post |
30112 | OC Chat | Seal / block-height anchor |
30113 | OC Chat | Reserved (group-key rotation, private channels) |
30114 | OC Chat | Discoverability directory |
30115 | OC Chat | Reserved (pay- postage policy) |
OC Chat direct messages travel as NIP-59 gift wraps (kind 1059), a standard Nostr kind rather than a family allocation.
If you're allocating a new kind for a new sibling, claim the next free number
(currently 30088), claim it normatively in the owning spec, and add it to this
page. Kinds are never reused across sub-protocols.
Why NIP-78 / kind 30078Link to this section
NIP-78 is the "application-specific data" event kind, designed precisely for what we need:
- Addressable —
(pubkey, kind, d)uniquely identifies an event across all relays. Republishing with the samedtag replaces the old version. - No reserved format — the
contentfield is application-defined, and we fill it with the JSON envelope each protocol specifies. - First-class in every Nostr client — no custom relay patches required.
The 30080–30087 and 30110–30115 kinds claimed by Vote, Stamp, Agent, Me and Chat
are also in NIP-78's parameterized-replaceable range and behave identically; the
only reason they exist as separate kinds (rather than reusing 30078) is so a
relay query like {kinds: [30080]} returns only polls without the integrator
having to post-filter on the d tag.
d-tag conventionsLink to this section
Each protocol reserves a d-tag namespace so events from different siblings
don't collide on overlapping kinds.
| Protocol | Kind | d tag format |
|---|---|---|
| OC Attest | 30078 | <attestation_ (64-char hex SHA-256) |
| OC Lock | 30078 | oc- (all of its devices, told apart by pubkey) |
| OC Lock | 30078 | oc- (older form, still accepted) |
| OC Pledge | 30078 | oc- |
| OC Pledge | 30078 | oc- |
| OC Pledge | 30078 | oc- |
| OC Vote | 30080 | oc- |
| OC Vote | 30081 | oc- |
| OC Vote | 30082 | oc- |
| OC Stamp | 30083 | oc- |
| OC Agent | 30083 | oc- (co-claim with OC Stamp; disjoint prefix) |
| OC Agent | 30084 | oc- |
| OC Agent | 30085 | oc- |
| OC Agent | 30086 | oc- (v1.1) |
| OC Chat | 30078 | oc-, a did: session device (SPEC §8.6); a Bitcoin-address device uses OC Lock's record |
| OC Chat | 30110 | oc-, one per channel version |
| OC Chat | 30111 | oc- |
| OC Chat | 30112 | oc- (prefix only; the spec fixes no suffix yet) |
| OC Chat | 30114 | oc- for people, oc- for channels |
| OC Me | 30087 | oc- |
| OC Me | 30087 | oc-, oc-, oc-, oc-, oc-, oc-, oc-, each <commitment> |
A public relay doesn't enforce any of this — d is just a string. Tag filters
match exactly, so #d finds one artifact when you know its full d value;
there is no prefix query. The prefix is what tells you, after fetching, which
protocol an event on a shared kind belongs to. Check it, and the envelope's
kind field, before you use the event.
Required tags per protocolLink to this section
Each sibling's spec defines which tags MUST appear on its events. Relays index
single-letter tag names only, so the tags a query can use are d and t.
Longer tag names (address, agent, delegation) are for people reading the
event; a filter on one fails (see Reading events).
Common across all protocols:
| Tag | Value |
|---|---|
d | The addressable identifier (per table above) |
OC Attest example:
| Tag | Purpose |
|---|---|
t | The Bitcoin address, and oc- — the tags a query uses |
address | Bitcoin address the attestation is for (not indexed) |
scheme | bip322 or legacy |
i | One per identity binding, formatted as <protocol>: |
expires | ISO timestamp (optional) |
For the exact normative tag set per protocol, consult that protocol's spec:
- OC Attest tags ·
oc-attest-protocolSPEC §3 - OC Lock device record tags ·
oc-lock-protocolSPEC §3 - OC Stamp envelope tags ·
oc-stamp-protocolSPEC §7 - OC Vote tags ·
oc-vote-protocolSPEC §3 - OC Agent tags ·
oc-agent-protocolSPEC §9.4 and §10 - OC Pledge tags ·
oc-pledge-protocolSPEC §16
Author pubkey — real npub vs. ephemeralLink to this section
OrangeCheck events are authored by one of two key types:
- Real Nostr pubkey — when the user has a NIP-07 extension installed (nos2x, Alby, etc.), we sign with their actual key so they can find their own events in their Nostr client's history.
- Ephemeral key — when there's no NIP-07, the SDK generates a fresh BIP-340 Schnorr keypair per publish, signs the event, and throws the key away. The event is still valid (relays check only that the signature matches the pubkey); the pubkey is just a throwaway. OC Vote derives the ephemeral key deterministically via HKDF so the same poll re-publishes under the same npub.
In both cases, the artifact inside the event's content is cryptographically
bound to the Bitcoin address via BIP-322. Who authored the Nostr event is
independent from who controls the Bitcoin address. The inner artifact is what
matters.
Reading eventsLink to this section
Any Nostr client or relay library works. With nostr-tools (opens in a new tab):
import { Relay } from 'nostr-tools/relay';
const relay = await Relay.connect('wss://relay.damus.io');
// Every filter below uses `#t` or `#d`. Relays index single-letter tags only.
// Find an OC Attest attestation by Bitcoin address
const sub = relay.subscribe([{ kinds: [30078], '#t': ['bc1qalice…'] }], {
onevent(event) {
const envelope = JSON.parse(event.content);
// Verify locally — see /attest/verification
},
});
// Find an OC Vote poll by id
relay.subscribe([{ kinds: [30080], '#d': ['oc-vote:poll:<poll_id>'] }], {
/*…*/
});
// Find every OC Stamp by a specific signer. Kind 30083 also carries OC Agent
// delegations: keep events whose `d` starts with `oc-stamp:` and whose
// envelope `kind` is `stamp`.
relay.subscribe([{ kinds: [30083], '#t': ['bc1qsigner…'] }], {
/*…*/
});
// Find every OC Agent delegation naming an address, as principal or agent.
// Keep events whose envelope `kind` is `agent-delegation`, then check which
// side the address is on.
relay.subscribe([{ kinds: [30083], '#t': ['bc1qagent…'] }], {
/*…*/
});
// Find every revocation of a specific delegation (then keep only events whose
// content.delegation_id matches, since `t` also carries the signer's address)
relay.subscribe([{ kinds: [30085], '#t': ['<64-hex delegation id>'] }], {
/*…*/
});
// Find what cites a delegation: its actions (30084), revocations (30085) and
// sub-delegations (30086) all carry its id as `t`. On actions and
// sub-delegations that tag is SHOULD (spec 1.5.0), so this lists only events
// whose publisher set it. Route on the envelope `kind` and check the id.
relay.subscribe(
[{ kinds: [30084, 30085, 30086], '#t': ['<64-hex delegation id>'] }],
{
/*…*/
}
);
A filter on a multi-letter tag name does not quietly return nothing. Most relays
reject the whole request with CLOSED or NOTICE (unindexed tag filter),
taking any other filter in the same request with it, and some ignore the filter
and return unrelated events. So:
- Treat a rejection as "not heard back", never as "nothing there." A relay
has answered only when it answered in full: it sent
EOSEfor every page, the last page came back shorter than thelimityou asked for, and every event it returned matches your filter. ACLOSED, an errorNOTICE, a dropped connection or a timeout says nothing about what exists. - Decide absence only from a full answer. Relays answer newest first up to a
cap, so events dated after a revocation can push it out of an answer that
still ends in
EOSE. Page each relay withuntiluntil a page comes back short; a read that stopped at a full page, or part way, is cut off, and a cut-off read is not an answer (OC Lock §3.5 (opens in a new tab)). For revocations, "no revocation" needs at least the read floor of the relays asked (the number asked, less 2, plus 1, and never fewer than one) answered in full and no relay cut off. Otherwise the delegation is unchecked, never unrevoked. See OC Agent SPEC §10.4 (opens in a new tab). With two or more relays asked, the floor lets one go silent, so a revoking client should keep publishing until at least two of the relays verifiers ask, each asked alone, serve the revocation back, or every one of them does when verifiers ask fewer than two (§9.4 (opens in a new tab)). - Treat every returned event as a candidate. Anyone can publish an event tagged with anyone's address. Verify the envelope inside before using it.
- Verify each event before you merge relays. Check every event under NIP-01
(its
idis the SHA-256 of its serialized fields, and itssigverifies for itspubkey) before you merge or deduplicate answers from different relays, and drop one that fails, so it never takes the place of another relay's copy. Nor collapse copies under an envelope id before checking them: most family ids leave the signature out (an attestation, stamp or delegation id, a poll, ballot or reveal id), so a copy with a junk signature shares the id. Consider each copy and use one that verifies (OC Agent §10.4 (opens in a new tab), OC Lock §3.5 (opens in a new tab), OC Stamp §7.2 (opens in a new tab), OC Vote §6.5 (opens in a new tab), OC Pledge §11 (opens in a new tab), OC Attest §7.2 (opens in a new tab), OC Chat §8 (opens in a new tab)).
@orangecheck/sdk wraps the attestation query as getAttestationsForAddress.
@orangecheck/nostr-core's queryEvents checks each event's id, signature and
filter match, and reports per relay whether it reached EOSE. OC Agent's core
has no network by design: fetch with any client and pass the envelopes in.
Default relay setLink to this section
@orangecheck/nostr-core defaults to four public relays plus the family's own:
wss://nos.lolwss://relay.primal.netwss://relay.damus.iowss://nostr.oxtr.devwss://relay.ochk.io
Override with relays: [...] on any SDK call. For production deployments you
SHOULD query ≥3 distinct relay operators — a single slow or partitioned
relay shouldn't break discovery. See
Security — relay censorship / partition
for why this matters.
See alsoLink to this section
- Canonical message — what goes inside each
event's
contentfield - BIP-322 signing — what ties the Nostr event to the Bitcoin address
- Security model — relay assumptions and partition mitigation