A block that was proposed to commit Transactions in transaction_list
to the
ledger with a nonce that made hash
valid; 6 zeroes at the left hand side of the
hash (24 bytes).
We are mining using blake2s algorithm, which produces 256 bit hashes. Hash/second is roughly 20x103 on my machine, a new block can be mined in around 4-6 minutes.
Requests
GET
A HTTP GET
request to /block endpoint will return the latest mined block.
POST
A HTTP POST
request with Authorization using JWT will allow you to propose your own blocks.
Fields
transaction_list: [array of Fingerprints]
nonce: unsigned 32-bit integer
timestamp: ISO 8601 <date>T<time>
hash: String
Mining
The mining process for the hash involves;
- Creating a temporary JSON object with
transaction_list
,timestamp
andnonce
values - Serializing it
- Calculating blake2s hash of the serialized string
If the resulting hash is valid, then you can create a Block
JSON object with the found nonce
and hash
.
Hash
tha
field in jwt documentation 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.