From c069ef33f62e4aa8457c52b99b11d056310a7d34 Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Sat, 24 Apr 2021 23:53:34 +0200 Subject: [PATCH] [DEWIF] fill examples with real data --- rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md b/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md index 1008547..ecbf966 100644 --- a/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md +++ b/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md @@ -126,7 +126,7 @@ The public key serves as a checksum. To check that the DEWIF base64 string is no DEWIF base 64 string (with xor key `"toto titi tata"`): -`???` +`AAAAARAAAAEMALUJm4gAYvodNzw/CPBV4Pckm+pv1taVmMdXpbthi9YyDSu9ioexcFO1YJpKPKATZR5IMBpeOOnZkzhTb3k2SYo=` ##### Algorithm Bip32-Ed25519 @@ -152,6 +152,7 @@ The entropy is stored in 32 bytes to avoid revealing the size of the stored mnem If the entropy of the mnemonic is less than 32 bytes, the extra bytes are ignored (they can have any value). 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. +WARNING: Only the "useful" part of the entropy is used to calculate the checksum, the extra bytes are ignored. **Example 2:** @@ -168,8 +169,9 @@ To check that the DEWIF base64 string is not corrupted, compute the hash sha256 0x01 # Algorithm Bip32-Ed25519 0x00 # Language english 0x10 # Entropy length -0x33E46BB13A746EA41CDDE45C90846A7900000000000000000000000000000000 # Mnemonic entropy -0x???? # checksum +0x33E46BB13A746EA41CDDE45C90846A79 # Mnemonic entropy +0x 00000000000000000000000000000000 # Mnemonic entropy padding +0xa058ad20f43a5aa2 # checksum (SHA256 of 0x001033E46BB13A746EA41CDDE45C90846A79) ``` **XOR key generated from scrypt with the following parameters:** @@ -179,11 +181,11 @@ To check that the DEWIF base64 string is not corrupted, compute the hash sha256 | **N** | `2^14 = 16384` | | **r** | 16 | | **p** | 1 | -| **dkLen** | 64 | +| **dkLen** | 42 | DEWIF base 64 string (with xor key `"toto titi tata"`): -`???` +`AAAAARAAAAEOAVdFrhPxVIhaRvWaM7vMCKg3C8Tvpn66v+z/7frzCONBABhrDBygESqnEg==` [BIP32-Ed25519]: https://drive.google.com/file/d/0ByMtMw2hul0EMFJuNnZORDR2NDA/view [BIP39]: https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki#generating-the-mnemonic -- GitLab