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
| Field | Bytes | Description |
|---|---|---|
| CH (challenge) | 16 | Standard 16-byte challenge (challenge-response / replay protection). |
| SI (session id) | 4 | Session id; 0 = TEST mode (verify only, write nothing). |
| SH (shard id) | 1 | Source shard (1 = CCv1, 2 = CCv2). |
| ST | 1 | Reserved / sub-type byte. |
| SM (sum AN) | 16 | XOR-sum AN authorizing deletion of the old batch. |
| ONR | 2 | Old-coin count N (big-endian). |
| old coins | var | N x 5: DN(1) + SN(4) each. |
| PANG | 16 | Seed for deriving each new coin AN = md5(PANG with DN/SN overlaid). |
| NR | 2 | New-coin count M (big-endian). |
| new coins | var | M x 5: DN(1) + SN(4) each. |
| EOF | 2 | Terminator (0x3E3E). |
Response Body parameters
| Field | Bytes | Description |
|---|---|---|
| (status only) | var | No body; status byte reports success/failure. In TEST mode (SI=0) old coins are detected but nothing is deleted or written. |