diff options
author | Yigit Sever | 2021-04-17 20:11:28 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-17 20:11:28 +0300 |
commit | 69e26be0b379dbddb847dae57a8650c97b9d09c1 (patch) | |
tree | 8969930fb56d8781b869741ee9318eec354ff843 /site/content/block_docs.md | |
parent | 86eb4e6ca5f4ce8f86350c4fe66833b006317a50 (diff) | |
download | gradecoin-69e26be0b379dbddb847dae57a8650c97b9d09c1.tar.gz gradecoin-69e26be0b379dbddb847dae57a8650c97b9d09c1.tar.bz2 gradecoin-69e26be0b379dbddb847dae57a8650c97b9d09c1.zip |
Update docs
Diffstat (limited to 'site/content/block_docs.md')
-rw-r--r-- | site/content/block_docs.md | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/site/content/block_docs.md b/site/content/block_docs.md index bb1b44c..92880b6 100644 --- a/site/content/block_docs.md +++ b/site/content/block_docs.md | |||
@@ -8,7 +8,7 @@ A block that was proposed to commit Transactions in `transaction_list` to the | |||
8 | ledger with a nonce that made `hash` valid; 6 zeroes at the left hand side of the | 8 | ledger with a nonce that made `hash` valid; 6 zeroes at the left hand side of the |
9 | hash (24 bytes). | 9 | hash (24 bytes). |
10 | 10 | ||
11 | We are _mining_ using [blake2s](https://www.blake2.net/) algorithm, which produces 256 bit hashes. Hash/second is roughly 20x10^3 on my machine, a new block can be mined in around 4-6 minutes. | 11 | We are _mining_ using [blake2s](https://www.blake2.net/) algorithm, which produces 256 bit hashes. Hash/second is roughly {{ exp(num="20x10", exponent="3") }} on my machine, a new block can be mined in around 4-6 minutes. |
12 | 12 | ||
13 | # Requests | 13 | # Requests |
14 | 14 | ||
@@ -27,9 +27,17 @@ timestamp: ISO 8601 <date>T<time> | |||
27 | hash: String | 27 | hash: String |
28 | ``` | 28 | ``` |
29 | 29 | ||
30 | # Mining | ||
31 | The _mining_ process for the hash involves; | ||
32 | - Creating a temporary JSON object with `transaction_list`, `timestamp` and `nonce` values | ||
33 | - Serializing it | ||
34 | - Calculating blake2s hash of the serialized string | ||
35 | |||
36 | If the resulting hash is valid, then you can create a `Block` JSON object with the found `nonce` and `hash`. | ||
37 | |||
30 | # Hash | 38 | # Hash |
31 | 39 | ||
32 | ```tha``` field in [jwt documentation](/jwt) in fact stands for "The Hash", in the case of a post request for a block, you need to use hash field of the block. | 40 | ```tha``` field in [jwt documentation](/jwt) in fact stands for "The Hash", in the case of a post request for a block, you need to use hash field of the block. |
33 | 41 | ||
34 | 42 | ||
35 | [ISO 8601 Reference](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) | 43 | [ISO 8601 Reference](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) |