Skip to content

Commit f96cae7

Browse files
authored
Celo tx refactor (#1980)
* Update overview.md: remove warning and outdated information * Update transaction-types.mdx: correct title casing and remove outdated warnings * Update transaction documentation: remove outdated warnings and improve formatting * Fix typos
1 parent 02c0e62 commit f96cae7

File tree

3 files changed

+36
-62
lines changed

3 files changed

+36
-62
lines changed

docs/what-is-celo/using-celo/protocol/transaction/overview.md

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,18 @@ description: Introduction to transactions on Celo.
55

66
# Transactions on Celo
77

8-
Introduction to transactions on Celo.
8+
In Celo's transition to a Layer 2 (L2) solution, several key changes have been proposed to the network's tokenomics, particularly concerning gas pricing and transaction fee allocation.
99

1010
---
1111

12-
## Gas Pricing
13-
1412
:::info
1513

1614
This section is a work in progress and based on the ["The Great Celo Halvening - Proposed Tokenomics in the Era of Celo L2"](https://forum.celo.org/t/the-great-celo-halvening-proposed-tokenomics-in-the-era-of-celo-l2/9701/1). Please check the [forum](https://forum.celo.org/) for the latest information.
1715
:::
1816

19-
In Celo's transition to a Layer 2 (L2) solution, several key changes have been proposed to the network's tokenomics, particularly concerning gas pricing and transaction fee allocation.
20-
2117
## Gas Pricing Mechanism
2218

23-
Celo employs a gas pricing model based on **EIP-1559**, which dynamically adjusts the base fee to manage network demand. This mechanism ensures that gas prices respond to network congestion, increasing during high demand periods and decreasing when demand is low. The protocol sets a **base fee floor** to prevent the base fee from falling below a certain threshold, safeguarding the network against spam transactions and uncontrolled state growth.
19+
Celo employs a gas pricing model based on **EIP-1559**, which dynamically adjusts the base fee to manage network demand. This mechanism ensures that gas prices respond to network congestion, increasing during high demand periods and decreasing when demand is low. The protocol sets a **base fee floor** to prevent the base fee from falling below a certain threshold, safeguarding the network against spam transactions and uncontrolled state growth.
2420

2521
## Fee Abstraction
2622

@@ -42,10 +38,10 @@ With the shift to L2, the allocation of transaction fees has been restructured t
4238

4339
- **Sequencer and Batcher Operations**: Supporting the infrastructure that orders and batches transactions on the network.
4440

45-
- **Revenue Sharing with the OP-Stack**: Complying with the Superchain Ecosystem requirements, which involve sharing revenue with the OP-Stack.
41+
- **Revenue Sharing with the OP-Stack**: Complying with the Superchain Ecosystem requirements, which involve sharing revenue with the OP-Stack.
4642

4743
This reallocation ensures that transaction fees are utilized effectively to maintain network sustainability and operational efficiency in the L2 environment.
4844

4945
## Conclusion
5046

51-
Celo's transition to L2 introduces significant changes to gas pricing and transaction fee allocation, aligning with the network's goals of sustainability, user accessibility, and robust operational support. These adjustments are designed to enhance the overall efficiency and resilience of the Celo ecosystem.
47+
Celo's transition to L2 introduces significant changes to gas pricing and transaction fee allocation, aligning with the network's goals of sustainability, user accessibility, and robust operational support. These adjustments are designed to enhance the overall efficiency and resilience of the Celo ecosystem.

docs/what-is-celo/using-celo/protocol/transaction/transaction-types.mdx

Lines changed: 21 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: Transaction types on Celo
2+
title: Transaction Types on Celo
33
description: This page contains an explainer on transaction types supported on Celo and a demo to make specific transactions.
44
---
55

@@ -8,37 +8,22 @@ import TabItem from "@theme/TabItem";
88

99
This page contains an explainer on transaction types supported on Celo and a demo to make specific transactions.
1010

11-
> **IMPORTANT**
12-
> This repo is for educational purposes only. The information provided here may be inaccurate.
13-
> Please don't rely on it exclusively to implement low-level client libraries.
14-
15-
:::warning
16-
As of block height 31,056,500 (March 26, 2025, 3:00 AM UTC), Celo is no longer a standalone Layer 1 blockchain—it is now an Ethereum Layer 2!
17-
Some documentation may be outdated as updates are in progress. If you encounter issues, please [file a bug report](https://github.com/celo-org/docs/issues/new/choose).
18-
19-
For the most up-to-date information, refer to our [Celo L2 documentation](https://docs.celo.org/cel2).
20-
:::
11+
---
2112

2213
## Summary
2314

24-
Celo has support for all Ethereum transaction types (i.e. "100% Ethereum compatibility")
25-
and a single Celo transaction type.
15+
Celo has support for all Ethereum transaction types (i.e. "100% Ethereum compatibility") and a single Celo transaction type.
2616

27-
### Actively supported on Celo
17+
### Actively Supported on Celo
2818

2919
| Chain | Transaction type | # | Specification | Recommended | Support | Comment |
3020
| ----------------------------------------------------------------------- | -------------------------- | ----- | ------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- | --------- | -------------------------------------------------------- |
3121
| <img width="20" src="/img/doc-images/transaction-types/Celo.jpg" /> | Dynamic fee transaction v2 | `123` | [CIP-64](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0064.md) || Active 🟢 | Supports paying gas in custom fee currencies |
22+
| <img width="20" src="/img/doc-images/transaction-types/Ethereum.png" /> | Set code transaction | `4` | [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) | Available since the Isthmus hardfork |
3223
| <img width="20" src="/img/doc-images/transaction-types/Ethereum.png" /> | Dynamic fee transaction | `2` | [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559) ([CIP-42](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0042.md)) || Active 🟢 | Typical Ethereum transaction |
3324
| <img width="20" src="/img/doc-images/transaction-types/Ethereum.png" /> | Access list transaction | `1` | [EIP-2930](https://eips.ethereum.org/EIPS/eip-2930) ([CIP-35](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0035.md)) || Active 🟢 | Does not support dynamically changing _base fee_ per gas |
3425
| <img width="20" src="/img/doc-images/transaction-types/Ethereum.png" /> | Legacy transaction | `0` | [Ethereum Yellow Paper](https://ethereum.github.io/yellowpaper/paper.pdf) ([CIP-35](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0035.md)) || Active 🟢 | Does not support dynamically changing _base fee_ per gas |
3526

36-
### Scheduled for support on Celo
37-
38-
| Chain | Transaction type | # | Specification | Comment |
39-
| ----------------------------------------------------------------------- | -------------------- | --- | --------------------------------------------------- | ----------------------------------------------------------------------- |
40-
| <img width="20" src="/img/doc-images/transaction-types/Ethereum.png" /> | Set code transaction | `4` | [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) | Available from the [Isthmus](/cel2/notices/isthmus-upgrade.md) hardfork |
41-
4227
### Deprecated on Celo
4328

4429
| Chain | Transaction type | # | Specification |   Support | Comment |
@@ -53,7 +38,7 @@ The stages of support are:
5338
because it might be deprecated in the future.
5439
- **Deprecated** 🔴: the transaction type is not supported and not recommended for use.
5540

56-
### Client library support
41+
### Client Library Support
5742

5843
Legend:
5944

@@ -79,7 +64,7 @@ Legend:
7964

8065
## Background
8166

82-
### Legacy transactions
67+
### Legacy Transactions
8368

8469
Ethereum originally had one format for transactions (now called "legacy transactions").
8570
A legacy transaction contains the following transaction parameters:
@@ -108,7 +93,7 @@ To produce a valid "legacy transaction":
10893
A valid signed transaction can then be submitted on-chain, and its raw parameters can be
10994
parsed by RLP-decoding the transaction.
11095

111-
### Typed transactions
96+
### Typed Transactions
11297

11398
Over time, the Ethereum community has sought to add new types of transactions
11499
such as dynamic fee transactions
@@ -122,7 +107,7 @@ legacy transaction format, the concept of **typed transactions** was proposed in
122107
[EIP-2718: Typed Transaction Envelope](https://eips.ethereum.org/EIPS/eip-2718), which introduces
123108
a new high-level transaction format that is used to implement all future transaction types.
124109

125-
### Distinguishing between legacy and typed transactions
110+
### Distinguishing Between Legacy and Typed Transactions
126111

127112
Whereas a valid "legacy transaction" is simply an RLP-encoded list of
128113
**transaction parameters**, a valid "typed transactions" is an arbitrary byte array
@@ -152,9 +137,9 @@ Every transaction type is defined in an EIP, which specifies how to _encode_ as
152137
transaction payloads. This means that a typed transaction can only be interpreted with knowledge of
153138
its transaction type and a relevant decoder.
154139

155-
## List of transaction types on Celo
140+
## List of Transaction Types on Celo
156141

157-
### <img width="12" src="/img/doc-images/transaction-types/Ethereum.png" /> Legacy transaction (`0`)
142+
### <img width="12" src="/img/doc-images/transaction-types/Ethereum.png" /> Legacy Transaction (`0`)
158143

159144
:::note
160145
This transaction type is 100% compatible with Ethereum and has no Celo-specific parameters.
@@ -177,7 +162,7 @@ they are commonly referred to as "type 0" transactions.
177162
on [May 19, 2021](https://blog.celo.org/donut-hardfork-is-live-on-celo-585e2e294dcb)
178163
as specified in [CIP-35: Support for Ethereum-compatible transactions](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0035.md).
179164

180-
### <img width="12" src="/img/doc-images/transaction-types/Ethereum.png" /> Access list transaction (`1`)
165+
### <img width="12" src="/img/doc-images/transaction-types/Ethereum.png" /> Access List Transaction (`1`)
181166

182167
:::note
183168
This transaction type is 100% compatible with Ethereum and has no Celo-specific parameters.
@@ -198,7 +183,7 @@ This transaction type is 100% compatible with Ethereum and has no Celo-specific
198183
on [May 19, 2021](https://blog.celo.org/donut-hardfork-is-live-on-celo-585e2e294dcb)
199184
as specified in [CIP-35: Support for Ethereum-compatible transactions](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0035.md).
200185

201-
### <img width="12" src="/img/doc-images/transaction-types/Ethereum.png" /> Dynamic fee transaction (`2`)
186+
### <img width="12" src="/img/doc-images/transaction-types/Ethereum.png" /> Dynamic Fee Transaction (`2`)
202187

203188
:::note
204189
This transaction type is 100% compatible with Ethereum and has no Celo-specific parameters.
@@ -219,7 +204,7 @@ This transaction type is 100% compatible with Ethereum and has no Celo-specific
219204
on [Mar 8, 2022](https://blog.celo.org/brewing-the-espresso-hardfork-92a696af1a17) as specified
220205
in [CIP-42: Modification to EIP-1559](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0042.md)
221206

222-
### <img width="12" src="/img/doc-images/transaction-types/Ethereum.png" /> Set code transaction (`4`)
207+
### <img width="12" src="/img/doc-images/transaction-types/Ethereum.png" /> Set Code Transaction (`4`)
223208

224209
:::note
225210
This transaction type is 100% compatible with Ethereum and has no Celo-specific parameters.
@@ -238,7 +223,7 @@ This transaction type is 100% compatible with Ethereum and has no Celo-specific
238223
- It is scheduled for support on Celo during the
239224
[Celo Isthmus](/cel2/notices/isthmus-upgrade.md) hardfork.
240225

241-
### <img width="14" src="/img/doc-images/transaction-types/Celo.jpg" /> Legacy transaction (`0`)
226+
### <img width="14" src="/img/doc-images/transaction-types/Celo.jpg" /> Legacy Transaction (`0`)
242227

243228
:::danger
244229
This transaction type is no longer supported following the migration to Celo L2.
@@ -259,7 +244,7 @@ parameters: `feecurrency`, `gatewayfeerecipient`, and `gatewayfee`.
259244
[Apr 22, 2020](https://dune.com/queries/3106924/5185945) as specified in
260245
[Blockchain client v1.0.0](https://github.com/celo-org/celo-blockchain/tree/celo-v1.0.0).
261246

262-
### <img width="14" src="/img/doc-images/transaction-types/Celo.jpg" /> Dynamic fee transaction (`124`)
247+
### <img width="14" src="/img/doc-images/transaction-types/Celo.jpg" /> Dynamic Fee Transaction (`124`)
263248

264249
:::danger
265250
This transaction type is no longer supported following the migration to Celo L2.
@@ -286,7 +271,7 @@ parameters: `feecurrency`, `gatewayfeerecipient`, and `gatewayfee`.
286271
on [Mar 8, 2022](https://blog.celo.org/brewing-the-espresso-hardfork-92a696af1a17) as specified
287272
in [CIP-42: Modification to EIP-1559](https://github.com/celo-org/celo-proposals/blob/master/CIPs/cip-0042.md).
288273

289-
### <img width="14" src="/img/doc-images/transaction-types/Celo.jpg" /> Dynamic fee transaction v2 (`123`)
274+
### <img width="14" src="/img/doc-images/transaction-types/Celo.jpg" /> Dynamic Fee Transaction v2 (`123`)
290275

291276
:::warning
292277
This transaction is not compatible with Ethereum and has one Celo-specific
@@ -358,7 +343,7 @@ const walletClient = createWalletClient({
358343

359344
</Tabs>
360345

361-
### Function to print Transaction receipt
346+
### Function to Print Transaction Receipt
362347

363348
<Tabs>
364349

@@ -403,7 +388,7 @@ const walletClient = createWalletClient({
403388

404389
</Tabs>
405390

406-
### Code to send Transaction Type (0)
391+
### Code to Send Transaction Type (0)
407392

408393
<Tabs>
409394

@@ -436,7 +421,7 @@ const walletClient = createWalletClient({
436421

437422
</Tabs>
438423

439-
### Code to send Transaction Type (2)
424+
### Code to Send Transaction Type (2)
440425

441426
<Tabs>
442427

@@ -470,7 +455,7 @@ const walletClient = createWalletClient({
470455

471456
</Tabs>
472457

473-
### Code to send Transaction Type (123)
458+
### Code to Send Transaction Type (123)
474459

475460
<Tabs>
476461

docs/what-is-celo/using-celo/protocol/transaction/tx-comment-encryption.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,33 @@ description: Overview of encrypted payment comments and its technical details re
77

88
In this section, you will find detailed information about the various transaction types supported on Celo, including encrypted payment comments and their technical details, as well as insights into gas pricing and fee abstraction.
99

10-
:::warning
11-
As of block height 31,056,500 (March 26, 2025, 3:00 AM UTC), Celo is no longer a standalone Layer 1 blockchain—it is now an Ethereum Layer 2!
12-
Some documentation may be outdated as updates are in progress. If you encounter issues, please [file a bug report](https://github.com/celo-org/docs/issues/new/choose).
13-
14-
For the most up-to-date information, refer to our [Celo L2 documentation](https://docs.celo.org/cel2).
15-
:::
16-
1710
---
1811

19-
### Introduction to Comment Encryption
12+
## Introduction to Comment Encryption
2013

2114
As part of Celo's identity protocol, a public encryption key is stored along with a user's address in the `Accounts` contract.
2215

2316
Both the address key pair and the encryption key pair are derived from the backup phrase. When sending a transaction the encryption key of the recipient is retrieved when getting his or her address. The comment is then encrypted using a 128 bit hybrid encryption scheme \(ECDH on secp256k1 with AES-128-CTR\). This system ensures that comments can only be read by the sending and receiving parties and that messages will be recovered when restoring a wallet from its backup phrase.
2417

25-
### Comment Encryption Technical Details
18+
## Comment Encryption Technical Details
2619

2720
A 128 bit randomly generated session key, sk, is generated and used to symmetrically encrypt the comment. sk is asymmetrically encrypted to the sender and to the recipient.
2821

2922
`Encrypted = ECIES(sk, to=pubSelf) | ECIES(sk, to=pubOther) | AES(ke=sk, km=sk, comment)`
3023

31-
#### ‌Symmetric Encryption \(AES-128-CTR\)
24+
### ‌Symmetric Encryption \(AES-128-CTR\)
3225

3326
- Takes encryption key, ke, and MAC key, km, and the data to encrypt, plaintext
3427
- Cipher: AES-128-CTR using a randomly generated iv
3528
- Authenticate iv \| ciphertext using HMAC with SHA-256 and km
3629
- Return iv \| ciphertext \| mac
3730

38-
#### Asymmetric Encryption \(ECIES\)
31+
### Asymmetric Encryption \(ECIES\)
3932

40-
1. Takes data to encrypt, plaintext, and the public key of the recipient, pubKeyTo
41-
2. Generate an ephemeral keypair, ephemPubKey and ephemPrivKey
42-
3. Derive 32 bytes of key material, k, from ECDH between ephemPrivKey and pubKeyTousing ConcatKDF \(specified as NIST 800-56C Rev 1 One Step KDF\) with SHA-256 for H\(x\)
43-
4. The encryption key, ke, is the first 128 bits of k
44-
5. The MAC key, km, is SHA-256 of the second 128 bits of k
45-
6. Encrypt the plaintext symmetrically with AES-128-CTR using ke, km, and a random iv
46-
7. Return ephemPubKey \| AES-128-CTR-HMAC\(ke, km, plaintext\) where the public key needs to be uncompressed \(current limitation with decrypt\).
33+
1. Takes data to encrypt, plaintext, and the public key of the recipient, pubKeyTo
34+
2. Generate an ephemeral keypair, ephemPubKey and ephemPrivKey
35+
3. Derive 32 bytes of key material, k, from ECDH between ephemPrivKey and pubKeyTousing ConcatKDF \(specified as NIST 800-56C Rev 1 One Step KDF\) with SHA-256 for H\(x\)
36+
4. The encryption key, ke, is the first 128 bits of k
37+
5. The MAC key, km, is SHA-256 of the second 128 bits of k
38+
6. Encrypt the plaintext symmetrically with AES-128-CTR using ke, km, and a random iv
39+
7. Return ephemPubKey \| AES-128-CTR-HMAC\(ke, km, plaintext\) where the public key needs to be uncompressed \(current limitation with decrypt\).

0 commit comments

Comments
 (0)