Skip to content

Commit

Permalink
Merge pull request #11 from ABlockOfficial/docs_update
Browse files Browse the repository at this point in the history
Added diagrams to network wiki
  • Loading branch information
RobinP122 authored Feb 12, 2024
2 parents aade829 + 9cb9799 commit 6868d8c
Show file tree
Hide file tree
Showing 9 changed files with 766 additions and 8 deletions.
12 changes: 10 additions & 2 deletions docs/network-wiki/block-mining.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ The entire mining process requires the use of a single [UNiCORN](unicorns), gene

This UNiCORN is used for processes like Miner subset selection and Miner winner selection. The construction involves pruning input values to their hashes to save on storage costs.

![construction](./img/construction.svg)

## Process for a Single Block

Once a UNiCORN is constructed, the output is placed into a pseudo-random number generator (PRNG) as a seed to select a subset of the Miners who applied. This subset is the only group allowed to start mining the block. After a Miner finds a valid PoW, they submit it to the Mempool ring, storing all successful PoWs from participating Miners in a pending list.
Expand All @@ -37,8 +39,14 @@ When the round is considered closed, the winner is selected using the pre-calcul

## Parallel Pipeline for All Blocks

In practice, a more efficient parallel process is used where two blocks are mined simultaneously. The `previous_hash` field in the block header is crucial in this process, as it no longer points to the immediately preceding block. Instead, it's composed of values from two blocks previous to the preceding block (e.g., `t - 2` and `t - 3` instead of `t - 1`).
In practice, a more efficient parallel process is used where two blocks are mined simultaneously:

![pipeline](./img/pipeline.svg)

The `previous_hash` field in the block header is crucial in this process, as it no longer points to the immediately preceding block. Instead, it's composed of values from two blocks previous to the preceding block (e.g., `t - 2` and `t - 3` instead of `t - 1`).

This process is described in the diagram for block `n + 2`, where the `previous_hash` is composed of the previous hash of block `n - 1` and the hash of the entire block in `n`:

This process is described in the diagram for block `n + 2`, where the `previous_hash` is composed of the previous hash of block `n - 1` and the hash of the entire block in `n`.
![block](./img/block.svg)

Finally, after a winner is found and selected, the Mempool ring sends the block, along with the UNiCORN input values, to the Storage ring for storage.
92 changes: 92 additions & 0 deletions docs/network-wiki/img/block.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
134 changes: 134 additions & 0 deletions docs/network-wiki/img/construction.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 97 additions & 0 deletions docs/network-wiki/img/miner-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
97 changes: 97 additions & 0 deletions docs/network-wiki/img/miner.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
166 changes: 166 additions & 0 deletions docs/network-wiki/img/pipeline-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
166 changes: 166 additions & 0 deletions docs/network-wiki/img/pipeline.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/network-wiki/miner-node.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Fairness in block mining and Miner participation is ensured through the partitio

The partitioning system forms the foundation of the Mempool-Miner balance. Instead of all miners mining each round, a select few are chosen, conserving energy. Miners not chosen can attempt to participate in the next round. The network structure each round is illustrated in the diagram, where only miner nodes inside the orange space can mine for a specific Mempool node:

{/* Img */}
![miner](./img/miner.svg)

Each round, Miners can request to join a Mempool node's upcoming block mining. Each Mempool node has a limited number of miners in its partition. Once the partition limit is reached, the block can be sent for mining.

Expand Down
8 changes: 3 additions & 5 deletions docs/network-wiki/two-way-transaction.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,11 @@ Currently, Bitcoin payments reflect as "charity": Alice pays Bob 1 BTC for a mid

## How a 2WT Works

Bob has [game item], an awesome [item type] used in the game [game] which he wishes to sell through the ABlock blockchain:
Bob has a karambit, an rare knife skin used in the game Counter Strike which he wishes to sell through the ABlock blockchain. Alice decides to buy the in-game item. In the event that Alice pays Bob 100 ABC$ for the item skin, the following sequence occurs:

Alice is new to the game, but wants to get a leg up on the competition and so decides to buy the in-game item. In the event that Alice pays Bob 100 ABC$ for the axe, the following sequence occurs:
1. Alice creates a transaction that sends 100 ABC$ to Bob, and expects the encoding scheme for his karambit knife skin

1. Alice creates a transaction that sends 100 ABC$ to Bob, and expects the encoding scheme for his [item type]

2. Bob creates a transaction that sends the [item type] encoding scheme to Alice, and expects 100 ABC$ in return
2. Bob creates a transaction that sends the karambit knife skin encoding scheme to Alice, and expects 100 ABC$ in return

3. Alice and Bob exchange their respective halves of an identifier called a DRUID (Double Resolution Unique ID)

Expand Down

0 comments on commit 6868d8c

Please sign in to comment.