You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/fundamentals/accounts.md
+27-4Lines changed: 27 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,8 @@ tags:
11
11
12
12
In Parallelchain Mainnet, accounts are divided into two types:
13
13
14
-
-__Externally Owned Accounts (EOA)__: The address of an EOA is the public key of the keypair that is compatible with `ed25519_dalek`.
15
-
-__Contract Accounts__: A contract account is created from contract deployment. The address is the hash of the concatenation of a contract's bytecode and the nonce of the EOA that deploys the contract.
14
+
-__Externally Owned Accounts (EOA)__: The address of an EOA is the public key of the keypair that is compatible with [ed25519-dalek](https://github.com/dalek-cryptography/curve25519-dalek/).
15
+
-__Contract Accounts__: A contract account is created from contract deployment. The address is the [SHA256](https://en.wikipedia.org/wiki/SHA-2)hash of the concatenation of a contract's bytecode and the nonce of the **EOA** that deploys the contract.
16
16
17
17
Elements inside an account include:
18
18
@@ -25,10 +25,33 @@ The followings are elements that only apply to Contract Accounts:
25
25
-**CBI Version**: The version of the Contract Binary Interface.
26
26
-**Storage Hash**: The 32-byte SHA256 root hash of its Storage Trie. This is empty for an External.
27
27
28
+
## How Account Works
29
+
30
+
You can create **EOA** account by **ed25519-dalek** key generation algorithm. The account is composed of a 32-byte public key and a 32-byte private key. This public key is the **Address** which can be known to others. While your private key, which is used for signing [transactions](transactions.md), **MUST** be kept in secret.
31
+
32
+
Address is usually displayed in [Base64url](https://datatracker.ietf.org/doc/html/rfc4648#section-5) format in ParallelChain Mainnet ecosystem. Here is an example:
33
+
34
+
```text
35
+
Tc0bU2oS0A0_GrjPKsDLSyVa3gc7PvzwWIAGRk-_SmA
36
+
```
37
+
38
+
If you want to transfer [XPLL](../introduction.md#what-is-xpll) to Alice's account, first you need to know her address. Then, you create a transaction with Alice's address as [recipient](transactions.md#account-commands), and sign it by using your private key. The **Balance** of your and Alice's account will be updated when this signed transaction is made to blockchain successfully. The **Nonce** of your account will be increased by 1.
39
+
40
+
On the other hand, a **Contract Account** is not made up of cryptographic keys. Its address is a 32-byte hash. It is not able to sign a transaction. But similar to **EOA**, it has its own balance, and can receive XPLL from other accounts. See [Smart Contract](../for_developers/smart_contracts/introduction.md) for details.
41
+
28
42
!!! Note
29
-
These accounts cannot be distinguished from each other just by looking at the address format.
43
+
The type of account cannot be distinguished from each other just by looking at the address format.
44
+
45
+
See also:
46
+
47
+
-[Create Account by CLI](../for_users/pchain_client_cli/manage_account.md)
48
+
-[Create Account by Web Wallet](../for_users/web_wallet/create_account.md)
49
+
-[Create Account by Xperience Browser Extension](../for_users/xperience_browser_extension/create_account.md)
50
+
51
+
52
+
## Network Account
30
53
31
-
A **Network Account** is a single identified network-wide account that maintains the state of ParallelChain Mainnet. This account is not associated with Ed25519 material. The network-significant data that the Network Account stores are composed of various fields:
54
+
A **Network Account** is a single identified network-wide account that maintains the [state](nodes.md#world-state) of ParallelChain Mainnet. The purpose of this state is to implement the [staking](staking.md) related protocol. This account is not associated with Ed25519 material. The network-significant data that the Network Account stores are composed of various fields:
32
55
33
56
-**Previous Validator Set**: The set of pools that form the validator set in the previous epoch. The stake in this validator set is locked until the next epoch.
34
57
-**Current Validator Set**: The set of pools that form the validator set in the current epoch.
Copy file name to clipboardExpand all lines: docs/fundamentals/blocks.md
+101-8Lines changed: 101 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,9 +5,9 @@ tags:
5
5
6
6
# Blocks
7
7
8
-
**Block** is a data structure that describes and authorizes the execution of a batch of transactions (state transitions) on the blockchain.
8
+
**Block** is a fundamental data structure in a blockchain. It describes execution of a batch of [transactions](transactions.md). Blocks are "chained" by attaching a cryptographic hash of an earlier block. The hash is the proof of the data integrity of the earlier blocks because if their content have been changed, the hash will not be the same. This is how blockchain provides data immutability.
9
9
10
-
Elements inside a block include:
10
+
Summary of the elements inside a block:
11
11
12
12
-`Hash` - the unique identifier for the block
13
13
-`Height` - a number that represents the position of the block on the blockchain
@@ -16,23 +16,116 @@ Elements inside a block include:
16
16
-`Chain ID` - a number that identifies a particular Parallelchain Mainnet-based blockchain
17
17
-`Proposer` - the public address of the block producer
18
18
-`Timestamp` - the time the block was created, measured in seconds since 1970-01-01
19
-
-`Base Fee Per Gas` - the minimum number of grays that a transaction must pay for every gas used to be included in the block
19
+
-[Base Fee Per Gas](nodes.md#base-fee-per-gas-in-parallelchain-mainnet) - the minimum number of grays that a transaction must pay for every gas used to be included in the block
20
20
-`Gas Used` - the amount of [gas](gas.md) used in a block, which is the total sum of the gas used in executing the included transactions
21
21
-`Transactions Hash` - the root hash of the Merkle Tree that contains the transactions included in the block
22
22
-`Receipt Hash` - the root hash of the Merkle Tree that contains the execution results of the transactions included in the block
23
23
-`State Hash` - the root hash of the Merkle Tree that represents the current world state
24
24
-`Log Bloom` - a 256-byte block-level [Bloom Filter](https://en.wikipedia.org/wiki/Bloom_filter) that combines all the Bloom Filters of each Log topic from the block's receipts
25
-
-`Transactions` - the [transactions](transactions.md) that are included in the block
26
-
-`Receipts` - the execution results of the transactions that are included in the block
25
+
-[Transactions](transactions.md) - the transactions that are included in the block
26
+
-[Receipts](transactions.md#receipt-and-logs) - the execution results of the transactions that are included in the block
27
27
28
-
A block is a fundamental data structure in a blockchain system that serves as a container for a batch of transactions. It plays a critical role in maintaining the integrity and immutability of the blockchain.
28
+
## Inside a Block
29
29
30
30
Each block contains a unique identifier known as the `block hash`, which is calculated based on the contents of the block. The block hash acts as a fingerprint for the block, making it tamper-evident. Any change to the block's contents would alter its hash, making it easily detectable by network participants.
31
31
32
32
The block header contains important metadata about the block, including the block's `height`, `timestamp`, and the `address of the block producer`, among others. It also includes Merkle Patricia Tree root hashes for transactions, receipts, and the current state of the blockchain.
33
33
34
-
Transactions contained within the block are executed by the blockchain system, with the results recorded in `receipts`. These receipts contain information about the execution status of each transaction and are stored in a Merkle Patricia Tree, with the root hash included in the block header.
34
+
Transactions contained within the block are executed by the blockchain system, with the results recorded in receipts. These receipts contain information about the execution status of each transaction and are stored in a Merkle Patricia Tree, with the root hash included in the block header.
35
35
36
36
In addition to transactions and receipts, the block also contains a Bloom filter, which is a probabilistic data structure used to efficiently query logs associated with the transactions contained in the block.
37
37
38
-
Overall, block is an essential component of a blockchain system, providing a secure and reliable means of recording and validating transactions while ensuring the immutability and integrity of the blockchain.
38
+
Example of a block queried by [ParallelChain Client CLI](../for_users/pchain_client_cli/introduction.md):
Blocks are produced by validator [Nodes](nodes.md). To produce a block, the node executes transactions and creates receipts as a result of execution. The transactions and receipts become the content of a block, and the node will then compute the metadata such as `block height`, `timestamp`, hashes, etc. in the block header.
109
+
110
+
When a block is created by a node, the validator nodes will validate it and then agree on the block content through a [consensus mechanism](consensus_mechanism.md). An agreed block is said to be **committed**. If the block is invalid, it will not be part of the blockchain. Nodes will keep producing new blocks, and this process repeats within a time interval (i.e. block time). As a result, the blockchain grows with more and more blocks.
111
+
112
+
## Epoch Block
113
+
114
+
**Epoch Block** is a special block created by executing a transaction with [Next Epoch Command](transactions.md#protocol-commands). This special block signifies the last block in an **Epoch**.
115
+
116
+
Epoch is a protocol-defined period for measuring the performance of operators on the blockchain network.
117
+
118
+
The primary purpose of epochs in a blockchain is to facilitate various network functionalities and maintain consensus among network participants by defining a common reference point, which could be utilized to validate transactions. During one epoch, there would be block creation and block addition to the blockchain.
119
+
120
+
In the ParallelChain Mainnet ecosystem, an `epoch` is defined by a predetermined block height or the number of blocks added to the blockchain, which is 8640. When a specific block height is reached or another 8640 blocks are added to the blockchain, the blockchain network would move from the current epoch to the next. The epoch transition could trigger critical events:
121
+
122
+
- Reward stakes in Current Validator Set
123
+
-*Increase deposits* of owner and operator
124
+
-*Update stakes* if auto-stake-rewards is enabled
125
+
126
+
- Replacing Previous Validator Set with Current Validator Set
127
+
- Replacing Current Validator Set with Next Validator Set
128
+
- Returning Next Validator Set for the next leader selection
129
+
130
+
Epoch transition ensures that only one set of validators is active on the blockchain network at any given time, which makes the information on the blockchain tamper-proof.
Copy file name to clipboardExpand all lines: docs/fundamentals/consensus_mechanism.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ HotStuff guarantees that committed Blocks are *immutable*. That is, they can nev
18
18
19
19

20
20
21
-
A Block becomes *committed* the instant its third confirmation is written into the BlockTree. Confirmation for a Block `A` is another Block `B` such that there is a path between `B` to `A`.
21
+
A Block becomes **committed** the instant its third confirmation is written into the BlockTree. Confirmation for a Block `A` is another Block `B` such that there is a path between `B` to `A`.
22
22
23
23
The choice of third confirmation to define commitment--as opposed to first or second--is not arbitrary. HotStuff's safety and liveness properties hinge upon this condition. You can read this [paper](https://github.com/parallelchain-io/hotstuff_rs/blob/master/readme_assets/HotStuff%20paper.pdf) to learn more about it. To summarize:
Copy file name to clipboardExpand all lines: docs/fundamentals/gas.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,10 @@ tags:
11
11
12
12
There are different categories of gas cost in the ParallelChain Mainnet ecosystem:
13
13
14
-
- WASM opcode execution inside a contract call
14
+
- WASM opcode execution inside a contract [call](transactions.md#account-commands)
15
15
- Reading and writing WASM memory from host functions inside a contract call
16
16
- Transaction-related data storage
17
-
- World state storage and access
17
+
-[World state](nodes.md#world-state) storage and access
18
18
- Cryptographic operations
19
19
20
20
Details about gas can be found in [ParallelChain Mainnet Protocol](https://github.com/parallelchain-io/parallelchain-protocol/blob/master/Gas.md).
Copy file name to clipboardExpand all lines: docs/fundamentals/networks.md
+3-4Lines changed: 3 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -14,15 +14,14 @@ tags:
14
14
15
15
**ParallelChain Mainnet** is a high-performance blockchain designed for enterprise-level use cases. It provides a platform for developers to build decentralised applications (dApps) with its efficient smart contract execution engine.
16
16
17
-
It is designed to balance high performance and genuine decentralization. It is protected by the ParallelBFT consensus protocol, which adopts a sophisticated class-based node system to ensure fast and accountable consensus.
17
+
It is designed to balance high performance and genuine decentralization. It is protected by the a Byzantine Fault Tolerant (BFT) consensus protocol, which adopts a sophisticated class-based node system to ensure fast and accountable consensus.
18
18
19
19
For more information about the consensus protocol, please read the section [Consensus Mechanism](./consensus_mechanism.md).
20
20
21
21
## ParallelChain Testnet
22
22
23
23
To ensure the new features in ParallelChain Mainnet have what it takes to survive decentralised deployment, they must first be battle-tested. This is where ParallelChain Testnet comes into play by allowing developers, or simply users, to develop and run smart contracts or transactions on ParallelChain and experiment with the blockchain, at no cost.
24
24
25
-
The current testnet iteration delivers on Byzantine Fault Tolerant (BFT) consensus, the cornerstone of security in ParallelChain's proof-of-stake network. Besides this, Testnet 4 delivers big leaps in the contract SDK and developer experience, as well as a web Wallet.
26
25
Both Mainnet and Testnet are accessible through [Explorer](#parallelchain-explorer). But only onTestnet, a service called [Faucet Service](#faucet-service) provides free tokens to users.
27
26
28
27
## Accessing the Networks
@@ -50,13 +49,13 @@ What you can do:
50
49
51
50
### Xperience Browser Extension
52
51
53
-
**Xperience Browser Extension** is a browser extension that allows you to integrate your [dApp](../../for_developers/xperience_browser_provider_apis/introduction) with ParallelChain Wallet.
52
+
**Xperience Browser Extension** is a browser extension that allows you to integrate your [dApp](../for_developers/xperience_browser_provider_apis/introduction.md) with ParallelChain Wallet.
54
53
55
54
This enables your dapp to interact with your dapp users' XPLL accounts, to:
56
55
57
56
- Send [transactions](transactions.md)
58
57
-[Stake](staking.md) XPLL
59
-
- Trigger confirmation for [smart contract](../../for_developers/smart_contracts/introduction) calls
58
+
- Trigger confirmation for [smart contract](../for_developers/smart_contracts/introduction.md) calls
60
59
61
60
**The browser extension is available on the [Chrome Web Store](https://chromewebstore.google.com/detail/xperience-browser-extensi/gpfllmjckejjhmmdmgbgmclmhopekjpf) now.**
0 commit comments