DRD Post User — Group 16, Code 140

Creates or updates the caller’s own directory record: first name, last name, inbox fee, two avatar symbols, and the class-rejection byte (minimum sender denomination). The caller proves ownership by presenting the coin’s Authenticity Number; nobody else can write your record.

Quick reference

Command Group16 (DRD)
Command Code140 (0x8C)
Server functioncmd_drd_post_user in cmd_drd.c
Request bodyVariable: challenge(16) + record fields(34 + names) + terminator(2). Minimum 52 bytes (both names empty).
AuthenticationOwner AN, verified against the coin database like detect
Success responseStatus 250, no payload
SemanticsUpsert: creates the record, or replaces every field except created_at
DistributionClient sends the same request to all 25 RAIDAs

Purpose

post_user is how a user appears in (or updates) the directory. The record is keyed by the caller’s coin PQ (denomination + serial number); posting again with the same PQ overwrites the name, fee, and symbols, refreshes updated_at, and preserves the original created_at so account age cannot be faked.

The inbox fee is the decimal CloudCoin amount a stranger must pay to send this user QMail, expressed as an 8-byte big-endian count of 10−8 CC units (see the fee encoding section of the overview). Negative fees are rejected. Names are UTF-8, at most 63 bytes each; either or both may be empty.

The class-rejection byte sets the minimum denomination a sender’s address coin must have for this user to accept their QMail. It is signed, using the standard denomination encoding: 0x00 = 1 CC (.bit), 0x01 = 10 CC (.byte), and 0xFF = −1 = 0.1 CC (a dime) — so 0xFF ranks below 0x00, not above it. The default 0x00 means “accept all denominations” (no filtering); any other value rejects senders whose denomination is lower. Example: 0x01 rejects 1 CC and all fractional addresses, accepting 10 CC and up. Valid values are 0 or a denomination in −8…+6.

Request body

Diagram shows an example with a 5-byte first name (ALICE) and 5-byte last name (SMITH): 62 bytes total. FL/LL = first/last name length; S1/S2 = symbols; CR = class rejection; T = terminator.

Challenge random (12 bytes, part 1 of 2) 0 7 Challenge random (part 2) 8 11 Challenge CRC32 (BE) 12 15 DN 16 Serial Number (BE) 17 20 AN (part 1 of 3) 21 23 Authenticity Number (part 2 of 3) 24 31 AN (part 3 of 3) 32 36 Inbox fee (part 1) 37 39 Inbox fee (part 2, BE int64) 40 44 S1 45 S2 46 CR 47 FL 48 First name (FL bytes, ex. 5) 49 53 LL 54 La... 55 Last name (cont.) 56 59 3E 3E (term) 60 61
Request body layout (variable length)

+-------------------+------------------------------+-------------------------------+------------+
| challenge/CRC     | identity + auth              | record fields                 | terminator |
| 16 bytes          | DN(1) SN(4) AN(16)           | fee(8) S1(1) S2(1) CR(1)      | 2 bytes    |
|                   |                              | FL(1) first LL(1) last        |            |
+-------------------+------------------------------+-------------------------------+------------+
| body[0..15]       | body[16..36]                 | body[37..N-3]                 | 3E 3E      |
+-------------------+------------------------------+-------------------------------+------------+
minimum total = 52 bytes (FL = 0, LL = 0)
maximum total = 52 + 63 + 63 = 178 bytes
Body offsetSizeFieldDescription
0–1112Challenge randomRandom bytes generated by the client.
12–154Challenge CRC32Big-endian CRC32 of bytes 0–11.
161DenominationCaller’s coin denomination (signed, −8 to +6). Keys the record.
17–204Serial NumberCaller’s coin serial number, big-endian. Keys the record.
21–3616Authenticity NumberCaller’s AN for this RAIDA. Compared to the stored AN; mismatch → ERROR_INVALID_AN, nothing written.
37–448Inbox feeBig-endian signed int64, units of 10−8 CC. Must be ≥ 0.
451First symbolAvatar symbol index 0–255. Not validated by the server.
461Second symbolSecond avatar symbol index.
471Class rejection (CR)Signed minimum sender denomination. 0x00 = accept all (default); otherwise 0 or a denomination in −8…+6 — anything else → ERROR_INVALID_PARAMETER. Remember 0xFF is −1 (0.1 CC), below 0x00.
481First-name length (FL)0–63. Anything larger → ERROR_INVALID_PARAMETER.
49...FLFirst nameUTF-8 bytes, no NUL terminator.
49+FL1Last-name length (LL)0–63. The last name must end exactly at the terminator; extra bytes → error.
50+FL...LLLast nameUTF-8 bytes, no NUL terminator.
last 22TerminatorFixed 3E 3E.

Response

Success is a status-only response: standard RAIDA response header with status 250 (STATUS_SUCCESS) and no payload. There is no way to distinguish create from update in the response; clients that care should get_user first.

Status codes

DecimalHexSymbolMeaning
2500xFASTATUS_SUCCESSRecord created or updated.
160x10ERROR_INVALID_PACKET_LENGTHBody shorter than 52 bytes.
400x28ERROR_INVALID_SN_OR_DENOMINATIONDenomination/serial is not a coin this RAIDA holds.
1980xC6ERROR_INVALID_PARAMETERNegative fee, a class-rejection value that is neither 0 nor a denomination in −8…+6, a name length over 63, or name lengths inconsistent with the body size.
2000xC8ERROR_INVALID_ANAN does not match the stored AN. Nothing is written.
2520xFCERROR_INTERNALDatabase failure.

Common mistakes

Sending the fee as a float or decimal string

The fee field is a binary big-endian int64 in 10−8 CC units. 10992.934002 CC goes on the wire as 00 00 00 FF F2 FE 1C 88, not as text and not as IEEE floating point.

Expecting created_at to update

Re-posting refreshes updated_at only. created_at keeps its original value by design — it is the anti-scam account-age signal.

Posting to fewer than 25 RAIDAs

Each RAIDA’s directory is independent. A record posted to only some servers will be missing from searches served by the others; re-post to all 25.