diff --git a/README.md b/README.md index 590b98b..ed1edd1 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ The remainder of this document contains a high-level overview of the Spacemesh p - Transactions (coming soon) - Sync (coming soon) - P2P Networking (coming soon) -- Data structures (coming soon) +- [Data structures](datastructures/01-overview.md) ### Hare Protocol - [Spec](/hare/README.md) @@ -133,6 +133,8 @@ The basic building blocks of the Spacemesh protocol, and the overall, canonical Other relevant data structures include the various types of proof produced and submitted by miners and other services ([PoET](mining/03-poet.md), [ATX](mining/05-atx.md)), and vote messages exchanged as part of the [Hare protocol](consensus/01-overview.md#hare). +See [data structures](datastructures/01-overview.md) for more information. + ## Learn More The documents contained in this repository are intended to provide a high-level, developer-centric overview of the Spacemesh protocol and the various infrastructure that implements the protocol. For additional resources, see the following: diff --git a/datastructures/01-overview.md b/datastructures/01-overview.md new file mode 100644 index 0000000..c2b32fd --- /dev/null +++ b/datastructures/01-overview.md @@ -0,0 +1,23 @@ +# Data structures + +This document lays out the various top-level data structures that are used throughout the Spacemesh protocol, with details on their contents and how they're linked. + +## Mesh + +The mesh is the set of all layers. + +## Layer + +A layer is defined as a set of blocks. + +## Block + +A block contains a set of transactions. It may be syntactically or contextually valid or invalid. It also contains a pointer to an ATX that establishes the eligibility of the miner to produce the block in the layer. + +## Transaction + +## ATX + +## P2P Messages + +Each message is signed using the sender's public key. In addition to the message data itself (the payload), it includes a protocol, a client version, a timestamp, the public key of the message originator, a network ID, whether the message is a request or a response, the request ID, and the type of message in the specified protocol. All messages are serialized on the wire using [the XDR standard](https://en.wikipedia.org/wiki/External_Data_Representation). diff --git a/mining/05-atx.md b/mining/05-atx.md index ba4f69d..90e9d5d 100644 --- a/mining/05-atx.md +++ b/mining/05-atx.md @@ -25,7 +25,7 @@ In addition to the full NIPoST attested to by the ATX, the ATX also contains fie ## Validity -Every valid block [LINK forthcoming] contains a pointer to a valid ATX that authorizes the miner in question to produce a block in the epoch and layer where the block was produced. In order to determine whether a given block is valid, a miner first fetches the ATX that the block points to, and validates that ATX. The ATX is considered valid if it has a valid signature from the miner, if no duplicate ATX was published, if the NIPoST it contains is valid, and if the time indicated by the ATX matches the duration attested to by the NIPoST. These validation rules prevent a dishonest miner from pre-generating ATXs for multiple identities, reusing the same storage space, and publishing them all in a single future epoch. See [the full protocol specifications](https://spacemesh.io/spacemesh-protocol-v1-0/) for a full elaboration of the validation rules for an ATX. +Every valid [block](../datastructures/01-overview.md) contains a pointer to a valid ATX that authorizes the miner in question to produce a block in the epoch and layer where the block was produced. In order to determine whether a given block is valid, a miner first fetches the ATX that the block points to, and validates that ATX. The ATX is considered valid if it has a valid signature from the miner, if no duplicate ATX was published, if the NIPoST it contains is valid, and if the time indicated by the ATX matches the duration attested to by the NIPoST. These validation rules prevent a dishonest miner from pre-generating ATXs for multiple identities, reusing the same storage space, and publishing them all in a single future epoch. See [the full protocol specifications](https://spacemesh.io/spacemesh-protocol-v1-0/) for a full elaboration of the validation rules for an ATX. ## Conclusion