Mise à jour effectuée, merci de nous signaler tout dysfonctionnement ! | Upgrade done, please let us know about any dysfunction!

Commit 69eb9671 authored by Éloïs's avatar Éloïs
Browse files

[enh] add multi-sig algorithm

parent 2dda67cc
......@@ -142,6 +142,35 @@ bool : boolean stored on 8 bits (0x00 = false, 0x01 = true, any other value must
specific : Corresponds to a non-primitive type, which must be detailed in the RFC.
Blockstamp : BlockNumber(u32) + BlockHash([u8; 32]).
##### algorithm
| algorithm | code |
|:----------------------:|-------:|
| null* | 0x00 |
| Ed25519 | 0x01 |
| Schnorr | 0x02 |
##### Pubkey
Signatory's public key
| data name | size in bytes | data type |
|:----------------:|--------------:|-------------------:|
| pubkey_size | 2 | u16 |
| algorithm_id | 1 | algorithm |
| pubkey_content | pubkey_size | [u8; pubkey_size] |
pubkey_size := field size `pubkey_content` in bytes.
##### Signature
| data name | size in bytes | data type |
|:----------------:|--------------:|----------------:|
| sig_size | 2 | u16 |
| sig_content | sig_size | [u8; sig_size] |
sig_size := field size `sig_content` in bytes.
#### Endianness
All numbers (integers and floats) are encoded in big endian.
......@@ -155,13 +184,13 @@ All binary WS2P v2 messages are encapsulated in the following format :
| currency_code | 2 | u16 |
| ws2p_version | 2 | u16 |
| issuer_node_id | 4 | u32 |
| issuer_pubkey | 32 | [u8; 32] |
| issuer_pubkey | ? | Pubkey |
| message_type | 2 | specific |
| elements_count | 2 | u16 |
| payload_size | 4 | u32 |
| payload | payload_size | ?* |
| message_hash | 32 | [u8; 32] |
| signature | 64 | [u8; 64] |
| signature | ? | Signature |
_* The type of `payload` is determined by the content of `message_type`._
......@@ -319,10 +348,10 @@ Signed document declaring all the endpoints of a peer.
| endpoints_count | 1 | u8 |
| currency_code | 2 | u16 |
| node_id | 4 | u32 |
| issuer_public_key | 32 | [u8; 32] |
| issuer_public_key | 32 | Pubkey |
| blockstamp | 36 | Blockstamp |
| endpoints_datas | calculate* | [(u16, endpoint); endpoints_count] |
| signature | 64 | [u8; 64] |
| signature | 64 | Signature |
endpoints_datas := table of tuples (endpoint_size, endpoint).
......@@ -339,6 +368,7 @@ to sign the document it is necessary to calculate the hash sha256 of this bytes
"version": Number(VERSION),
"currency": Number(CURRENCY_CODE),
"node_id": String(NODE_ID in base16),
"algorithm": Number(ALGORITHM),
"pubkey": String(ISSUER_PUBLIC_KEY in base58),
"block": String(BLOCK_NUMBER ++ "-" ++ BLOCK_HASH in base16),
"endpoinds": Array([
......@@ -355,6 +385,7 @@ Example :
"version": 11,
"currency": 1,
"node_id": "15af24db",
"algorithm": 1,
"pubkey": "D9D2zaJoWYWveii1JRYLVK3J4Z7ZH3QczoKrnQeiM6mx"
"block": "128310-000002A569DCEED62227CAC0ABDFE6B2647B21B3193A40398CD12BC2A95C24D9",
"endpoinds": [
......@@ -460,7 +491,7 @@ RES_SYNC_CHUNK := A WS2P Public node that asks to synchronize sends its PeerCard
| data name | size in bytes | data type |
|:-------------:|---------------|-----------|
| challenge_sig | 64 | [u8; 64] |
| challenge_sig | ? | Signature |
Each node must sign the challenge of the other to prove that it's in possession of the private key corresponding to the public key under which it identifies.
challenge_sig := Signature of the challenge given by the other node.
......@@ -471,8 +502,8 @@ challenge_sig := Signature of the challenge given by the other node.
|:-------------:|---------------|-----------------|
| flags_size | 1 | u8 |
| flags | flags_size | WS2PSecretFlags |
| member_proof | 64 | [u8; 64] |
| member_pubkey | 32 | [u8; 32] |
| member_proof | ? | Signature |
| member_pubkey | ? | Pubkey |
#### WS2PSecretFlags type definition
......@@ -494,7 +525,7 @@ If this boolean is true, the "member_proof" must contain a signature must sign t
| flags | 2 | b16 |
| prefix | 2 | u16 |
| issuer_node_id | 4 | u32 |
| m_pubkey | 32 | [u8; 32] |
| m_pubkey | 32 | Pubkey |
| challenge* | 32 | [u8; 32] |
_*This is the remote challenge for the signatory, and the local challenge for the verifier._
......@@ -605,11 +636,13 @@ _*This is part of the specificities of WS2P requests in binary format, which wil
#### SYNC_CHUNK and CHUNK responses
| data name | size in bytes | data type |
|:------------:|---------------|---------------|
| request_id | 4 | u32 |
| blocks_count | 2 | u16 |
| blocks | ? | BlockDocument |
| data name | size in bytes | data type |
|:------------:|---------------|----------------------|
| request_id | 4 | u32 |
| blocks_count | 2 | u16 |
| blocks | ? | (u16, BlockDocument) |
blocks := table of tuples (block_size, block_content)
#### WOT_POOL responses
......@@ -617,9 +650,12 @@ _*This is part of the specificities of WS2P requests in binary format, which wil
|:-------------:|---------------|---------------------|
| request_id | 4 | u32 |
| certs_count | 2 | u16 |
| certs | 108 | CompactPoolIntCert |
| certs_size | 2 | u16 |
| certs | certs_size | CompactPoolIntCert |
| folders_count | 4 | u32 |
| folders | ? | PendingIdtyFolder |
| folders | ?* | PendingIdtyFolder |
_*The total payload size of any WS2P message is indicated in the metadata, field `folders` being the only one of unknown size, its size is deduced by calculation._
CompactPoolIntCert type description :
......@@ -628,37 +664,40 @@ CompactPoolIntCert type description :
| issuer* | 4 | u32 |
| target* | 4 | u32 |
| blockstamp | 36 | Blockstamp |
| signature | 64 | [u8; 64] |
| signature | ? | Signature |
_*Duniter-Rust assigns a unique integer to each member according to the order in which the identities are declared in the blocks, so it's guaranteed that all Duniter-Rust nodes will always assign the same integer to any given member._
_*Durs assigns a unique integer to each member according to the order in which the identities are declared in the blocks, so it's guaranteed that all Durs nodes will always assign the same integer to any given member._
PendingIdtyFolder type description :
| data name | size in bytes | data type |
|:-------------:|-----------------|-----------------------|
| uid_size | 1 | u8 |
| certs_count | 1 | u8 |
| identity | 132+uidsize | IdentityDocument |
| membership | 100 | CompactPoolMembership |
| certs | 104*certs_count | CompactPoolExtCert |
| data name | size in bytes | data type |
|:---------------:|-----------------|-----------------------|
| folder_size | 4 | u32 |
| certs_count | 1 | u8 |
| identity | ? | IdentityDocument |
| membership | ? | CompactPoolMembership |
| certs | ? | CompactPoolExtCert |
uid_size := `identity.username` field size in bytes. So the folder size is equal to : `234 + uidsize + (104*certs_count)`.
folder_size := Total size of object `PendingIdtyFolder` in bytes (field `folder_size` excluded).
IdentityDocument type description :
| data name | size in bytes | data type |
|:-------------:|---------------|---------------------|
| uid_size | 1 | u8 |
| uid | uid_size | utf8 |
| blockstamp | 36 | Blockstamp |
| pubkey | 32 | [u8;32] |
| signature | 64 | [u8; 64] |
| signature | ? | Signature |
uid_size := `uid` field size in bytes.
CompactPoolMembership type description :
| data name | size in bytes | data type |
|:-------------:|---------------|---------------------|
| blockstamp | 36 | Blockstamp |
| signature | 64 | [u8; 64] |
| signature | ? | Signature |
CompactPoolExtCert type description :
......@@ -666,7 +705,7 @@ CompactPoolExtCert type description :
|:-----------------:|---------------|---------------------|
| issuer | 4 | u32 |
| blockstamp | 36 | Blockstamp |
| signature | 64 | [u8; 64] |
| signature | ? | Signature |
### HEADS v2
......@@ -679,6 +718,7 @@ CompactPoolExtCert type description :
| data name | size in bytes | data type |
|:------------------:|-------------------|------------|
| head_size | 2 | u16 |
| software_size | 1 | u8 |
| soft_version_size | 1 | u8 |
| step | 1 | u8 |
......@@ -687,13 +727,13 @@ CompactPoolExtCert type description :
| free_mirror_rooms | 1 | u8 |
| low_priority_rooms | 1 | u8 |
| node_id | 4 | u32 |
| pubkey | 32 | [u8;32] |
| pubkey | ? | Pubkey |
| blockstamp | 36 | Blockstamp |
| software_name | software_size | utf8 |
| soft_version | soft_version_size | utf8 |
| signature | 64 | [u8;64] |
| signature | ? | Signature |
_head_size = 142 + soft_version_size + software_size._
head_size := Total size of object `HEADv3` in bytes.
software_size := Field size `software_name` in number of bytes.
......@@ -725,11 +765,12 @@ step := Number of head rebounds (unsigned field).
"free_mirror_rooms": Number,
"low_priority_rooms": Number,
"node_id": Number,
"pubkey": String(pubkey in base58),
"algorithm": Number(pubkey.algorithm)
"pubkey": String(pubkey.pubkey_content in base58),
"blockstamp": String(BlockId-BlockHash in base16),
"software_name": String,
"software_version": String,
"signature": String(signature in base64),
"signature": String(signature.sig_content in base64),
}
#### api_outgoing_conf interpretation
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment