switch_shard_sum_with_sns — Group 10, Code 174

Single-call shard switch: delete old coins (XOR-sum) AND set the new coin ANs (derived from a PANG) in one request.

Source-derived reference

Field layout below is read from raidax/cmd_shards.c (cmd_switch_shard_sum_with_sns). Minimum body size: 50 bytes. Verify against the current build before relying.

Purpose

Combines delete + create in one call, with value conservation checked (sum of new-coin value must equal old value). New ANs are derived from PANG, not supplied. TEST mode lets a client dry-run the conversion.

Request Body parameters

FieldBytesDescription
CH (challenge)16Standard 16-byte challenge (challenge-response / replay protection).
SI (session id)4Session id; 0 = TEST mode (verify only, write nothing).
SH (shard id)1Source shard (1 = CCv1, 2 = CCv2).
ST1Reserved / sub-type byte.
SM (sum AN)16XOR-sum AN authorizing deletion of the old batch.
ONR2Old-coin count N (big-endian).
old coinsvarN x 5: DN(1) + SN(4) each.
PANG16Seed for deriving each new coin AN = md5(PANG with DN/SN overlaid).
NR2New-coin count M (big-endian).
new coinsvarM x 5: DN(1) + SN(4) each.
EOF2Terminator (0x3E3E).

Response Body parameters

FieldBytesDescription
(status only)varNo body; status byte reports success/failure. In TEST mode (SI=0) old coins are detected but nothing is deleted or written.