CloudCoin File Format 10
FINAL v1.0Normative byte-level standard for a portable, password-encrypted, single-coin CloudCoin file.
1. Scope and conformance
Format 10 is the wallet-internal encrypted file format for exactly one CloudCoin. The first byte of every CloudCoin .bin file selects its parser. A Format 10 reader MUST examine byte 0 before interpreting any other byte.
The key words MUST, MUST NOT, SHOULD, SHOULD NOT, and MAY are normative.
- The physical file size MUST be exactly 612 bytes.
- The file MUST represent exactly one CloudCoin, 25 RAIDA identifiers, and 25 authenticity numbers (ANs).
- Only the 400 AN bytes are encrypted. Metadata, POWN, salt, nonce, and CRC remain plaintext.
- Every multi-byte integer is stored most-significant byte first (big-endian).
- There is no password verifier, authentication tag, recognizable encrypted constant, or plaintext structure inside the encrypted region.
- Decrypted ANs and stored POWN values remain untrusted until RAIDA validation.
The encryption suite belongs to the file, not to the computer. A file written on Windows uses the same suite when opened on macOS, Linux, Android, or iPhone. A reader MUST NOT replace the stored suite with platform defaults.
2. Packet-style byte map
The large RAIDA identifier and ciphertext regions are collapsed. Their first and last entries are shown instead of drawing all 150 and 400 bytes.
0x10; encrypted ANs begin at aligned offset 0xD0. Each encrypted 16-byte AN begins on a 16-byte file boundary.
Open SVG.
3. Complete file layout
| Offset | Bytes | Field | Encoding and purpose |
|---|---|---|---|
| 0 | 1 | format_type |
Unsigned byte. MUST equal 0x0A. |
| 1 | 1 | denomination |
Signed two's-complement byte from -8 through +11. |
| 2–5 | 4 | serial_number |
Unsigned 32-bit CloudCoin serial number, big-endian. |
| 6–8 | 3 | task_id |
Unsigned 24-bit task identifier, big-endian. Zero means none. |
| 9 | 1 | encryption_type |
Complete encryption and password-KDF suite identifier. |
| 10–15 | 6 | future_use_1 |
New writers set zero. Readers accept nonzero values; updates preserve them. |
| 16–28 | 13 | pown |
Twenty-five packed four-bit status values followed by a 0x9 padding nibble. |
| 29–178 | 150 | raida_ids |
Twenty-five unique unsigned 48-bit RAIDA identifiers, each big-endian. |
| 179–194 | 16 | kdf_salt |
Random salt generated by the operating system cryptographic random source. |
| 195–206 | 12 | nonce |
Fresh random nonce for this encrypted representation. |
| 207 | 1 | future_use_2 |
Alignment/future-use byte. New writers set zero; updates preserve it. |
| 208–607 | 400 | ciphertext |
Encrypted concatenation of AN[0] through AN[24], 16 bytes each. |
| 608–611 | 4 | file_crc32c |
Big-endian CRC-32C of bytes 0 through 607. Detects accidental corruption only. |
A new writer MUST zero bytes 10–15 and 207. A reader MUST NOT reject nonzero values solely because they are unknown. When rewriting an existing file, software SHOULD preserve these seven bytes exactly.
4. Encryption suite table
encryption_type identifies an immutable suite, not a software library. Different libraries conform when they produce the same Argon2id key and AES-CTR ciphertext for the same test vector.
| Value | Name | Reader support | Writer policy |
|---|---|---|---|
| 0x00 | Invalid | MUST reject | MUST NOT write |
| 0x01–0x04 | Reserved | MUST reject unless assigned by another standard | MUST NOT write |
| 0x05 | Portable AES-256-CTR + Argon2id | Mandatory on all supported platforms | Default for portable files |
| 0x06 | High-cost AES-256-CTR + Argon2id | Optional because of memory cost | Use only when reduced portability is accepted |
| 0x07–0x7F | Future standardized suites | MUST reject until assigned | MUST NOT write until assigned |
| 0x80–0xFF | Reserved/nonportable | MAY reject | Portable implementations MUST NOT write |
0x05 — Portable/mobile profile
- Cipher
- AES-256-CTR
- KDF
- Argon2id
- Argon2 version
- 0x13 / 1.3
- Memory
- 65,536 KiB
- Time cost
- 3
- Parallelism
- 1
- Output key
- 32 bytes
- Support
- Mandatory
0x06 — Desktop/high-cost profile
- Cipher
- AES-256-CTR
- KDF
- Argon2id
- Argon2 version
- 0x13 / 1.3
- Memory
- 262,144 KiB
- Time cost
- 3
- Parallelism
- 4
- Output key
- 32 bytes
- Support
- Optional
The password is passed to Argon2id as its exact UTF-8 byte sequence. Software MUST NOT normalize Unicode, change case, trim whitespace, pad, truncate, or append a terminating NUL byte. Empty passwords and embedded NUL bytes are invalid.
The suite parameters are immutable. A different cipher, KDF, work factor, or key size requires another encryption_type value.
5. POWN encoding
POWN stores one four-bit status for each RAIDA. Even RAIDA indexes occupy the high nibble and odd indexes occupy the low nibble:
| Nibble | Status | Nibble | Status |
|---|---|---|---|
| 0x0 | Unknown / untried | 0x8 | Previously authentic / network error |
| 0x1 | Unknown / network error | 0x9 | Previously authentic / server error |
| 0x2 | Unknown / server error | 0xA | Confirmed authentic |
| 0x3 | Unknown / timeout | 0xB | Reserved; treat as unknown |
| 0x4–0x6 | Reserved; treat as unknown | 0xC | Previously failed / timeout |
| 0x7 | Previously authentic / untried | 0xD | Previously failed / network error |
| 0xE | Previously failed / server error | ||
| 0xF | Confirmed failed / counterfeit |
The low nibble of byte 28 MUST equal 0x9 and is not a twenty-sixth status. POWN is a readable cache, not proof of authenticity.
6. RAIDA identifier and AN mapping
Each six-byte RAIDA identifier, POWN nibble, and 16-byte AN share the same index n from 0 through 24.
| Index | RAIDA ID bytes | POWN location | Ciphertext bytes |
|---|---|---|---|
| 0 | 29–34 | High nibble of byte 16 | 208–223 |
| 24 | 173–178 | High nibble of byte 28 | 592–607 |
RAIDA identifiers are unsigned 48-bit big-endian values and MUST be unique within the file. Duplicate identifiers are a format error.
7. AES-CTR encryption
The 400-byte plaintext is exactly the concatenation below. It contains no record header, padding, checksum, delimiter, tag, or recognizable constant.
The 12-byte nonce is stored at offsets 195–206. Format 10 fixes the initial counter at 1; it is not stored.
Nonce lifecycle
- A writer MUST obtain a fresh 12-byte nonce from the operating system cryptographic random source for every new encrypted representation.
- The nonce MUST NOT be derived from the password, salt, serial number, timestamp, filename, machine identity, or an external counter file.
- Every AN, POWN, or metadata rewrite MUST use a fresh nonce and regenerate all 400 ciphertext bytes.
- A failed write consumes its nonce. A retry MUST generate another nonce.
- Reading and byte-for-byte backup copying preserve the existing nonce because they do not create ciphertext.
- Changing the password MUST generate a new salt and nonce and re-encrypt all ANs.
8. CRC-32C
file_crc32c is calculated over exactly bytes 0–607 and stored big-endian at offsets 608–611.
| Parameter | Value |
|---|---|
| Algorithm | CRC-32C (Castagnoli) |
| Reflected polynomial | 0x82F63B78 |
| Initial value | 0xFFFFFFFF |
| Input/output reflected | Yes |
| Final XOR | 0xFFFFFFFF |
| Stored byte order | Big-endian |
CRC-32C detects accidental damage. An attacker can modify the file and recompute it. CRC success does not authenticate POWN, ciphertext, metadata, or a password.
9. Canonical processing
Read procedure
- Read byte 0 and dispatch to this reader only when it equals 0x0A.
- Require a physical size of exactly 612 bytes.
- Validate CRC-32C, denomination, POWN padding, unique RAIDA identifiers, and a supported encryption suite.
- Return metadata and POWN as untrusted when a metadata-only read is requested.
- Derive the candidate AES key using the exact suite selected by byte 9.
- Decrypt bytes 208–607 and split the result into 25 consecutive 16-byte candidate ANs.
- Do not inspect candidate ANs for structure or report local password success or failure.
- Query the corresponding RAIDA servers when validation is requested.
- Permit persistent mutation only after the client confirmation policy is satisfied.
Write procedure
- Require exactly one structurally valid CloudCoin and, for existing encrypted files, sufficient RAIDA confirmation for mutation.
- Allocate and zero exactly 612 bytes, set byte 0 to 0x0A, and encode all metadata.
- Select suite 0x05 by default. Select 0x06 only when reduced portability is accepted.
- For a new file or password change, generate a new 16-byte salt. Preserve the salt for ordinary updates under the same password.
- Generate a fresh 12-byte nonce, concatenate the ANs, and encrypt all 400 bytes.
- Calculate CRC-32C and write the complete representation to an encrypted temporary file on the destination filesystem.
- Before replacement, verify that the destination still exactly matches the representation originally read.
- Flush and close the temporary file, then replace the destination using the safest operation supported by the filesystem.
- Clear password, derived-key, plaintext-AN, and KDF intermediate buffers when no longer required.
RAIDA confirmation
The confirmation threshold is client policy and is not stored in Format 10. A failed or inconclusive candidate validation MUST NOT overwrite, delete, re-encrypt, rotate ANs, or persist POWN to the original file.
If usable RAIDA replies reject every candidate AN, the client MAY say: “The password may be incorrect, or the coin may be counterfeit.” Network failure is inconclusive.
Backup and export
- A normal encrypted backup copies all 612 bytes unchanged and remains protected by the wallet password.
- Recipient export is distinct from backup. After RAIDA validation, export writes the existing plaintext interoperable CloudCoin format.
- Format 10 is wallet-internal and MUST NOT be presented as a recipient-compatible plaintext export.
10. Security properties and limitations
Provided
- Confidentiality of the 25 ANs while the password-derived key remains secret.
- A single isolated file contains no password-dependent confirmation value.
- Portable decryption through immutable suite definitions.
- Accidental corruption detection through CRC-32C.
Not provided
- Cryptographic integrity or authenticity. AES-CTR ciphertext is malleable.
- A local determination that the supplied password is correct.
- Protection from malware, keyloggers, process-memory inspection, or a compromised host.
- Protection from deletion, denial of service, malicious rollback, or secure-deletion limitations of flash storage.
- Offline non-confirmability when an attacker knows a true AN or possesses historical versions containing unchanged ANs.
- Protection from online password testing through RAIDA.
If an attacker has two differently encrypted versions in which an AN is unchanged, the attacker may recognize the correct password by finding the same decrypted 16-byte value in both versions. A one-byte backup marker cannot prevent this comparison.
11. Required interoperability tests
- Publish canonical 612-byte vectors for suites 0x05 and 0x06, including password, salt, nonce, derived key, counter blocks, ciphertext, and CRC.
- Verify identical results across selected libraries on Windows, macOS, Linux, Android, and iPhone.
- Test multibyte UTF-8 passwords without normalization.
- Test POWN indexes 0, 1, 23, and 24 and the final 0x9 padding nibble.
- Test RAIDA indexes 0 and 24, denominations -8 through +11, and big-endian serial/task identifiers.
- Reject duplicate RAIDA IDs, wrong sizes, trailing bytes, bad CRCs, and unsupported suites.
- Verify that a wrong password still produces exactly 400 untrusted candidate bytes with no local password verdict.
- Verify fresh nonces for AN-only, POWN-only, and metadata-only rewrites.