chat.v1.json (19641B)
1 { 2 "schema_version": 1, 3 "contract_id": "radroots.protocol.chat.v1", 4 "state": "known_kind_codec_component_implemented", 5 "owner": "radroots_protocol", 6 "signing_conversion_owner": "radroots_signing", 7 "kinds": { 8 "rumor": 14, 9 "seal": 13, 10 "gift_wrap": 1059, 11 "recipient_dm_relays": 10050 12 }, 13 "rumor": { 14 "content": "Exact plain UTF-8 text, never a JSON commerce record", 15 "required_tags_in_order": [ 16 [ 17 "p", 18 "peer" 19 ], 20 [ 21 "radroots", 22 "thread", 23 "thread_id" 24 ], 25 [ 26 "radroots", 27 "operation", 28 "operation_id" 29 ] 30 ], 31 "optional_tags_in_order": [ 32 [ 33 "radroots", 34 "source", 35 "30402", 36 "author", 37 "d", 38 "event_id" 39 ], 40 [ 41 "e", 42 "reply_parent_message_id" 43 ] 44 ], 45 "unsigned": true, 46 "logical_identity": "The exact captured full operation ID is an unsigned-rumor discriminator inside the private encrypted message. Distinct operations with identical author/text/thread/time remain distinct; replay uses the original operation and captured time. The tag grants no authority.", 47 "complete_max_bytes": 24576, 48 "plain_text_max_bytes": 4096, 49 "recipient_set": "Sorted unique author and peer; one exact rumor for every per-recipient seal, including a deduplicated self-conversation", 50 "authorization": "Codec descriptors verify no source, parent, history, grant, consent, route or participant authority" 51 }, 52 "canonical": { 53 "preimage": "NIP-01 [0,pubkey,created_at,kind,tags,content], exact tag order and Unicode, lowercase control escapes, no Unicode normalization", 54 "legacy": "Event wire-v1 delegates canonical serialization while retaining its full accepted u64 timestamp/u32 kind range and public parse/error behavior", 55 "private_buffers": "Bound complete serialization before copying; clear owned rumor and temporary preimage text; no payload-bearing automatic diagnostics", 56 "unsigned_json": "Exact id/pubkey/created_at/kind/tags/content with no signature; complete unsigned length equals canonical preimage length plus 116 bytes", 57 "signed_json_length": "The supported exact complete signed object length equals canonical preimage length plus 253 bytes" 58 }, 59 "seal": { 60 "tags": [], 61 "timestamp": "Explicit positive time no later than rumor time and at most 172800 seconds earlier; runtime supplies checked randomized input", 62 "ciphertext": "Canonical base64 shape, version-2 prefix, exact predicted padded payload size; structural checks do not authenticate a MAC", 63 "complete_signed_max_bytes": 65536, 64 "signing": "Convert validated known-kind fields through the existing exact-intent signer; no command or durable-admission authority is created" 65 }, 66 "nested_budget": { 67 "profile": "Size calculations cover the standard two-byte NIP-44 v2 length prefix for lengths 1 through 65535; no extended-prefix support is claimed.", 68 "provider_caps": "A size calculation does not advertise encryption capability for every counted input. Both selected chat layers must fit the concrete provider's 65536-byte text/ciphertext boundary and the complete signed-event bounds.", 69 "measurement": "Before business seal signing, count complete rumor, padded/base64 rumor ciphertext, worst supported-timestamp signed seal, padded/base64 outer ciphertext and complete signed 1059 envelope", 70 "qualification": "Independent ECMAScript JSON/SHA-256/base64 vectors plus actual Rust encryption/signature/decryption conversion; structural vectors deliberately carry no valid MAC" 71 }, 72 "source": { 73 "repository": "https://github.com/nostr-protocol/nips", 74 "commit": "37db639582d857e12468dcccd99b2c7f1d657da9", 75 "documents": [ 76 "01.md", 77 "17.md", 78 "44.md", 79 "59.md" 80 ] 81 }, 82 "remaining": "Complete owned native execution route/capability approval and ordinary client job orchestration, install/outbox, exact per-recipient wrapping/delivery, full receipts, browser/bindings and final acceptance", 83 "structured_commerce_authoring_enabled": false, 84 "package_publication_authorized": false, 85 "recipient_dm_routes": { 86 "source_kind": 10050, 87 "source_max_bytes": 65536, 88 "source_verifier": "radroots_signing::issuance::VerifiedDmRelayAdvertisement", 89 "selected_uri_max_bytes": 2048, 90 "combined_session_max_relays": 16, 91 "empty_advertisement": "Explicit unavailable DM information; no fallback", 92 "data_constructor_authority": "No signature, source identity, configured/available transport, grant or consent proof; execution revalidates before dispatch" 93 }, 94 "native_signing_plan": { 95 "state": "protected_native_transaction_component_implemented", 96 "codec_owner": "radroots_protocol::chat::ChatSigningPlan", 97 "complete_max_bytes": 393216, 98 "recipient_set": "Exactly sorted unique author and peer; no partial set", 99 "retained": "Original command and message commitments, exact per-recipient seal author/kind/time/tags/content/event ID/purpose, original signed route-source bytes, selected targets and explicit replay declaration", 100 "retained_memory": "Canonical buffer bounded before allocation; decoded recipient collections use boxed slices, not caller spare vector capacity", 101 "protected_data_part_max_bytes": 16384, 102 "max_data_parts": 24, 103 "protected_total_max_bytes": 2097152, 104 "native_workspace_schema": 7, 105 "predecessors": "Preserve and refuse; no inferred timestamps or automatic namespace rewrite", 106 "queue": "32 slots plus conservative queued and in-flight reservations under 4194304 bytes", 107 "transaction": "Current protected grant, original preparation, all indexed facts and fixed first-issue window rechecked under BEGIN IMMEDIATE; crypto work before transaction", 108 "completion": "Confirmed commit, known rollback and original anchored unknown are distinct; accepted owner work survives observer loss", 109 "remaining": "Execution route/capability approval, owned ordinary execution, T2/D, complete receipts, supported consumer adoption, browser/binding runtime and final acceptance" 110 }, 111 "native_issuance": { 112 "state": "native_claim_and_obtained_capture_component_implemented", 113 "attempt_identity": "Full 256-bit Domain SigningAttemptId; immutable original command, plan, recipient, exact v1 intent, first-issue window and transaction provenance", 114 "intent_data_owner": "radroots_protocol::intent; Signing reexports preserve the exact existing v1 byte layout", 115 "fresh_claim": "Current protected grant, complete original facts and deadline rechecked under BEGIN IMMEDIATE before dispatch; no signer invocation inside SQLite", 116 "retained_or_unknown_claim": "Potential issuance; never infer safe reissue", 117 "obtained_capture": "Append only independently verified original bytes matching the actual protected claim; original credential and scope without fresh deadline, revocation or observation-clock admission", 118 "caller_ownership": "Borrowed original retained by caller through error, lost observer or unknown completion", 119 "observation": "First original optional time is immutable; missing time remains null", 120 "evidence_max_bytes": 65536, 121 "protected_data_part_max_bytes": 16384, 122 "max_data_parts": 4, 123 "protected_total_max_bytes": 1048576, 124 "capture_queue_reservation_bytes": 262144, 125 "schema": 7, 126 "schema_objects": 20, 127 "remaining": "Ordinary client-owned orchestration and full operation receipts, route/provider approval, installation/outbox/delivery, target graph retirement and all consumer/final gates" 128 }, 129 "native_operation_snapshot": { 130 "state": "native_snapshot_and_receipt_component_implemented", 131 "snapshot_owner": "radroots_storage::command::OperationSnapshot", 132 "query": "OperationJournal::operation_snapshot on the existing native owner", 133 "receipt_owner": "radroots_execution::OperationReceipt; ordinary facade reexports", 134 "native_schema": 7, 135 "transaction": "Authenticate complete original T0/T1/S/T2/D and protected target observations outside transaction; recheck current grant, retained and absent facts and every bounded graph count under BEGIN IMMEDIATE; confirmed rollback before reporting", 136 "extra_or_orphan_rows": "Recovery required; never silently omitted from a complete report", 137 "memory": "One complete owned plan, at most two recipients, bounded original delivery summaries and target observations. Snapshot/receipt references omit duplicate raw envelope bytes; owning graph verification remains bounded. Diagnostics are redacted.", 138 "progress_digest": "SHA-256 with radroots.operation.snapshot.v3 NUL separator; original v2 dimensions plus complete original delivery intent, exact outer representation digest, transaction/time/target ordinals, and original target outcome/retry/detail/nullable time. Query time and diagnostic correlation remain excluded.", 139 "dimensions": [ 140 "durable_admission", 141 "business_installation", 142 "per_recipient_issuance", 143 "delivery", 144 "caller_wait_termination", 145 "recovery" 146 ], 147 "first_issue_expiry": "Remaining unrequested work is blocked; obtained and unknown classifications are preserved. Expiry proves no nonissuance.", 148 "scope": "Original actor/workspace/authority/route, command/transactions/window, authority evidence checkpoint, logical-message and structured-record namespaces, protected artifact references and nullable original observations", 149 "construction_authority": "Pure values do not authenticate a principal, qualify a custom adapter, permit dispatch or prove installation/delivery", 150 "remaining": "Library-owned ordinary inbox jobs, complete browser/binding/consumer closure and final acceptance", 151 "count_bounds": "Whole-operation extra-recipient count checks stop at excess sentinels 3 claims, 3 obtained manifests and 9 parts; absent-operation checks use EXISTS. Existing protected per-recipient part bounds and authentication remain mandatory. T2 sentinels stop at 2 messages and 3 publication-work rows. D excess sentinels are 385 attempts, 9217 frame parts and 2305 target observations; at most 384 actual target slots and 2304 independent observation classes." 152 }, 153 "native_installation": { 154 "state": "native_t2_component_implemented", 155 "transaction_owner": "Existing bounded native workspace connection worker; no second engine", 156 "operation": "OperationJournal::install_transition_and_outbox", 157 "business_view": "radroots_domain::ChatMessage; original captured text/relations and original logical message time, independently owned and diagnostically redacted", 158 "plain_text_max_bytes": 4096, 159 "body_retention": "Original authenticated T0 command; fixed protected T2 records reference it and the exact complete T1 plan without duplicate private text", 160 "atomic_effect": "One logical chat_messages installation plus eligible actual-recipient chat_publication_work in one IMMEDIATE transaction; complete current grant and all retained/absent T0/T1/S/T2 facts compared before writes", 161 "partial_and_late": "Any actual matching obtained recipient artifact may establish the original installation. Later capture adds only its missing publication work; original installation transaction/time and earlier links stay unchanged.", 162 "window": "Original first-issue window constrains new signatures, not installation of matching already obtained evidence. Current access still gates T2.", 163 "outcomes": "Confirmed commit, known rollback and original anchored unknown; unknown latches until safe reopen. Claims/evidence are never released by T2 failures or observer loss.", 164 "replay": "Compare original retained graph before fresh work; no replacement installation, new entropy/protection or signature on exact replay", 165 "protected_plaintext_max_bytes": 16384, 166 "protected_row_max_bytes": 262144, 167 "protected_aggregate_upper_bound_bytes": 786432, 168 "live_queue": "Existing 32 slots and 4194304 accepted/in-flight input bytes; 16384-byte installation input reservation", 169 "schema": 7, 170 "schema_objects": 20, 171 "cutover": "Preserve and refuse all predecessor namespaces, including actual schema5 claims/evidence; no automatic upgrade or state deletion", 172 "reporting": "Owned message only with scoped actual installation report; original installation and independent recipient work transactions. Actual D observations remain separate; no relay fact is inferred from T2.", 173 "qualification": "Separate exact-source executed evidence; declarations and data constructors are not qualification", 174 "remaining": "Ordinary library-owned inbox jobs, browser/bindings, supported consumer adoption and all final gates" 175 }, 176 "outer_wrapping": { 177 "state": "retained_seal_crypto_component_implemented", 178 "owner": "radroots_nostr::signing::gift_wrap", 179 "budget_owner": "radroots_protocol::chat::GiftWrapBudget", 180 "source": "Exact seven-field, depth-bounded, ID and BIP-340 verified original kind13 event; empty tags and supported NIP44v2 payload shape; actual operation/recipient/capture linkage remains the composing journal responsibility", 181 "representation": "Encrypt original UTF8 bytes, including whitespace, not a canonical replacement; size complete nested output before requesting entropy", 182 "entropy": "Explicit qualified NonceSource for independent temporary key, unbiased randomized past timestamp, NIP44 nonce and BIP340 auxiliary randomness; no ambient clock or participant signer call. Upstream secp256k1 context blinding retains its own initialization contract; no ambient artifact-entropy fallback.", 183 "qualification": "Separate exact-source executed evidence; this declaration does not qualify durable capture, transport, a custom entropy source or a host runtime", 184 "temporary_material": "Opaque noncloneable pending outer holds zeroizing original 32-byte key and permits a scoped verification borrow. Known author and recipient keys are refused. The pinned upstream erases Keys/SecretKey on Drop using non_secure_erase; no total memory-erasure guarantee is claimed for upstream intermediate values.", 185 "bounds": { 186 "signed_event_bytes": 65536, 187 "past_timestamp_seconds": 172800, 188 "entropy_rejection_draws_per_selection": 16 189 }, 190 "authority": "Construction authenticates a seal and creates an outer representation; it proves no grant, route, operation linkage, durable capture, scheduling lease or delivery", 191 "remaining": "Protected native exact-envelope and target-intent retention before transport, bound observations, ordinary owned inbox jobs, browser/binding runtime and final acceptance" 192 }, 193 "native_delivery": { 194 "state": "native_retention_and_observation_component_implemented", 195 "owner": "Existing bounded native workspace connection worker; no additional engine", 196 "schema": 7, 197 "schema_objects": 20, 198 "retention": "Verify actual T0/T1/S/T2 and selected signed kind10050 provenance. Derive and verify temporary outer key, decrypt the signed kind1059 against exact original retained seal bytes, then atomically protect exact signed outer and complete target intent before any transport.", 199 "temporary_material": "Borrowed temporary wrapping key is used only for independent containment verification; it is never persisted or treated as participant commitment authority. Original actor, peer and selected-recipient keys are all refused as temporary outer authors, including for self-copy publication work.", 200 "route_identity": "Authenticate the original signed kind10050 source and exact selected strings without replacement. Compare actual retained Nostr targets with those captured strings through Target::matches_nostr_relay, using the target's original construction policy and shared canonical URI rules. Root slash, host case and default-port aliases preserve endpoint identity; matching grants no network permission or new route.", 201 "intent": "Full 256-bit delivery request ID, original actual publication/capture/plan linkage, exact outer ID and representation digest, full original canonical target set and Accepted-only satisfaction policy, original per-attempt deadline, independent nonempty exact target selection and selected-endpoint potential invocation ordinals.", 202 "attempts": "At most twelve potential invocations per recipient/canonical endpoint. Changing target scope does not reset this budget. Exact replay returns retained original data with no dispatch right or budget increment. A newly retained retry may reuse only the original exact bytes, with no new participant signature.", 203 "observation": "Original credential and actual attempt/target/event/representation linkage required. No fresh clock, deadline, revocation or scheduling lease admission. First original observation of each independent class is immutable, including null time; later classes append.", 204 "classes": [ 205 "accepted", 206 "rejected", 207 "timed_out", 208 "disconnected", 209 "unknown", 210 "not_attempted" 211 ], 212 "receipt_binding": "Generic successful and partial-failure receipts require SHA-256 of exact original signed JSON bytes in addition to original request ID and targets. Relay acceptance never proves recipient delivery.", 213 "bounds": { 214 "signed_outer_bytes": 65536, 215 "targets": 16, 216 "endpoint_bytes": 2048, 217 "attempts_per_endpoint": 12, 218 "operation_target_slots": 384, 219 "observation_classes_per_slot": 6, 220 "operation_observations": 2304, 221 "frame_bytes": 393216, 222 "frame_parts": 24, 223 "private_part_bytes": 16384, 224 "protected_row_bytes": 262144, 225 "protected_frame_aggregate_bytes": 2097152, 226 "live_queue_bytes": 4194304, 227 "prepare_input_reservation_bytes": 1048576, 228 "observation_input_reservation_bytes": 98304 229 }, 230 "completion": "Confirmed commit, known rollback and original anchored unknown remain distinct. Accepted owner work survives lost observers and drains before close. Missing ACKs, transport errors and uncertain D completion never reverse T0/T2 or release S claims.", 231 "startup": "Current access is required for coherent queries. Reopen and restored projections never publish automatically or renew scheduling rights. Preserve and refuse predecessor schema6 namespaces without automatic upgrade.", 232 "qualification": "Exact-source executed owning checks are required separately; constructors, declarations, valid metadata and a custom adapter report confer no qualification.", 233 "remaining": "Ordinary library-owned inbox job orchestration, complete provider/route approval at dispatch, browser/bindings, supported consumer adoption and final acceptance", 234 "publication_policy": "Freeze the first full target identity set and satisfaction criterion per actual recipient work. A retry or rewrapping cannot narrow or replace it. Evaluate original full-target acceptance across all retained exact attempt observations; an earlier acceptance remains authoritative.", 235 "selection": "Only selected endpoints spend potential-invocation slots or produce bound target observations. The host uses EventSink::deliver_selected with the full original request and exact retained subset; unselected endpoints are not invoked. Exhausted optional endpoints do not starve required endpoints. Quorum success may accumulate across selected retries.", 236 "deadline": "A matching request ID retains its original deadline. A distinct current-access attempt may capture a new delivery deadline without altering the full publication criterion, original operation installation or participant issuance facts." 237 } 238 }