diff options
author | Yigit Sever | 2021-04-25 23:45:22 +0300 |
---|---|---|
committer | Yigit Sever | 2021-04-25 23:45:22 +0300 |
commit | fab0654942bd610c99999a6d193e0630d0cd6f98 (patch) | |
tree | eb3a26c25ec68dbb316a4d0cc16a0a854c42a96f /content/transaction_docs.md | |
parent | 685ec6275109a9b2a1b1a6083c4b011fe8c5eeb6 (diff) | |
download | gradecoin-site-fab0654942bd610c99999a6d193e0630d0cd6f98.tar.gz gradecoin-site-fab0654942bd610c99999a6d193e0630d0cd6f98.tar.bz2 gradecoin-site-fab0654942bd610c99999a6d193e0630d0cd6f98.zip |
Moving to nicenet
Diffstat (limited to 'content/transaction_docs.md')
-rw-r--r-- | content/transaction_docs.md | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/content/transaction_docs.md b/content/transaction_docs.md index 05c1534..f9e8947 100644 --- a/content/transaction_docs.md +++ b/content/transaction_docs.md | |||
@@ -7,17 +7,14 @@ weight = 6 | |||
7 | A transaction request between `source` and `target` to move `amount` Gradecoin. | 7 | A transaction request between `source` and `target` to move `amount` Gradecoin. |
8 | 8 | ||
9 | # Requests | 9 | # Requests |
10 | |||
11 | ## GET | 10 | ## GET |
12 | A HTTP `GET` request to [/transaction](/transaction) endpoint will return the current list of pending transactions. | 11 | A HTTP `GET` request to [/transaction](/transaction) endpoint will return the current list of pending transactions. |
13 | 12 | ||
14 | ## POST | 13 | ## POST |
15 | 14 | A HTTP `POST` request with Authorization using [JWT](@/JWT.md) to [/transaction](/transaction) will allow you to propose your own transactions. | |
16 | A HTTP `POST` request with Authorization using JWT to [/transaction](/transactions) will allow you to propose your own transactions. | ||
17 | 15 | ||
18 | # Fields | 16 | # Fields |
19 | ``` | 17 | ``` |
20 | by: Fingerprint | ||
21 | source: Fingerprint | 18 | source: Fingerprint |
22 | target: Fingerprint | 19 | target: Fingerprint |
23 | amount: unsigned 16 bit integer | 20 | amount: unsigned 16 bit integer |
@@ -25,28 +22,20 @@ timestamp: ISO 8601 <date>T<time> | |||
25 | ``` | 22 | ``` |
26 | 23 | ||
27 | # Hash | 24 | # Hash |
28 | 25 | `tha` field in [jwt documentation](@/JWT.md) in fact stands for "The Hash". | |
29 | `tha` field in [jwt documentation](@/JWT.md) in fact stands for "The Hash", in the case of a post request for a transaction, you need the Md5 hash of the serialized JSON representation of transaction. The resulting JSON string should look something like; | 26 | In the context of a transaction proposal, you need the [Md5](https://en.wikipedia.org/wiki/MD5) hash of the serialized JSON representation of transaction. |
27 | Serializing in this context is a simple JSON to string conversion with key, value pairs enclosed with quotation marks ("). | ||
28 | The resulting JSON string should look something like; | ||
30 | 29 | ||
31 | ``` | 30 | ``` |
32 | {"by":"foo","source":"bar","target":"baz","amount":2,"timestamp":"2021-04-18T21:49:00"} | 31 | {"source":"bar","target":"baz","amount":2,"timestamp":"2021-04-18T21:49:00"} |
33 | ``` | 32 | ``` |
34 | 33 | ||
35 | Or; without any whitespace, separated with `:` and `,`. | 34 | Or; without any whitespace, separated with `:` and `,`. |
36 | 35 | ||
37 | # Bank | 36 | # Transaction Rules |
38 | 37 | - Transactions should be sent from your account (`source`) to any other account (`target`). | |
39 | There is a `bank` account with Fingerprint `31415926535897932384626433832795028841971693993751058209749445923` | 38 | - Transactions generate traffic which is something we desperately need in Gradecoin, so for every transaction you send, some Gradecoin will be generated out of thin air and will appear on the target. |
40 | 39 | - Don't worry if your transaction goes unaccepted! Transactions do not disappear until they are committed into the ledger with a block. | |
41 | {% tidbit() %} | 40 | - Every transaction has a unique ID generated from the `source` and `target` fields. No two transaction with the same ID can appear on the pending transaction list [/transactions](/transaction) |
42 | First 64 digits of Pi | 41 | - Transactions have an upper amount limit. |
43 | {% end %} | ||
44 | |||
45 | This is the only account that will let you _withdraw_ from them. | ||
46 | |||
47 | ``` | ||
48 | by: this has to be your Fingerprint | ||
49 | source: this can be either you or the bank | ||
50 | target: this can be a valid fingerprint or yourself if source is the bank | ||
51 | ... | ||
52 | ``` | ||