Skip to content
Snippets Groups Projects
Commit 97ca287a authored by nanocryk's avatar nanocryk
Browse files

Replaced "ancestor hash" by a "nonce" to allow "partial transactions"

parent 82cc1d87
No related branches found
No related tags found
1 merge request!6WIP: RFC 5 : New Scalable Blockchain Protocol
......@@ -147,8 +147,8 @@ A token stores its creation date, token class hash, a payload and its scripts.
| Size | Description
|:----:|:---
| 32 | Hash of the token class
| 32 | Ancestor hash (filled with zeros at creation)
| 8 | Creation timestamp (filled with zeros at creation)
| 2 | Nonce
| |
| 2 | Storage size (in items)
| |
......@@ -159,6 +159,9 @@ A token stores its creation date, token class hash, a payload and its scripts.
> The `TokenClass` token class can't be defined by a `TokenClass`, so its token class hash is
> filled with zeros, and its class scripts are defined in the protocol.
> The nonce is important when multiple identical tokens are created by the same transaction, as
> without a nonce they would have the same hash. **A transaction is invalid if multiple created tokens
> have the same hash.**
Each storage item is a byte array stored as
......@@ -186,7 +189,7 @@ From each token we can compute it **execution context** :
| Size | Description
|:----:|:---
| 32 | Token hash (Transaction output index for new tokens since they don't have a hash yet)
| 32 | Token hash
| 1 | `0x00` for creation, `0x01` for reading, `0x02` for consumption
| 2 | Class script parameters storage size (in items)
| 2 | Instance script parameters storage size (in items)
......@@ -236,9 +239,6 @@ A transaction document is structured as
> documents which will be completed afterward without calculating new signatures, or even allow
> multiple issuers to create "partial transactions" that will only be valid when combined.
The "Ancestor hash" of a new token is computed as `SHA256(TransactionHash ++ ExecutionFootprint)`,
where `TransactionHash` is the hash of whole document above.
### 2.3. Token proofs of existence
Tokens are stored in a [Merkle tree] to remove the need for nodes to store the complete set of tokens.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment