Skip to content
Snippets Groups Projects
Commit 92ad4876 authored by nanocryk's avatar nanocryk
Browse files

simplification

parent 985bfaa9
No related branches found
No related tags found
1 merge request!6WIP: RFC 5 : New Scalable Blockchain Protocol
This commit is part of merge request !6. Comments created here will be created in the context of that merge request.
...@@ -138,18 +138,11 @@ IdentityHash = SHA256(Username + CompactKey + Blockstamp) ...@@ -138,18 +138,11 @@ IdentityHash = SHA256(Username + CompactKey + Blockstamp)
## 2. General document format ## 2. General document format
Each document is composed of an header, a list of issuers, a payload and one or more signatures. Each document is composed of an header, a payload and one or more signatures.
The header is used for network propagation, but is ellided when written into a The tuple `(magic value, currency code, document type)` is used for network propagation,
block since they can be deduced from block data and context. but is ellided when written into a block since they can be deduced from block data and context.
The *header* and *payload* are then hashed to optain a **document ID**. The *header* and *payload* are hashed to optain a **document ID**, then *signatures* are made from it.
This *document ID* is unique and is used in *Merkle Trees*. This can allow many optimisations,
such as storing only the *Merkle Tree* and being able to prove a given document is included in
it or not. Then *signatures* are made on this **document ID**.
Since the *document ID* is not affected by *signatures*, they are not affected by *signature malleability*.
> See the block structure for more information about Merkle Trees usage.
The header is composed of : The header is composed of :
...@@ -158,16 +151,15 @@ The header is composed of : ...@@ -158,16 +151,15 @@ The header is composed of :
| *4 bytes* | Magic value : `0xDAE2D598` | *4 bytes* | Magic value : `0xDAE2D598`
| *2 bytes* | Currency code | *2 bytes* | Currency code
| *2 bytes* | Document type | *2 bytes* | Document type
| *2 bytes* | Payload size in bytes
| *2 bytes* | Number of issuers
| ... | Issuers *complete public keys* with alignement padding for each
> The magic value has been choosed randomly and contains data with low probability to find in UTF-8 text. > The magic value has been choosed randomly and contains data with low probability to find in UTF-8 text.
The issuer part is composed of : Payload and each signatures have alignement padding.
| Size | Data |
|:----:|:-----|
| *2 bytes* | Number of issuers
| ... | Issuers *complete public keys* with alignement padding for each
Signature cryptographic types are not defined and use the matching public key types. Signatures cryptographic types are not defined and use the matching public key types.
A document is valid if each public key can match a signature (with 0 bytes left and no overflows) A document is valid if each public key can match a signature (with 0 bytes left and no overflows)
and each signature is valid for the document content. and each signature is valid for the document content.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment