Skip to content

Rusk Wallet Data File

Matteo Ferretti edited this page Jul 10, 2023 · 1 revision

This document describes the binary encoding of the Rusk Wallet data file.

File format

  • Total size: 108 bytes
  • File Format Type: 0x02
Offset Value Description
0000000 Header The common header to all rusk binary files
0000012 Encrypted content 96 bytes encrypted using AES-256-CBC

Parsing and validation

  1. Parse and validate the 12 bytes of the header.
  2. If there aren't exactly 96 bytes left to read, throw an error.
  3. Read the next 96 bytes.
  4. Of those 96 bytes, take the fist 16 bytes as iv and the rest as encrypted_data
  5. Use AES-256-CBC to decrypt encrypted_data passing iv and a password hashed via SHA-256
  6. If the decryption fails, throw an error.
  7. The result are 65 bytes.
  8. Of those 65 bytes, take the first 64 as Seed.
  9. Take the 65th byte as the number of addresses generated by the wallet.