Skip to content

Commit f62e56b

Browse files
authored
add batch transfer doc (#82)
1 parent 1af5528 commit f62e56b

9 files changed

Lines changed: 53 additions & 5 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ public/
44
resources
55
*.lock
66
hugo_stats.json
7+
8+
TODO

content/get-started/become-a-validator.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ By staking their own coins, validators contribute to the network's security and
2020
## Validator Rewards
2121

2222
When a validator successfully proposes a block that is accepted by the network,
23-
they receive a block reward in the form of one coin.
23+
they receive a block reward.
2424
This reward serves as an [incentive](/protocol/blockchain/incentive)
25-
for validators to continue supporting the network.
25+
for validators to continue supporting the network while ensuring the long-term sustainability of the Pactus ecosystem.
2626

2727
## Minimum requirement
2828

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
title: Batch Transfer Transaction
3+
weight: 8
4+
math: false
5+
---
6+
7+
Batch transfer transaction is used to transfer coins to multiple recipients in a single transaction.
8+
This is more efficient than creating multiple individual transfer transactions.
9+
It follows a one-to-many pattern, allowing a single sender to transfer coins to multiple recipients in one transaction.
10+
11+
If any receiver account does not exist, it will be created automatically.
12+
13+
The [Payload Type](/protocol/transaction/format/#payload-type) for Batch Transfer is 6.
14+
15+
## Payload Structure
16+
17+
The batch transfer transaction has a payload that consists of the following fields:
18+
19+
| Field | Size |
20+
| -------------------- | -------- |
21+
| Sender address | 21 bytes |
22+
| Number of Recipients | Variant |
23+
| Recipients Address 1 | 21 bytes |
24+
| Recipients Amount 1 | Variant |
25+
| ... | ... |
26+
| Recipients Address N | 21 bytes |
27+
| Recipients Amount N | Variant |
28+
29+
- **Sender address** is the account address that transfers the amounts
30+
- **Number of Recipients** specifies how many recipients will receive funds in this transaction (maximum 8 recipients)
31+
- **Recipients Address 1 to N** are the account addresses that receive the amounts
32+
- **Recipients Amount 1 to N** are the amounts of coins that should be transferred to each corresponding recipient
33+
34+
The payload structure allows for up to 8 recipients, with each recipient having a corresponding address and amount pair.

content/protocol/transaction/bond.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ This is called the "bond interval" and is defined in the
1313
Validators within the committee cannot increase their stake.
1414
Therefore, bond transactions will be processed only when the validators are not in the committee.
1515

16+
The [Payload Type](/protocol/transaction/format/#payload-type) for Bond is 2.
17+
1618
## Payload Structure
1719

1820
The bond transaction has a payload consists the following fields:

content/protocol/transaction/format.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ Transactions in the Pactus consist of the following fields:
1515
| Memo | Variant |
1616
| Payload Type | 1 byte |
1717
| Payload Data | Variant |
18-
| Signature | 48 bytes |
19-
| Public Key | 96 bytes |
18+
| Signature | Variant |
19+
| Public Key | Variant |
2020

2121
- **Flags** A flag is a bitfield that indicates how to decode the transaction data.
2222
- **Version** is the version of the transaction format. Different versions may have different fields or
@@ -48,11 +48,13 @@ The following are the supported transactions in the Pactus blockchain:
4848
3. [Sortition transaction](/protocol/transaction/sortition)
4949
4. [Unbond transaction](/protocol/transaction/unbond)
5050
5. [Withdraw transaction](/protocol/transaction/withdraw)
51+
6. [Batch Transfer transaction](/protocol/transaction/batch_transfer)
5152

5253
## Flags
5354

54-
- **0x1** Indicates that the [public key is known](https://pips.pactus.org/PIPs/pip-4)
55+
- **0x01** Indicates that the [public key is known](https://pips.pactus.org/PIPs/pip-4)
5556
and excluded from the transaction.
57+
- **0x02** Indicates that the transaction is not signed yet.
5658

5759
## Transaction ID
5860

content/protocol/transaction/sortition.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ Sortition transactions are valid for 7 blocks, which is defined as "sortition in
1111
[consensus parameters](/protocol/consensus/parameters/).
1212
Sortition is free. This means there are no fees associated with the process of sortition transaction.
1313

14+
The [Payload Type](/protocol/transaction/format/#payload-type) for Sortition is 3.
15+
1416
## Payload Structure
1517

1618
The sortition transaction has a payload consists the following fields:

content/protocol/transaction/transfer.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ math: false
77
Transfer transaction is used to transfer coins between the [accounts](/protocol/blockchain/account/).
88
If the receiver account does not exist, it will be created.
99

10+
The [Payload Type](/protocol/transaction/format/#payload-type) for Transfer is 1.
11+
1012
## Payload Structure
1113

1214
The transfer transaction has a payload consists the following fields:

content/protocol/transaction/unbond.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ After 21 days, the stake can be withdrawn.
1010
This period is called the "unbond interval" and is defined in the [consensus parameter](/protocol/consensus/parameters/).
1111
Unbonding is free. This means there are no fees associated with the process of unbond transaction.
1212

13+
The [Payload Type](/protocol/transaction/format/#payload-type) for Unbond is 4.
14+
1315
## Payload Structure
1416

1517
The unbond transaction has a payload consists the following field:

content/protocol/transaction/withdraw.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ A withdraw transaction is used to retrieve the staked coins from an unbonded
99
If the validator is still in the unbond period, the transaction will be rejected.
1010
The unbond period is a 21-day interval during which the validator is inactive, but their stake cannot yet be withdrawn.
1111

12+
The [Payload Type](/protocol/transaction/format/#payload-type) for Withdraw is 5.
13+
1214
## Payload Structure
1315

1416
The withdraw transaction has a payload consists the following fields:

0 commit comments

Comments
 (0)