aboutsummaryrefslogtreecommitdiffstats
path: root/content/block_docs.md
diff options
context:
space:
mode:
authorYigit Sever2021-04-25 23:45:22 +0300
committerYigit Sever2021-04-25 23:45:22 +0300
commitfab0654942bd610c99999a6d193e0630d0cd6f98 (patch)
treeeb3a26c25ec68dbb316a4d0cc16a0a854c42a96f /content/block_docs.md
parent685ec6275109a9b2a1b1a6083c4b011fe8c5eeb6 (diff)
downloadgradecoin-site-fab0654942bd610c99999a6d193e0630d0cd6f98.tar.gz
gradecoin-site-fab0654942bd610c99999a6d193e0630d0cd6f98.tar.bz2
gradecoin-site-fab0654942bd610c99999a6d193e0630d0cd6f98.zip
Moving to nicenet
Diffstat (limited to 'content/block_docs.md')
-rw-r--r--content/block_docs.md33
1 files changed, 22 insertions, 11 deletions
diff --git a/content/block_docs.md b/content/block_docs.md
index 92880b6..05bf8ee 100644
--- a/content/block_docs.md
+++ b/content/block_docs.md
@@ -4,11 +4,19 @@ description = "Block Documentation"
4weight = 10 4weight = 10
5+++ 5+++
6 6
7A block that was proposed to commit Transactions in `transaction_list` to the 7> Blocks commit proposed transactions into the ledger.
8ledger with a nonce that made `hash` valid; 6 zeroes at the left hand side of the 8> A transaction that do not appear on a valid block is not accepted by the network.
9hash (24 bytes).
10 9
11We 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. 10Blocks in Gradecoin are proposed to commit [Transactions](@/transaction_docs.md) that were proposed previously to the system.
11`transaction_list` of the Block should be filled with valid transactions to be committed.
12Blocks are valid when they are proposed with a `nonce` that produces a `hash` value with 6 zeroes (24 bits) at the left hand side.
13
14We are _mining_ using [blake2s](https://www.blake2.net/) algorithm, which produces 256 bit hashes.
15Hash/second is roughly {{ exp(num="20x10", exponent="3") }} on my machine, a new block can be mined in around 4-6 minutes.
16
17{% tidbit() %}
18We have seen blocks that came in within a minute during the testnet phase!
19{% end %}
12 20
13# Requests 21# Requests
14 22
@@ -16,14 +24,13 @@ We are _mining_ using [blake2s](https://www.blake2.net/) algorithm, which produc
16A HTTP `GET` request to [/block](/block) endpoint will return the latest mined block. 24A HTTP `GET` request to [/block](/block) endpoint will return the latest mined block.
17 25
18## POST 26## POST
19 27A HTTP `POST` request with Authorization using [JWT](@/JWT.md) will allow you to propose your own blocks.
20A HTTP `POST` request with Authorization using JWT will allow you to propose your own blocks.
21 28
22# Fields 29# Fields
23``` 30```
24transaction_list: [array of Fingerprints] 31transaction_list: [array of Transaction IDs]
25nonce: unsigned 32-bit integer 32nonce: unsigned 32-bit integer
26timestamp: ISO 8601 <date>T<time> 33timestamp: ISO 8601 Timestamp (<date>T<time>)
27hash: String 34hash: String
28``` 35```
29 36
@@ -36,8 +43,12 @@ The _mining_ process for the hash involves;
36If the resulting hash is valid, then you can create a `Block` JSON object with the found `nonce` and `hash`. 43If the resulting hash is valid, then you can create a `Block` JSON object with the found `nonce` and `hash`.
37 44
38# Hash 45# Hash
46`tha` field in [jwt documentation](@/JWT.md) stands for "The Hash" in the context of blocks.
47Fill this with the `hash` value you found during the mining process.
39 48
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. 49# Block Rules
41 50- Blocks should include some minimum number of transactions.
51- Blocks cannot have duplicate transactions.
42 52
43[ISO 8601 Reference](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations) 53# References
54- [ISO 8601 Reference](https://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations)