Skip to content

Add documentation for network ID and amounts #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 8 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
- [Transactions](./aleo/concepts/03_transactions.md)
- [Blocks](./aleo/concepts/04_blocks.md)
- [Consensus](./aleo/concepts/05_consensus.md)
- [Glossary](./aleo/concepts/06_glossary.md)
- [Aleo Credits](./aleo/concepts/06_credits.md)
- [Glossary](./aleo/concepts/07_glossary.md)


## Developer Preview I
Expand Down Expand Up @@ -101,6 +102,7 @@

- [Testnet I.](./testnet/getting_started/00_overview.md)
- [Install snarkOS](./testnet/getting_started/01_installation.md)
- [Aleo networks](./testnet/getting_started/02_networks.md)


### Chapter 9: Concepts
Expand Down
8 changes: 4 additions & 4 deletions documentation/aleo/concepts/02_records.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,30 +54,30 @@ The **record payload** is a that encodes arbitrary application information.
692575f93ebd4c58e9e6ed288d7ef2328623a8e391224b3cf24c1e65d4f0660ed5d14b78f84a259f14cb24a91fd58386
```

The **birth program ID** corresponds to the [birth program](06_glossary.md#birth-program) that must be satisfied when the record is created.
The **birth program ID** corresponds to the [birth program](07_glossary.md#birth-program) that must be satisfied when the record is created.

### Death Program ID

```
9cb1c71986e72e36640b7fbe09d1853a37bdcbc19a406526a80e54ce37b5c1dd5d14b78f84a259f14cb24746a7fe8b01
```

The **death program ID** corresponds to the [death program](06_glossary.md#death-program) that must be specified when the record is spent.
The **death program ID** corresponds to the [death program](07_glossary.md#death-program) that must be specified when the record is spent.

### Serial Number Nonce

```
c8d81ac0028a5643449a80c3cdf8e8f9593ca5e6bcf103b3c33606b01ea20108
```

The **serial number nonce** is used to generate a record [record serial number](06_glossary.md#record-serial-number) when the record is being spent.
The **serial number nonce** is used to generate a record [record serial number](07_glossary.md#record-serial-number) when the record is being spent.

### Commitment Randomness

```
5acbd2c0475c7b4afa72173d7ed800edfc1bde235f5cf4e6c09ef70a36a48a09
```
The **commitment randomness** used to generate the [record commitment](06_glossary.md#record-commitment).
The **commitment randomness** used to generate the [record commitment](07_glossary.md#record-commitment).

## Advanced Topics

Expand Down
8 changes: 4 additions & 4 deletions documentation/aleo/concepts/03_transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ An Aleo transaction is serialized in the following format:
e8a82df9d2e92758f50e52832a0b635718c253ce60962e993afebca9a726de91]
```

The **old serial numbers** are the [serial numbers](06_glossary.md#record-serial-number) for corresponding records
The **old serial numbers** are the [serial numbers](07_glossary.md#record-serial-number) for corresponding records
that were consumed by the transaction.

### New Commitments
Expand All @@ -41,7 +41,7 @@ that were consumed by the transaction.
2854be536b8ba0feafd10ae0725c1f920aec6b18740607321660b872feac4700]
```

The **new commitments** are the [commitments](06_glossary.md#record-commitment) for corresponding records that were produced by the transaction.
The **new commitments** are the [commitments](07_glossary.md#record-commitment) for corresponding records that were produced by the transaction.

### Program Commitment

Expand Down Expand Up @@ -91,7 +91,7 @@ The **network ID** indicates the network that the transaction is included in. Fo
5b74266ae4566ca630c0ce2df1b9bec84c788c6635a40f80e1761dc1bfb0c600f720ea0c6d5e9b8a579e6f00ad6ccfdf916b96b1189c1ff470bfb77d10513703]
```

The [randomized signatures](06_glossary.md#randomized-signature) used by the record spenders to allow for authorized delegation of transaction generation.
The [randomized signatures](07_glossary.md#randomized-signature) used by the record spenders to allow for authorized delegation of transaction generation.

### Ledger Digest

Expand Down Expand Up @@ -129,7 +129,7 @@ The steps to create a transaction are as follows:
3. Generate the program commitment
4. Generate the local data commitment
5. Generate the transaction signatures
6. Generate the ledger digest and [ledger membership witnesses](06_glossary.md#ledger-membership-witness) for the input record commitments
6. Generate the ledger digest and [ledger membership witnesses](07_glossary.md#ledger-membership-witness) for the input record commitments
7. Generate the inner SNARK proof
8. Generate the program SNARK proofs
9. Generate the transaction proof
Expand Down
2 changes: 1 addition & 1 deletion documentation/aleo/concepts/04_blocks.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ An Aleo block is serialized in the following format:
| Parameter | Type | Size (bytes) |
|:----------------:|:------------------------------------------------------------------:|:------------:|
| `header` | [Block Header](#components-of-a-block-header) | 503 |
|`num_transactions`| [variable_length_integer](06_glossary.md#variable-length-integer) | `variable` |
|`num_transactions`| [variable_length_integer](07_glossary.md#variable-length-integer) | `variable` |
| `transactions` | \[[Transaction](03_transactions.md#components-of-a-transaction)\] | `variable` |

#### Block Header
Expand Down
10 changes: 10 additions & 0 deletions documentation/aleo/concepts/05_consensus.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,16 @@ proofs per second that miners on Aleo contribute.
A block reward is the total amount of Aleo credits rewarded to the address that mined a block.
This value is the base block reward in addition to the fees paid by all transactions included in the block.

| Block Number | Reward |
|:---------------------:|:---------:|
| 0 - 3,503,999 | 150 ALEO |
| 3,504,000 - 7,007,999 | 75 ALEO |
| 7,008,000 - ∞ | 37.5 ALEO |

Initially, each Aleo block reward is worth 150 Aleo credits. This block reward is halved after every 3,504,000 blocks, which
is approximately four years at an estimated 100 blocks per hour. After two iterations of halving the block reward, it will
remain at 37.5 for perpetuity.

### Block Difficulty and Block Times

The block time is the amount of time it takes for the network to produce a valid block.
Expand Down
27 changes: 27 additions & 0 deletions documentation/aleo/concepts/06_credits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
id: credits
title: Aleo Credits
---

Aleo credits are the currency used within Aleo.

Aleo credits are stored and transferred through [records](02_records.md) via transactions.
Additionally, because all transactions on Aleo are fully private by default,
the ownership and amounts of Aleo credits being transferred is never revealed to the network.

### Denominations

Aleo credits are divisible down to 6 decimal places of precision. The two denominations are Bytes and Gates, which
represent a millionth and a thousandth of an ALEO, respectively.

Below is a list of the named denominations and their value in ALEO.

| Denomination | Abbreviation | Value in ALEO |
|:------------:|:------------:|:-------------:|
| Byte | AB | 0.000001 ALEO |
| Gate | AG | 0.001 ALEO |
| Aleo | ALEO | 1 ALEO |


There is no limit to the amount of Aleo credits in the network, but the total circulating supply is
dictated by [block rewards](05_consensus.md#block-rewards).
4 changes: 3 additions & 1 deletion documentation/aleo/getting_started/00_overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ to compile, execute, and finalize its state autonomously.
- [Transactions](./aleo/concepts/03_transactions.md)
- [Blocks](./aleo/concepts/04_blocks.md)
- [Consensus](./aleo/concepts/05_consensus.md)
- [Glossary](./aleo/concepts/06_glossary.md)
- [Aleo Credits](./aleo/concepts/06_credits.md)
- [Glossary](./aleo/concepts/07_glossary.md)


## Developer Preview I
Expand Down Expand Up @@ -108,6 +109,7 @@ to compile, execute, and finalize its state autonomously.

- [Testnet I.](./testnet/getting_started/00_overview.md)
- [Install snarkOS](./testnet/getting_started/01_installation.md)
- [Aleo networks](./testnet/getting_started/02_networks.md)


### Chapter 9: Concepts
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ to compile, execute, and finalize its state autonomously.
- [Transactions](./aleo/concepts/03_transactions.md)
- [Blocks](./aleo/concepts/04_blocks.md)
- [Consensus](./aleo/concepts/05_consensus.md)
- [Glossary](./aleo/concepts/06_glossary.md)
- [Aleo Credits](./aleo/concepts/06_credits.md)
- [Glossary](./aleo/concepts/07_glossary.md)


## Developer Preview I
Expand Down Expand Up @@ -108,6 +109,7 @@ to compile, execute, and finalize its state autonomously.

- [Testnet I.](./testnet/getting_started/00_overview.md)
- [Install snarkOS](./testnet/getting_started/01_installation.md)
- [Aleo networks](./testnet/getting_started/02_networks.md)


### Chapter 9: Concepts
Expand Down
4 changes: 2 additions & 2 deletions documentation/developer/programming_model/00_model.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This section assumes that you have knowledge of [records](../../aleo/concepts/02

## Leo Record Runtime

Each Leo `.leo` file is compiled into [program](../../aleo/concepts/06_glossary.md#program).
Each Leo `.leo` file is compiled into [program](../../aleo/concepts/07_glossary.md#program).
Each program lives in a [record](../../aleo/concepts/02_records.md). Each record lives in a [transaction](../../aleo/concepts/03_transactions.md).
An Aleo transaction spends two old records: `old_record_0`, `old_record_1` and creates two new records: `new_record_0`, `new_record_1`.

Expand Down Expand Up @@ -36,7 +36,7 @@ To ensure the accuracy of input and output register state, a hash of each is sto
## Committing to Register Data.

Register values are hashed and included in the [local data commitment](../../aleo/concepts/03_transactions.md#local-data-commitment).
The Leo runtime calculates the [record commitment](../../aleo/concepts/06_glossary.md#record-commitment) as well as
The Leo runtime calculates the [record commitment](../../aleo/concepts/07_glossary.md#record-commitment) as well as
the local data commitment to ensure that all record data is included in the [local data root](../../aleo/concepts/03_transactions.md#ledger-digest).

## `.in` and `.out` files
Expand Down
4 changes: 2 additions & 2 deletions documentation/developer/programming_model/01_token.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ The updated [execute](00_model.md#registers) for our example:

`old_record_0` contains a token value balance that is transferred entirely into the `new_record_0`.

* `token_debit` is the [death program](../../aleo/concepts/06_glossary.md#death-program) of `old_record_0`.
* `token_credit` is the [birth program](../../aleo/concepts/06_glossary.md#birth-program) of `new_record_0`.
* `token_debit` is the [death program](../../aleo/concepts/07_glossary.md#death-program) of `old_record_0`.
* `token_credit` is the [birth program](../../aleo/concepts/07_glossary.md#birth-program) of `new_record_0`.

After `old_record_0` dies, `token_debit` outputs the token id and token value balance `(token_id, value_balance)` being transferred to `new_record_0`.

Expand Down
1 change: 1 addition & 0 deletions documentation/testnet/getting_started/01_installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ OPTIONS:
--min-peers <min-peers> Specify the minimum number of peers the node should connect to
--miner-address <miner-address> Specify the address that will receive miner rewards
--network <network-id> Specify the network id (default = 1) of the node

-d, --path <path> Specify the node's storage path
-p, --port <port> Specify the port the node is run on
--rpc-password <rpc-password> Specify a password for rpc authentication
Expand Down
29 changes: 29 additions & 0 deletions documentation/testnet/getting_started/02_networks.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
---
id: networks
title: Aleo networks
sidebar_label: Networks
---

Aleo networks are delineated by a network identifier. Each network has a unique network ID that enforces
transactions are only valid in the context of their respective networks.

Each testnet is an alternative ledger meant only for testing and designing protocols to be included
in the Aleo mainnet. The Aleo credits on each testnet is not meant to hold any value, which allows
developers to safely test circuits and experimental features.


### Network IDs

Currently, Aleo has reserved the use of network id 0 for **Aleo Mainnet** and 1 for the **Aleo Testnet I**:

| Network ID | Name |
|:----------:|:--------------:|
| 0 | Aleo Mainnet |
| 1 | Aleo Testnet I |


### Ports

By default a snarkOS node is exposed at port `4130` + their network ID. For example, mainnet nodes are exposed at
port `4130`, testnet 1 nodes are exposed at port `4131`, and so forth. The uniqueness of ports is an additional safeguard
for node operators to connect to nodes on their particular network and run multiple networks on the same IP.