Skip to content

Commit b1195f9

Browse files
docs: Update tx format doc page (#383)
## What ❔ Update documentation for transaction encoding format <!-- What are the changes this PR brings about? --> <!-- Example: This PR adds a PR template to the repo. --> <!-- (For bigger PRs adding more context is appreciated) --> ## Why ❔ <!-- Why are these changes done? What goal do they contribute to? What are the principles behind them? --> <!-- The `Why` has to be clear to non-Matter Labs entities running their own ZK Chain --> <!-- Example: PR templates ensure PR reviewers, observers, and future iterators are in context about the evolution of repos. --> ## Is this a breaking change? - [ ] Yes - [ ] No ## Checklist <!-- Check your PR fulfills the following items. --> <!-- For draft PRs check the boxes as you complete them. --> - [ ] PR title corresponds to the body of PR (we generate changelog entries from PRs). - [ ] Tests for the changes have been added / updated. - [ ] Documentation comments have been added / updated. - [ ] Code has been formatted.
1 parent 3453211 commit b1195f9

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

docs/bootloader/transaction_format.md

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1-
# Transaction format
1+
# Transaction formats
22

3-
ZKsyncOS expects transactions with the following fields:
3+
ZKsyncOS transactions have two encoding formats:
4+
5+
1. ABI-encoded: used for L1->L2 transactions, upgrade transactions and 712 transactions. This format is defined in the next section.
6+
2. RLP-encoded: used for L2 transactions. These follow the standard Ethereum RLP encoding for legacy, EIP-2930, EIP-1559 and EIP-7702 transactions.
7+
8+
## ABI-encoded ZKsync-specific transactions
49

510
| Field | Type | Description |
611
|---------------------------|--------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
@@ -19,16 +24,14 @@ ZKsyncOS expects transactions with the following fields:
1924
| `signature` | `bytes` | Signature of the transaction. |
2025
| `factory_deps` | `bytes` | Only for EraVM. Properly formatted hashes of bytecodes to be published on L1 with this transaction. Previously published bytecodes won't incur additional fees. |
2126
| `paymaster_input` | `bytes` | Input for the paymaster. Legacy field, unused currently. |
22-
| `reserved_dynamic` | `bytes` | Field used for extra functionality. Currently, it's used for access and authorization lists. The field is encoded as a list, to be able to extend it in the future. The field is encoded a the ABI encoding of a bytestring containing the ABI encoding of the list itself. Currently the list contains 2 elements. First, the access list: encoded as `tuple(address, bytes32[])[]`, i.e. a list of (address, keys) pairs. Second, the authorization list: encoded as `tuple(chain_id, address, nonce, y_parity, r, s)[]`. |
27+
| `reserved_dynamic` | `bytes` | Field used for extra functionality. |
2328

2429
### Transaction Types
2530

31+
Note that transaction types 0,1,2 and 4 are used for RLP-encoded L2 transactions, representing legacy, EIP-2930, EIP-1559 and EIP-7702 transactions.s
32+
2633
| Value | Description |
2734
|---------|---------------------------------------------------------------------------------------------------|
28-
| `0x0` | Legacy transaction. |
29-
| `0x1` | EIP-2930 transaction. |
30-
| `0x2` | EIP-1559 transaction. |
31-
| `0x4` | EIP-7702 transaction. |
3235
| `0x71` | EIP-712 transaction following the [Era format](https://docs.zksync.io/zksync-protocol/rollup/transaction-lifecycle#eip-712-0x71). |
3336
| `0x7E` | Upgrade transaction. |
3437
| `0x7F` | L1 -> L2 transaction. |
@@ -42,4 +45,4 @@ ZKsyncOS expects transactions with the following fields:
4245
| `2` | Reserved for future use. | Reserved for future use. |
4346
| `3` | Reserved for future use. | Reserved for future use. |
4447

45-
Transactions are encoded using the tightly packed ABI encoding for this list of fields. All numeric types are encoded as big-endian `U256`. Encoding and hashing of transactions is implemented in this [module](../../basic_bootloader/src/bootloader/transaction/mod.rs).
48+
These transactions are encoded using the tightly packed ABI encoding for this list of fields. All numeric types are encoded as big-endian `U256`. Encoding and hashing of transactions is implemented in this [module](../../basic_bootloader/src/bootloader/transaction/abi_encoded/mod.rs).

0 commit comments

Comments
 (0)