|
1 | 1 | # Batches, Blocks, and Transactions |
2 | 2 |
|
3 | | -To understand how transactions are handled on L2s built with the CDK, there are four key concepts to understand: |
| 3 | +To understand how transactions are handled on L2s built with the CDK, there are three key concepts to understand: |
4 | 4 |
|
5 | 5 | - **Transaction**: Signed instruction to perform an action on the blockchain. |
6 | 6 | - **Block**: A group of transactions and a hash of the previous block in the chain. |
7 | 7 | - **Batch**: A group of many transactions from multiple blocks. |
8 | 8 |
|
9 | | -To best understand how these concepts relate to each other, on this page, we will follow a real transaction from the Polygon zkEVM to see how it first gets included in a block on the L2, then in a batch, and finally, a sequence that is sent to Ethereum. |
| 9 | +To best understand how these concepts relate to each other, on this page, we will follow a real transaction from the Polygon zkEVM to track how it first gets included in a block on the L2, then in a batch, and finally, a sequence that is sent to Ethereum. |
10 | 10 |
|
11 | 11 |  |
12 | 12 |
|
13 | 13 | ## Transaction |
14 | 14 |
|
15 | 15 | A transaction is a cryptographically signed instruction from an account to update the state of the blockchain. Users can send transactions to L2 chains built with the CDK using the same tools and libraries they use to interact with Ethereum such as MetaMask. |
16 | 16 |
|
17 | | -Transactions are included in both blocks and batches. An example Polygon zkEVM transaction [`0xdd`](https://zkevm.polygonscan.com/tx/0xdd3f79c24886310ddf868ad1d36aadc6a3b6495048f68aad765c658c42426ef8) performs a `Simple Swap` function call, and part of block [`12952601`](https://zkevm.polygonscan.com/block/12952601) on the L2. |
| 17 | +Transactions are included in both blocks and batches. An example Polygon zkEVM transaction, [`0xdd`](https://zkevm.polygonscan.com/tx/0xdd3f79c24886310ddf868ad1d36aadc6a3b6495048f68aad765c658c42426ef8), performs a `Simple Swap` function call, and is included in block number [`12952601`](https://zkevm.polygonscan.com/block/12952601) on the L2. |
18 | 18 |
|
19 | 19 |  |
20 | 20 |
|
21 | 21 | ## Block |
22 | 22 |
|
23 | | -Blocks contain multiple transactions and the hash of the previous block in the chain to link blocks together. Following our example transaction from above, the `0xdd` transaction is included in block [`12952601`](https://zkevm.polygonscan.com/block/12952601), which contains [2 total transactions](https://zkevm.polygonscan.com/txs?block=12952601). |
| 23 | +Blocks contain multiple transactions as well as the hash of the previous block in the chain to link blocks together. Following our example transaction from above, the `0xdd` transaction is included in block [`12952601`](https://zkevm.polygonscan.com/block/12952601), which contains [2 total transactions](https://zkevm.polygonscan.com/txs?block=12952601). |
| 24 | + |
| 25 | +We can see this `0xdd` transaction is included in both a block and a batch, specifically, it is included in the block `12952601` and the batch `2041736`: |
24 | 26 |
|
25 | 27 |  |
26 | 28 |
|
27 | 29 | ## Batch |
28 | 30 |
|
29 | 31 | Batches contain multiple transactions from multiple blocks. The two total transactions from our example block `12952601` are included in batch [`2041736`](https://zkevm.polygonscan.com/batch/2041736), which contains [10 total transactions](https://zkevm.polygonscan.com/txs?batch=2041736). |
30 | 32 |
|
31 | | -As there is also a `Sequence Tx Hash` field associated with this batch, we can infer that this batch is part of a sequence of batches that have already been sent to Ethereum. |
| 33 | +This means the batch `2041736` includes the two transactions from block `12952601` as well as eight transactions from other blocks. |
| 34 | + |
| 35 | +As there is a `Sequence Tx Hash` field associated with this batch, this means that this batch has been sent to Ethereum along with other batches in a single transaction. |
32 | 36 |
|
33 | 37 |  |
34 | 38 |
|
|
0 commit comments