From d3efdb1dc0485a57b22edd2490e2069b2a0bd4a1 Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Sun, 10 Jan 2021 11:21:24 +0100 Subject: [PATCH] [DEWIF] DEWIF is not a file format --- ..._Duniter_Encrypted_Wallet_Import_Format.md | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md b/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md index 6a07227..7a2a396 100644 --- a/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md +++ b/rfc/0013_Duniter_Encrypted_Wallet_Import_Format.md @@ -15,9 +15,13 @@ License: CC-SA A wallet is a pair of asymmetric keys (a public key + a private key). -The purpose of this RFC is to define a standard, inter-operable and secure file format for any DUBP wallet. +The purpose of this RFC is to define a standard, inter-operable and secure format for any [DUBP] wallet. -[DUBP](https://git.duniter.org/nodes/common/doc/blob/master/rfc/0010_Duniter_Blockchain_Protocol_V12.md) only deals with public keys and signatures. +This RFC does not define a file format, it is agnostic of the way the wallet is stored on the disk. + +## DUBP + +[DUBP] only deals with public keys and signatures. A public key is always paired with a private key, which DUBP will never deal with. @@ -27,11 +31,9 @@ So currently a public key for DUBP is to be understood as an Ed25519 public key. ## DEWIF format -DEWIF is an inter-operable and secure file format for any DUBP wallet. +DEWIF is an inter-operable and secure format for any DUBP wallet. -The official extension is `.dewif`. - -DEWIF format is a text file containing a single base64 string. +DEWIF format is a base64 string. This base64 string encodes a sequence of bytes whose structure is defined below. ## dewif bytes structure @@ -57,7 +59,7 @@ v1 data (encrypted): |:--------------:|:-------------------:| | seed bytes | public key bytes | -The public key serves as a checksum. To check that the `.dewif` file is not corrupted, simply generate an ed25519 keypair with the seed and check that the obtained public key matches. +The public key serves as a checksum. To check that the DEWIF base64 string is not corrupted, simply generate an ed25519 keypair with the seed and check that the obtained public key matches. Symmetric encryption algorithm : aes256 @@ -98,7 +100,7 @@ v2 data (encrypted): |:---------------:|:--------------------:|:---------------:|:--------------------:| | seed bytes | public key bytes | seed bytes | public key bytes | -The public key serves as a checksum. To check that the `.dewif` file is not corrupted, simply generate an ed25519 keypair with the seed and check that the obtained public key matches. +The public key serves as a checksum. To check that the DEWIF base64 string is not corrupted, simply generate an ed25519 keypair with the seed and check that the obtained public key matches. Symmetric encryption algorithm : aes256 @@ -124,7 +126,7 @@ Encrypted data : |:--------------:|:-------------------:| | seed bytes | public key bytes | -The public key serves as a checksum. To check that the `.dewif` file is not corrupted, simply generate an ed25519 keypair with the seed and check that the obtained public key matches. +The public key serves as a checksum. To check that the DEWIF base64 string is not corrupted, simply generate an ed25519 keypair with the seed and check that the obtained public key matches. Symmetric encryption algorithm : aes256 @@ -157,3 +159,5 @@ p: 1 DEWIF base 64 string (with aes key `"toto titi tata"`): `AAAAAxAAAAEPdMuBFXF4C6GZPGsJDiPBbacpVKeaLoJwkDsuqLjkwof1c760Z5iVpnZlLt5XEFlEehbdtLllVhccf9OK6Zjn8A==` + +[DUBP]: https://git.duniter.org/nodes/common/doc/blob/master/rfc/0010_Duniter_Blockchain_Protocol_V12.md -- GitLab