DRD Server Post — Group 16, Code 149

Authenticated write of one server-role descriptor into DRD storage.

Quick reference

Command Group16 (DRD)
Command Code149
Server functioncmd_drd_server_post
Header versionHV=2 only (HV=1 returns 219)
AccessAuthenticated by identity coin dn+sn+AN in body
WritesUpsert into role table(s) in drd.db
Response31 bytes (role,dn,sn,raida_id,created_at,updated_at,last_seen_at)

Request body

After the 16-byte challenge prefix, payload fields are:

OffsetSizeFieldDescription
08session_idMust be all zero under AUTH_COIN.
82coin_typeMust be 0x0006.
101dnIdentity denomination.
114snIdentity serial (BE).
151reservedMust be zero.
1616ANAuthenticity number for this RAIDA.
321role0=raida, 1=qmail, 2=beacon, 3=drd, 4=rke.
332field_countNumber of TLVs that follow.
35...varTLVstag(1)+len(2,BE)+value. Unknown tags are skipped.

TLV tags

Known tags are role-gated. A known tag used on the wrong role is invalid (198).

TagNameLenRoles
0x01raida_id1raida
0x02jurisdiction1..64 UTF-8raida
0x03benchmark_ms4raida
0x10ip44all
0x11ip616all
0x12network_speed_bps8all
0x20ram8qmail,beacon,drd,rke
0x21processor1..64 UTF-8qmail,beacon,drd,rke
0x22storage_available8qmail
0x23max_object8qmail
0x24accepting_uploads1 (0/1)qmail
0x25version4qmail
0x30welfare_bytes8qmail,drd,rke
0x31tiers1..255qmail
0x32min_mailbox_class1 (0..4: minimum sender address-coin denomination code, 0 = 1 CC @bit, 4 = 10,000 CC @giga; absent = 0)qmail,beacon,drd,rke
0x33subscriptions_available1 (0/1)qmail,beacon,drd,rke
0x34subscription_url1..255 UTF-8qmail,beacon,drd,rke
0x35registration_needed1 (0/1)beacon
0x36encryption_types1..63qmail,beacon,drd,rke
0x40is_a_raida1all (ignored on write)
0x7Freserved32all (must be zero)

Validation rules

  • Authentication check (dn+sn+AN) runs before TLV parsing. Unknown coin returns 40; bad AN returns 200.
  • field_count must match parsed TLV count exactly, or request fails as malformed (16).
  • Duplicate TLV tag or TLV overrun returns 16.
  • role=raida requires dn=5 plus TLVs raida_id and jurisdiction.
  • Role/dn matrix: qmail/drd/rke allow dn 4 or 5; beacon allows dn ≥ 4.
  • If both ip4 and ip6 are absent, server fills ip4 from observed peer address.
  • RAIDA slot/coin binding is strict: conflicting slot claim is rejected (198), not auto-taken over.

Response body

FieldSizeDescription
role1Echoed role.
dn1Echoed denomination.
sn4Echoed serial (BE).
raida_id1Slot for role=raida, otherwise 0xFF.
created_at8Server-stamped Unix seconds.
updated_at8Server-stamped Unix seconds (fact changes only).
last_seen_at8Server-stamped Unix seconds (every successful post).

Status codes

CodeSymbolMeaning
250STATUS_SUCCESSDescriptor accepted and stored.
16ERROR_INVALID_PACKET_LENGTHMalformed body, duplicate tag, TLV overrun, or field_count mismatch.
36ERROR_EMPTY_REQUESTBody missing.
40ERROR_INVALID_SN_OR_DENOMINATIONIdentity coin not found on this RAIDA.
198ERROR_INVALID_PARAMETERIdentity/role/TLV validation failure, reserved field non-zero, or RAIDA slot conflict.
200ERROR_INVALID_ANIdentity AN mismatch.
219ERROR_UNSUPPORTED_PROTOCOLCommand 149 sent as HV=1.
252ERROR_INTERNALStorage-layer failure.
254ERROR_MEMORY_ALLOCAllocation failure while building response.