Limits and Error Codes#

Generated from protocol-contract.json, the constants of chapter 02 and the error codes of chapter 06. Every SDK checks its constants against the contract.

Wire identifiers#

ItemValue
Packet version (ace)"1"
Signature domainace.v1
Signaturesml-dsa-65 (ML-DSA, FIPS 204)
Packet KEMX-Wing, draft-connolly-cfrg-xwing-kem-11
Core message typesace:receipt:1, ace:contact:1
Official profilesace:core:1, ace:text:1, ace:delegation:1, ace:commerce:1
Relay authentication headersX-ACE-Audience, X-ACE-Nonce, X-ACE-Id, X-ACE-Timestamp, X-ACE-Seq, X-ACE-Signature

Constants#

Normative values used by every implementation and relay.

NameValueMeaning
TIMESTAMP_WINDOW_SECONDS300Future bound for every signed timestamp; freshness window for relay requests
OFFLINE_WINDOW_SECONDS604800Past bound for packets; relay queue retention; Outbox retry horizon; lifetime of an outgoing pending entry; prekey retention; minimum relay retention of an unregistered identity's KEL
MAX_PLAINTEXT_BYTES1179648Canonical private content (1 MiB + 128 KiB)
MAX_PACKET_BYTES2097152Canonical JSON of a packet
MAX_SEND_BODY_BYTES2162688Body of POST /v1/send (MAX_PACKET_BYTES + 65536)
MAX_PUBLISHED_AGENT_BYTES1048576Canonical JSON of a PublishedAgent; also bounds a registration request and a CardBundle
MAX_CARD_RECORD_BYTES16384Canonical JSON of a card record
MAX_JSON_DEPTH32Depth of each protocol object (§ JSON values)
MAX_TYPE_BYTES256Namespaced identifier
MAX_THREAD_ID_LENGTH256Thread ID code points
MAX_KEL_EVENTS256Events per KEL
MAX_SIGNING_KEY_LIFETIME31622400notAfter - ts of a dlg signing key
MAX_DESCRIPTOR_LIFETIME604800expiresAt - issuedAt of a descriptor
MAX_PERMIT_LIFETIME2592000expiresAt - issuedAt of a delivery permit
PERMIT_RENEWAL_SECONDS1296000Remaining permit lifetime below which a receipt carries a renewal
MAX_RETAINED_PREKEYS16Superseded prekey seeds an endpoint retains
MAX_EXT_BYTES32768Canonical JSON of a descriptor ext
MAX_PAY_ACCOUNTS8Entries of a card record pay
MAX_NOTE_BYTES512UTF-8 bytes of a contact note
MAX_INBOX_PAGE100Maximum and default limit of inbox and directory pages
MAX_PAGE_BYTES8388608Serialized inbox or directory page
MAX_MANIFEST_BYTES65536Canonical JSON of a profile manifest
MAX_PENDING_CONTACT_REQUESTS16Held incoming contact requests (05)
CONTACT_REQUEST_TTL_SECONDS86400Lifetime of a held incoming contact request and of a relay's stranger entries
MAX_STRANGER_KEL_EVENTS32Events of the KEL in a stranger's contact source
STRANGER_ALLOWANCE16Queued stranger entries per recipient at a relay (07)
STRANGER_NETWORK_ALLOWANCE2Queued stranger entries per client network per recipient at a relay
CLIENT_NETWORK_PREFIX_IPV424Prefix length of an IPv4 client network (07)
CLIENT_NETWORK_PREFIX_IPV656Prefix length of an IPv6 client network
HANDLE_CLAIMS_PER_NETWORK_PER_DAY8New handles a relay lets one client network claim per 86400 seconds (07)
MIN_BLOCK_CAP256Least number of tracked block peers per identity a relay may cap at
PIN_REFRESH_INTERVAL_SECONDS30Minimum interval between pin refreshes of one sender in the receive pipeline
MAX_FETCH_ATTEMPTS3Fetches of one inbox entry without a final disposition before it is quarantined

Error codes#

An SDK reports every failure as one error type carrying a code, whose category is fixed. transient and local failures are retryable; permanent ones are not.

CategoryCodes
permanentinvalid_argument, invalid_packet, unsupported_version, wrong_recipient, invalid_signature, invalid_authorization, stale_timestamp, stale_peer_binding, decryption_failed, unknown_prekey, unsupported_schema, invalid_body, replay_horizon, invalid_kel, kel_conflict, unknown_peer, not_registered, not_permitted, relay_rejected, blocked_address, delivery_rejected, expired, stale_descriptor
transientrelay_unavailable, relay_protocol_error, fetch_failed
localstorage_failed, identity_unavailable, lock_busy, receiver_capacity, thread_busy

delivery_rejected carries the receipt's code as its remote code. Profile rules MAY raise further permanent codes matching the outcome-code grammar (profiles/commerce.md defines the commerce codes). Relay responses map to these codes as specified in 07.