@@ -60,7 +60,7 @@ The 4 bytes of the version field must be interpreted as an unsigned integer enco
| log N | Algorithm | Encrypted data |
|:---------:|:-----------:|:---------------:|
| 1 byte | 1 byte | 64 bytes |
| 1 byte | 1 byte | Any bytes |
#### Algorithm
...
...
@@ -70,16 +70,10 @@ The 4 bytes of the version field must be interpreted as an unsigned integer enco
| [BIP32-Ed25519] | 0x01 |
| Unknown* | 0x02 |
* Future algorithms can be added to DEWIF v1 if their seed and public key are the same size.
*\* Future algorithms can be added to DEWIF v1.*
#### Encrypted data
| Seed | Public key |
|:-------------:|:-------------:|
| 32 bytes | 32 bytes |
The public key serves as a checksum. To check that the DEWIF base64 string is not corrupted, simply generate a keypair with the seed and check that the obtained public key matches.
**Symmetric encryption algorithm:** aes256
**AES256 key** = scrypt of user passphrase with the following parameters:
...
...
@@ -92,13 +86,21 @@ The public key serves as a checksum. To check that the DEWIF base64 string is no
|**r** |16 |
|**p** |1 |
##### Algorithm Ed25519
| Seed | Public key |
|:-------------:|:-------------:|
| 32 bytes | 32 bytes |
The public key serves as a checksum. To check that the DEWIF base64 string is not corrupted, simply generate a keypair with the seed and check that the obtained public key matches.
The padding is used so that the size of the encrypted data is a multiple of 16 (necessary for aes256).
Language code:
| Language code | Language |
|:--------------:|:-------------------:|
| 0 | English |
| 1 | Chinese simplified |
| 2 | Chinese traditional |
| 3 | French |
| 4 | Italian |
| 5 | Japanese |
| 6 | Korean |
| 7 | Spanish |
Mnemonic entropy is defined on [BIP39]
To check that the DEWIF base64 string is not corrupted, compute the hash sha256 of `Language code || Entropy length || Mnemonic entropy`. The first eight bytes of the sha256 hash constitute the checksum.