Skip to content

Native Wire reference

This page is a compact index for agents and implementers. The normative source is docs/native-wire-v1.md; the complete machine contract is /native-wire-v1.json. Both are versioned with the repository. LNW/1 is experimental, opt-in, and disabled by default.

Envelope

ItemValue
MagicASCII LKW1 (4c4b5731)
Version1
Byte orderUnsigned big-endian
Header40 bytes
Bodymetadata TLVs, payload, CRC32C (4 bytes)
Textshortest-form UTF-8, NUL-free
Unknown optional fieldSkip
Unknown critical fieldReject the stream (UNSUPPORTED_FIELD)
Downgrade / code reuseForbidden

Header offsets are fixed and must not be inferred from a language ABI:

OffsetSizeField
04magic
42version
61frame type
71flags
88connection sequence
168request ID
244stream ID
282operation/error/control code
302reserved (zero)
324metadata length
364payload length

Defaults and security

Limit or policyDefault
Metadata / DATA payload / frame64 KiB / 1 MiB / 1,114,156 bytes
Streams / connections128 / 1,024
Stream / connection window4 MiB / 16 MiB
Auth skew300 seconds (maximum 5 minutes)
Replay state1,024 principals × 256 nonces per principal
Upload admissionsecurity.max_concurrent_uploads = 128, process-wide
Upload idle / maximum duration2 minutes / 24 hours per stream
Auth retry hint maximum600,000 ms
Non-loopback TLSTLS 1.3 + hostname verification

User metadata is an ordered, duplicate-preserving user namespace. Internal SSE-C and Object Lock fields are typed and separate. The effective lockwelld mask excludes SSE_C (128); use S3 for genuine SSE-C. Admin bit 16 and operation range 0x10000x10ff are reserved and unimplemented.

Frame types

CodeTypeRole
0x01HELLOClient version, capabilities, receive limits
0x02WELCOMEServer selection and intersection
0x03AUTHAccess-key timestamp, nonce, transcript proof
0x04AUTH_OKTenant, session, expiry, capabilities, effective limits
0x05AUTH_ERRORBounded authentication failure
0x10REQUESTStarts one operation on an odd client stream
0x11DATAFlow-controlled bytes
0x12ENDCloses one direction
0x13CANCELCancels the stream context
0x20RESPONSEStarts a successful response
0x21ERRORTyped terminal response
0x30WINDOW_UPDATEGrants stream or connection credit
0x31 / 0x32PING / PONGEight opaque liveness bytes
0x33GOAWAYDrain or protocol reason and last accepted stream
0x34CLOSEAuthenticated close acknowledgement

Capabilities

BitNameAdvertised by lockwelld
1BUCKETSyes
2OBJECTSyes
4PAGINATIONyes
8MULTIPARTyes
16VERSIONINGyes
32OBJECT_LOCKyes
64TAGSyes
128SSE_Cno (no enforced native path)
256SIGNED_CAPABILITYyes
512TRACE_CONTEXTyes
1024CORSyes
2048NOTIFICATIONSyes
65536ADMIN (reserved)no

Operations

Code rangeOperationsRequired capability
0x00010x0002CAPABILITIES, READINESSauthenticated discovery
0x01000x0105bucket CRUD and versioningBUCKETS
0x02000x0207object CRUD, ranges, copy, versions, batch deleteOBJECTS
0x03000x0305multipart create/part/list/complete/abort/listMULTIPART
0x04000x0402tags get/put/deleteTAGS
0x05000x0503retention and legal holdOBJECT_LOCK
0x0600signed capability mintSIGNED_CAPABILITY
0x07000x0702bucket CORS get/put/deleteCORS
0x07100x0712bucket webhook notifications get/put/deleteNOTIFICATIONS

Clients must not send an operation until its capability is selected. The complete field and document schemas are in the JSON registry; response metadata includes status, ETag, version, length/type, request ID, traceparent, timestamps, delete-marker, retention/legal-hold, and ordered user metadata.

Errors and retry contract

CodeNameTypical handling
0x0103AUTH_REPLAYterminal; do not retry the proof
0x0300RATE_LIMITEDretry only from a fresh connection with fresh credentials/proof when marked retryable
0x0301UNAVAILABLEbounded caller retry when operation/body is replay-safe
0x0302DEADLINE_EXCEEDEDterminal for the stream; partial upload state is removed
0x0303CANCELLEDcaller cancellation; no implicit replay
0x0204 / 0x0205RETENTION_DENIED / LEGAL_HOLD_DENIEDauthorization/policy denial
0x0207 / 0x0208CHECKSUM_MISMATCH / TOO_LARGEfix input or limits; do not retry unchanged

AUTH_ERROR fields are retryable (required bool), retryAfterMillis (optional, ≤600000), and bounded message (≤512 bytes). Error frames contain safe messages and correlation only; secrets and payloads are never reflected.

Source-available under PolyForm Noncommercial 1.0.0; commercial use requires a written grant. License