diff options
author | Yigit Sever | 2021-04-17 20:11:28 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-17 20:11:28 +0300 |
commit | 94ad41555fd7c6741337ccf2f11e0cdeaf4b74c8 (patch) | |
tree | cae94c3b6fcffb1a964cc192c54439fde1692380 /site/content | |
parent | d521561b3705bcbb5979a4ed9a768d2c9256df73 (diff) | |
download | gradecoin-94ad41555fd7c6741337ccf2f11e0cdeaf4b74c8.tar.gz gradecoin-94ad41555fd7c6741337ccf2f11e0cdeaf4b74c8.tar.bz2 gradecoin-94ad41555fd7c6741337ccf2f11e0cdeaf4b74c8.zip |
Update docs
Diffstat (limited to 'site/content')
-rw-r--r-- | site/content/_index.md | 11 | ||||
-rw-r--r-- | site/content/block_docs.md | 12 |
2 files changed, 20 insertions, 3 deletions
diff --git a/site/content/_index.md b/site/content/_index.md index 28700df..d0be673 100644 --- a/site/content/_index.md +++ b/site/content/_index.md | |||
@@ -57,14 +57,23 @@ Gradecoin uses 2048 bit RSA keypairs. | |||
57 | 57 | ||
58 | `Authorization`: The request header should have Bearer JWT.Token signed with Student Public Key | 58 | `Authorization`: The request header should have Bearer JWT.Token signed with Student Public Key |
59 | 59 | ||
60 | ## /user | ||
61 | - Meant to be used in the browser, you can see the current list of users and their balance here | ||
62 | |||
60 | # Questions | 63 | # Questions |
61 | ## This all sound complicated! | 64 | ## This all sound complicated! |
62 | - I've drawn inspiration from [actual Bitcoin transactions](https://explorer.bitcoin.com/btc) and [warp](https://github.com/seanmonstar/warp/blob/master/examples/todos.rs). The simplicity of the system is how little interfaces it has. | 65 | - I've drawn inspiration from [actual Bitcoin transactions](https://explorer.bitcoin.com/btc) and [warp](https://github.com/seanmonstar/warp/blob/master/examples/todos.rs). The simplicity of the system is how little interfaces it has. |
63 | - Don't know where to start? Gradecoin uses RESTful API; simple `curl` commands or even your browser will work! [This website can help as well](https://curl.trillworks.com/). | 66 | - Don't know where to start? Gradecoin uses RESTful API; simple `curl` commands or even your browser will work! [This website can help as well](https://curl.trillworks.com/). |
64 | - [JWT Debugger](https://jwt.io) and the corresponding [RFC](https://tools.ietf.org/html/rfc7519) | 67 | - [JWT Debugger](https://jwt.io) and the corresponding [RFC](https://tools.ietf.org/html/rfc7519). |
65 | - Remember that you are absolutely encouraged to grab off-the-shelf implementations for every cryptography primitive you will use. You can start by finding a code snippet to generate a RSA keypair? | 68 | - Remember that you are absolutely encouraged to grab off-the-shelf implementations for every cryptography primitive you will use. You can start by finding a code snippet to generate a RSA keypair? |
66 | - Check out [misc](@/misc_docs.md) for everything else you might be curious about. | 69 | - Check out [misc](@/misc_docs.md) for everything else you might be curious about. |
67 | 70 | ||
71 | ## How do you actually earn Gradecoin? | ||
72 | - Register yourself to at [/register](@/register_docs.md) | ||
73 | - Create transactions at [/transaction](@/transaction_docs.md) | ||
74 | - Create blocks to commit transactions at [/block](@/block_docs.md) | ||
75 | - See how everyone is doing and find people to trade with at [/user](/user) | ||
76 | |||
68 | ## I found a bug! | 77 | ## I found a bug! |
69 | Thank you! Please [let me know](mailto:yigit@ceng.metu.edu.tr) so we can solve it. | 78 | Thank you! Please [let me know](mailto:yigit@ceng.metu.edu.tr) so we can solve it. |
70 | 79 | ||
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) |