Skip to content
Merged
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
6 changes: 4 additions & 2 deletions PIPs/pip-10.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ and execution is organized into a sequence of rounds.
Within a round, a single validator is designated as the proposer responsible for collecting transactions and
creating a proposal block.
The proposer then broadcasts a proposal message that includes the proposal block to other validators.
Other validators, once they receive the proposal message, validate it and broadcast the $PREPARE$ message to other validators.
Other validators, once they receive the proposal message, validate it and broadcast
the $PREPARE$ message to other validators.

### Fast Agreement Path

Expand All @@ -59,7 +60,8 @@ that is biased toward zero.
If a correct validator has received more than $2f+1$ Prepared messages,
the initial value should be set to zero; otherwise, it should be set to one.
The outcome of the binary agreement determines whether the proposer should be changed or not.
If the validators agree to not change the proposer, they continue the agreement protocol by moving to the precommit step.
If the validators agree to not change the proposer, they continue the
agreement protocol by moving to the precommit step.
Otherwise, they increase the round number, and the next proposer proposes the new proposal.

Figure below shows the communication patterns for the agreement path when one validator is faulty.
Expand Down
111 changes: 74 additions & 37 deletions PIPs/pip-11.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ we pad the private key with 0x01 in G<sub>1</sub> and 0x00 in G<sub>2</sub>.
### Public parent key &rarr; public child key

The function CKDpub((K<sub>par</sub>, c<sub>par</sub>), i) &rarr; (K<sub>i</sub>, c<sub>i</sub>)
computes a child extended public key from the parent extended public key. It is only defined for non-hardened child keys.
computes a child extended public key from the parent extended public key.
It is only defined for non-hardened child keys.

1. Check whether i ≥ 2<sup>31</sup> (whether the child is a hardened key).
* If so (hardened child): return failure
Expand All @@ -125,58 +126,94 @@ computes a child extended public key from the parent extended public key. It is
Seed (hex): 000102030405060708090a0b0c0d0e0f

* Chain m
* chain code: b879b097ba29929520a91dee29de1d94398c91076a4245be61704265d230c972
* private: 4f55e31ee1c4f58af0840fd3f5e635fd6c07eacd14283c45d7d43729003abb84
* public: 8fbed8842588b629377c0a0d0d9547a9ee17527d5fd6d2c609034a8c3c074dda031e0dfe886b454499bfe0f40a7c4b18
* chain code:
b879b097ba29929520a91dee29de1d94398c91076a4245be61704265d230c972
* private:
4f55e31ee1c4f58af0840fd3f5e635fd6c07eacd14283c45d7d43729003abb84
* public:
8fbed8842588b629377c0a0d0d9547a9ee17527d5fd6d2c609034a8c3c074dda031e0dfe886b454499bfe0f40a7c4b18
* Chain m/0<sub>H</sub>
* chain code: 1b33156f5383050c5481396cc641be4e3436f2dae7cf68f5d78aec81c399e0b7
* private: 5f5d7bfae7eabf2cc3faebc12449e1c7116c2777d7e384ead79df299667b8d9a
* public: b2826a89a22fec3349d64f4379a1eb5632b0b345b985b738324a5b8db640307421201efe36ae6c8c639d32d4124496ae
* chain code:
1b33156f5383050c5481396cc641be4e3436f2dae7cf68f5d78aec81c399e0b7
* private:
5f5d7bfae7eabf2cc3faebc12449e1c7116c2777d7e384ead79df299667b8d9a
* public:
b2826a89a22fec3349d64f4379a1eb5632b0b345b985b738324a5b8db640307421201efe36ae6c8c639d32d4124496ae
* Chain m/0<sub>H</sub>/1
* chain code: d74d25d225a40a3397798e554fc8dd0a80ce7f66f423c4cc0a6d4a278ee389c8
* private: 3bea739c9a2695ba4af566bc3f28e5c62da8e721b977709f9d492f7129b83521
* public: af5980f4172797c07174a4040eb0b1859b357b05f0a29ac65c35d957730fd722ffd520d861e8fbe3126d26ceb08dbe52
* chain code:
d74d25d225a40a3397798e554fc8dd0a80ce7f66f423c4cc0a6d4a278ee389c8
* private:
3bea739c9a2695ba4af566bc3f28e5c62da8e721b977709f9d492f7129b83521
* public:
af5980f4172797c07174a4040eb0b1859b357b05f0a29ac65c35d957730fd722ffd520d861e8fbe3126d26ceb08dbe52
* Chain m/0<sub>H</sub>/1/2<sub>H</sub>
* chain code: c87a9057238d8c758f83df550d598678cfa9daaabe1abbe845c5847c60401e48
* private: 221e1f998e9599aecdab1c9671162bea925ee50d5f1c5bca2ed19908ac0f2ddd
* public: b06503dda77e1408478fc4b2d044a0ce2ab73691e8497a37f99d00e1076782698aacceb8e68fb9c3db6deccb0b8375fe
* chain code:
c87a9057238d8c758f83df550d598678cfa9daaabe1abbe845c5847c60401e48
* private:
221e1f998e9599aecdab1c9671162bea925ee50d5f1c5bca2ed19908ac0f2ddd
* public:
b06503dda77e1408478fc4b2d044a0ce2ab73691e8497a37f99d00e1076782698aacceb8e68fb9c3db6deccb0b8375fe
* Chain m/0<sub>H</sub>/1/2<sub>H</sub>/2
* chain code: 89c4994eb292ab70e6f3ae9b7882cca586062df242cad14c4f70af64c26cca42
* private: 26a19ca5ff2f6b32871de71aabd87a30ce79cdde3b0556cbb46692295f0aee15
* public: afd589792ba6bcb1866598a673a96fdaef9bf94026ef875a1a3e8d4fd839360f4659c9495afaf24c52577c0aa1fb5d45
* chain code:
89c4994eb292ab70e6f3ae9b7882cca586062df242cad14c4f70af64c26cca42
* private:
26a19ca5ff2f6b32871de71aabd87a30ce79cdde3b0556cbb46692295f0aee15
* public:
afd589792ba6bcb1866598a673a96fdaef9bf94026ef875a1a3e8d4fd839360f4659c9495afaf24c52577c0aa1fb5d45
* Chain m/0<sub>H</sub>/1/2<sub>H</sub>/2/1000000000
* chain code: 5f8b5e959ce7874b010b3250ff63c3860c005f73bb219ae7e53814a4d1e57c31
* private: 44b743b059c2e4cb720378f4f0eda9369a1f02294e140e6a2e444bfdd36b1ad9
* public: 99b404130a1ae6b6dd90ddf2a25c692f405536fee11046257ed6ba11629f101ad80658c61c039f0523de4c6e9f58a5c8
* chain code:
5f8b5e959ce7874b010b3250ff63c3860c005f73bb219ae7e53814a4d1e57c31
* private:
44b743b059c2e4cb720378f4f0eda9369a1f02294e140e6a2e444bfdd36b1ad9
* public:
99b404130a1ae6b6dd90ddf2a25c692f405536fee11046257ed6ba11629f101ad80658c61c039f0523de4c6e9f58a5c8

### Test vector on G2

Seed (hex): 000102030405060708090a0b0c0d0e0f

* Chain m
* chain code: b879b097ba29929520a91dee29de1d94398c91076a4245be61704265d230c972
* private: 4f55e31ee1c4f58af0840fd3f5e635fd6c07eacd14283c45d7d43729003abb84
* public: b1bad3bf4a4ae87c89dec2c32512603ca08e2db62cfd2254c96bfe75068f5a98e7c4cd7d37cf0496dd6e79703e7c88e5046bdec9c896ef2ad030096bbcf73c6cff17add3da9530f22491901fdf7fd2076c0f08ea35a4fdaa00e7ac6d0a5442e3
* chain code:
b879b097ba29929520a91dee29de1d94398c91076a4245be61704265d230c972
* private:
4f55e31ee1c4f58af0840fd3f5e635fd6c07eacd14283c45d7d43729003abb84
* public:
b1bad3bf4a4ae87c89dec2c32512603ca08e2db62cfd2254c96bfe75068f5a98e7c4cd7d37cf0496dd6e79703e7c88e5046bdec9c896ef2ad030096bbcf73c6cff17add3da9530f22491901fdf7fd2076c0f08ea35a4fdaa00e7ac6d0a5442e3
* Chain m/0<sub>H</sub>
* chain code: e271fa0804ffbc6ae5d63b31cce6cc5cc4b3e97b28672bf97a5b009174527938
* private: 5695ba5087a27f8c0d7270455104658b2367b8e90ab6f7f57ac7ce22d4a6836c
* public: b37da3080662ceeb7f07289801a56e5c555d413434ad096079c084caa162c8d224891f68816921f5bd1453af7d085bc400341d61ce496ffb11cd10f8e90522447fada1a5f646c45797e00460925876f0b63f4023bf27e828688f7b4dd833e641
* chain code:
e271fa0804ffbc6ae5d63b31cce6cc5cc4b3e97b28672bf97a5b009174527938
* private:
5695ba5087a27f8c0d7270455104658b2367b8e90ab6f7f57ac7ce22d4a6836c
* public:
b37da3080662ceeb7f07289801a56e5c555d413434ad096079c084caa162c8d224891f68816921f5bd1453af7d085bc400341d61ce496ffb11cd10f8e90522447fada1a5f646c45797e00460925876f0b63f4023bf27e828688f7b4dd833e641
* Chain m/0<sub>H</sub>/1
* chain code: 4e0bae8832a7e12b6230ca296e252507ba55e4ca35fe413362f65256bd0adbc0
* private: 555422bcbffd1d55eea6f87a924ba5d046bb60e2bffe2182daf78bab6a6e179f
* public: b5f783bb1f1173feebb083f146c5a83470e84f26177862c5ab5b8be34ae6e3955d1b324f501a0d2751d971805f0612bc0b5e966c9060eeb08cf38a7e71037863ffb2f6433694e69db59f731dbe55125f995d2d6ccd139d56d5b481d3bce76baa
* chain code:
4e0bae8832a7e12b6230ca296e252507ba55e4ca35fe413362f65256bd0adbc0
* private:
555422bcbffd1d55eea6f87a924ba5d046bb60e2bffe2182daf78bab6a6e179f
* public:
b5f783bb1f1173feebb083f146c5a83470e84f26177862c5ab5b8be34ae6e3955d1b324f501a0d2751d971805f0612bc0b5e966c9060eeb08cf38a7e71037863ffb2f6433694e69db59f731dbe55125f995d2d6ccd139d56d5b481d3bce76baa
* Chain m/0<sub>H</sub>/1/2<sub>H</sub>
* chain code: e1132c2fdbca1bd9047e1db7eb9d98bc7559f2b853d20e8361553fbc8ba3a9b3
* private: 39e4906c49c05f5daeed89ced104a32cda82782654dcc116346144424746f871
* public: 81461b89b446d055ac3bc38b9384363cbabc47cc0a16c97a7c7ea24eeffd70f213daacdfd736a49c45befececcd8183212f04e186bcc9fbf67bfa5de862c57298cff4d36d5409380a166b9e37348b665186019b15498608309936e7ff36a87b5
* chain code:
e1132c2fdbca1bd9047e1db7eb9d98bc7559f2b853d20e8361553fbc8ba3a9b3
* private:
39e4906c49c05f5daeed89ced104a32cda82782654dcc116346144424746f871
* public:
81461b89b446d055ac3bc38b9384363cbabc47cc0a16c97a7c7ea24eeffd70f213daacdfd736a49c45befececcd8183212f04e186bcc9fbf67bfa5de862c57298cff4d36d5409380a166b9e37348b665186019b15498608309936e7ff36a87b5
* Chain m/0<sub>H</sub>/1/2<sub>H</sub>/2
* chain code: 2c430501360a9b6e7eb71a16774d887a48eea13e6eb513f40a2c7fa3b2771720
* private: 3aa1e19a9bf2bf631d95b401e29d5f042160edd76ced9696e42a98be80b41faa
* public: 92b20565b4a02bf82229f32e0ccc6f23446ded5ca2d67067afc70931b5a934f9469651e67e1105b5601cb585a1f44538124fe3529f5b1edb27ab44f0900e59a27f57df87aa03395a70825d02433c2498d8396c90986dad79d5ba9e0fc438bea8
* chain code:
2c430501360a9b6e7eb71a16774d887a48eea13e6eb513f40a2c7fa3b2771720
* private:
3aa1e19a9bf2bf631d95b401e29d5f042160edd76ced9696e42a98be80b41faa
* public:
92b20565b4a02bf82229f32e0ccc6f23446ded5ca2d67067afc70931b5a934f9469651e67e1105b5601cb585a1f44538124fe3529f5b1edb27ab44f0900e59a27f57df87aa03395a70825d02433c2498d8396c90986dad79d5ba9e0fc438bea8
* Chain m/0<sub>H</sub>/1/2<sub>H</sub>/2/1000000000
* chain code: af0c9948f774376f0a8bd6df515b173d8d6d82b69a0d513797ee7ff283fd16ac
* private: 2b01ef29730eb62c7114621d9d28ad77cf33f2434572a2bf9b73f1e502fea770
* public: b05a01a80c3fe465227c23df7e36be1adcf557111f4cc50bf0f00c66c2b084d1e1d96e2f1c754496cb1f83dd1123456e17697e77a9b99ea557a63c9bf29668a966732882e7baebf079a4afad212910deb10e5151e18ae98ee4a57d0e622332aa
* chain code:
af0c9948f774376f0a8bd6df515b173d8d6d82b69a0d513797ee7ff283fd16ac
* private:
2b01ef29730eb62c7114621d9d28ad77cf33f2434572a2bf9b73f1e502fea770
* public:
b05a01a80c3fe465227c23df7e36be1adcf557111f4cc50bf0f00c66c2b084d1e1d96e2f1c754496cb1f83dd1123456e17697e77a9b99ea557a63c9bf29668a966732882e7baebf079a4afad212910deb10e5151e18ae98ee4a57d0e622332aa

## Implementation

Expand Down
3 changes: 2 additions & 1 deletion PIPs/pip-18.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ This delay could cause their signatures to arrive late compared to other validat
The proposal suggests adding a time check routine that repeats every minute.
This routine calculates the "Clock Offset" in each run,
which is defined as the estimated offset of the local system clock relative to the network's clock.
The network clock can be obtained using the Network Time Protocol (NTP) and a set of NTP servers from the NTP Pool Project.
The network clock can be obtained using the Network Time Protocol (NTP) and
a set of NTP servers from the NTP Pool Project.
The NTP Pool Project is a globally distributed network of volunteer-operated time servers,
ensuring precise time synchronization across various geographic locations.

Expand Down
3 changes: 2 additions & 1 deletion PIPs/pip-19.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ based on their performance within the committee.
Each validator gives a score to other validators called the "Availability score."
To calculate this score, we look at the last 60,000 blocks, which covers almost a week (each block taking 10 seconds).

To calculate the score, we look at how many blocks a validator signed compared to how many times they were in the committee:
To calculate the score, we look at how many blocks a validator signed compared to
how many times they were in the committee:

$$
S_i = \frac{V_i}{N_i}
Expand Down
4 changes: 2 additions & 2 deletions PIPs/pip-20.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ and allow or deny access based on the authentication outcome.

### Generate Password Hash

1. Generate Bcrypt Hash:
#### 1. Generate Bcrypt Hash

Bcrypt is a widely used hashing algorithm for securely hashing passwords.
It includes a salt to protect against rainbow table attacks and
Expand All @@ -56,7 +56,7 @@ htpasswd -bnB foo bar

This command outputs the bcrypt-hashed password for the user "foo".

2. Store the Hashed Password in Configuration File:
#### 2. Store the Hashed Password

Once the bcrypt-hashed password is obtained, it can be stored in the configuration file:

Expand Down
5 changes: 3 additions & 2 deletions PIPs/pip-24.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ However, in practice, the double proposer often still manages to get rewarded. H
Since the majority of the nodes are running the latest version, the outdated proposal will get ignored,
and only one proposal will be voted on.

1. Due to network topology and time differences between validators,
2. Due to network topology and time differences between validators,
one proposal can be received by the majority of the validators faster.
Therefore, the first proposal can garner 2/3 of the votes before the second proposal causes vote divergence.

This proposal suggests starting the "change proposer" phase once the second signed proposal is received by the validators,
This proposal suggests starting the "change proposer" phase once the
second signed proposal is received by the validators,
no matter its validity.
By doing so, validators will have no incentive to run duplicated nodes.

Expand Down
3 changes: 2 additions & 1 deletion PIPs/pip-29.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,6 @@ To support these businesses, we need to allow multiple receivers in a single tra

- **Complexity:** Increases the complexity of transaction validation and processing.
- **Security:** Requires rigorous security measures to prevent batch transaction abuse.
- **Redundancy:** If gas-less transactions are implemented, the primary benefit of batch transactions (cost saving) is diminished.
- **Redundancy:** If gas-less transactions are implemented, the primary benefit of
batch transactions (cost saving) is diminished.
- **Debugging Difficulties:** Troubleshooting failed transactions can become more complex.
3 changes: 2 additions & 1 deletion PIPs/pip-36.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,8 @@ The Transaction Info topic data is structured as:

The block number indicates the block in which the transaction is confirmed.
If the block number is set to `0`, the transaction remains unconfirmed.
This allows the service to notify applications when transactions enter the transaction pool, with room for future expansion.
This allows the service to notify applications when transactions enter the transaction pool,
with room for future expansion.

#### Raw Block Header

Expand Down
25 changes: 16 additions & 9 deletions PIPs/pip-40.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,18 @@ for future years.

## Motivation

The Pactus blockchain uses a staking model that enables even low-resource community members to participate as validators.
To incentivize participation, 1 coin is distributed from the treasury to a validator every 10 seconds for proposing a block,
amounting to 8640 coins per day. Additionally, validators currently receive all transaction fees, accelerating
The Pactus blockchain uses a staking model that enables even
low-resource community members to participate as validators.
To incentivize participation, 1 coin is distributed from the treasury
to a validator every 10 seconds for proposing a block,
amounting to 8640 coins per day. Additionally, validators currently
receive all transaction fees, accelerating
depletion of the treasury.

With 42 million PAC initially allocated to the treasury, projections indicate the treasury will be exhausted in
approximately 13 years.
Without intervention, the network will no longer be able to distribute base block rewards after that point, threatening long-term
With 42 million PAC initially allocated to the treasury, projections
indicate the treasury will be exhausted in approximately 13 years.
Without intervention, the network will no longer be able to
distribute base block rewards after that point, threatening long-term
validator engagement and network security.

## Specification
Expand All @@ -40,7 +44,8 @@ validator engagement and network security.

- No change to block time, staking rules, or validator selection logic.

- Treasury address: [000000000000000000000000000000000000000000](https://bootstrap1.pactus.org/account/address/000000000000000000000000000000000000000000)
- Treasury address:
[000000000000000000000000000000000000000000](https://pactusscan.com/address/000000000000000000000000000000000000000000)

## Backwards Compatibility

Expand All @@ -59,6 +64,8 @@ No backward compatibility issues found.

## Security Considerations

Redirecting fees to the treasury may slightly reduce short-term validator income but ensures long-term reward sustainability.
It may reduce incentive for spam transactions by removing fee revenue motivation. No additional attack vectors are introduced
Redirecting fees to the treasury may slightly reduce short-term
validator income but ensures long-term reward sustainability.
It may reduce incentive for spam transactions by removing fee revenue motivation.
No additional attack vectors are introduced
by this proposal.
18 changes: 9 additions & 9 deletions PIPs/pip-44.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,50 +159,50 @@ language, integrating with PVM to accelerate dApp development.

PVM supports WASM-based smart contracts.

1. Prerequisites:
### 1. Prerequisites

• PVM operational.
• Pactus SDK (JS/Python) for tx building.
• AI fine-tuned for code parsing (e.g., via CodeBERT).

2. User Input Processing:
### 2. User Input Processing

• Developer inputs: “Deploy contract: wasm code” or similar.
• AI parses code, language, and parameters using NLP.

3. Code Validation:
### 3. Code Validation

• Syntax check with linters (e.g., wasm-lint for WASM).
• Static analysis for vulnerabilities (e.g., custom WASM tools).
• Simulate execution in sandbox (wasmtime for WASM).

4. Compilation:
### 4. Compilation

• Compile to PVM bytecode (e.g., wasm-pack or Pactus-specific compiler).
• AI handles errors, suggests fixes (e.g., missing imports).

5. Transaction Construction:
### 5. Transaction Construction

• Pactus AI & DAO Proposal
• Build deployment tx via Pactus gRPC/REST API.
• Include bytecode, ABI, constructor args; calculate fees per PIP-31.

6. Signing and Broadcast:
### 6. Signing and Broadcast

• User approves/signs via chatbot (local key management).
• Broadcast tx to Pactus nodes.

7. Post-Deployment:
### 7. Post-Deployment

• Poll tx status via API; return contract address, logs.
• AI enables interaction (e.g., “Call function X with args Y”).

8. Decentralized Aspects:
### 8. Decentralized Aspects

• Offload compilation/validation to compute contributors (e.g., via distributed WebAssembly runtimes).
• DAO governs supported languages and tools.

9. Security:
### 9. Security

• Rate limits and stake requirements (e.g., 100 PAC) for deployments.
• AI flags risky code (e.g., reentrancy risks) for manual review or veto.
Expand Down
3 changes: 2 additions & 1 deletion PIPs/pip-52.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ The following test vectors demonstrate encoding and decoding of Ed25519 keys and
- **Encoded Public Key**: `public1rqwss00lnecgtu8tsm5vwwj7qn9n7f43snwjs6hcamjrxgyj4xxuq5agu5g`
- **Encoded Address**: `pc1rj65g93q7lpdq0366vst22l7va9d26j3l2vr0em`
- **Message (bytes)**: `pactus`
- **Signature (hex)**: `1fc2c800499342d08242db9c3eb654027cb7b821e6af9ede56dfdb67e824f15bddb419d2db3fd5aaf3ef1a9ebb9a9deb749380f0d6a110cbe95319fe9f794305`
- **Signature (hex)**:
`1fc2c800499342d08242db9c3eb654027cb7b821e6af9ede56dfdb67e824f15bddb419d2db3fd5aaf3ef1a9ebb9a9deb749380f0d6a110cbe95319fe9f794305`

### HD Wallet Test Cases

Expand Down
3 changes: 2 additions & 1 deletion PIPs/pip-53.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,8 @@ The following test vectors demonstrate the encoding and decoding of secp256k1 ke
- **Encoded Address**: `pc1y90qakls8jlz9hyvdcsqsj0yj2lrqz26vqu7l0z`
- **Message (bytes)**: `pactus`
- **Message Digest (hex)**: `ea020ace5c968f755dfc1b5921e574191cd9ff438639badae8a69f667e0d5970`
- **Signature (hex)**: `c86779676d217b04979434e5bd37eddd02b671e9a54b48d3a812c7862dcb539631bb5e8459fec007608f50ea5661e0a5215aac976705404cb4f36ee623e63199`
- **Signature (hex)**:
`c86779676d217b04979434e5bd37eddd02b671e9a54b48d3a812c7862dcb539631bb5e8459fec007608f50ea5661e0a5215aac976705404cb4f36ee623e63199`

### HD Wallet Test Cases

Expand Down
Loading
Loading