Skip to content
5 changes: 5 additions & 0 deletions ai/x402.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
description: 'Implement HTTP micropayments on Sei using x402 v2 for API monetization and digital services.'
keywords: ['x402', 'x402 v2', 'micropayments', 'HTTP 402', 'API monetization', 'Sei', 'payments', 'USDC', 'web3 payments']
---

import { X402PaymentFlow } from '/snippets/x402-diagrams.jsx';

x402 is an open protocol for HTTP-native payments. It lets clients pay for APIs, data, content, and other web resources through the standard `402 Payment Required` flow. A service can charge for a single request. The buyer does not have to create an account, manage a subscription, or negotiate a separate billing integration.

When a client requests a paid resource, the server responds with the price and payment terms. The client signs a payment authorization and retries the same request. The server verifies and settles the payment before it returns the resource.
Expand All @@ -30,6 +33,8 @@
- The **resource server** defines the price, validates the payment, and returns the protected resource.
- A **facilitator** can verify the authorization, submit the payment onchain, and return the settlement result. You can use a facilitator service, run your own, or settle payments directly.

<X402PaymentFlow />

<Steps>
<Step title="Request the resource">
The client sends a normal HTTP request to the paid endpoint.
Expand Down Expand Up @@ -164,7 +169,7 @@

Native USDC on Sei supports EIP-3009. With the `exact` EVM scheme, the buyer signs a transfer authorization instead of submitting the transfer transaction itself. The facilitator submits the transaction and pays the required gas.

## Protect an Express route

Check warning on line 172 in ai/x402.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

Sei.Headings

Use sentence case for headings: 'Protect an Express route'.

This x402 v2 example charges `0.001` USDC for `GET /weather` on Sei Testnet. Set `X402_FACILITATOR_URL` to a facilitator that supports `eip155:1328`.

Expand Down
5 changes: 4 additions & 1 deletion evm/differences-with-ethereum.mdx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
---

Check warning on line 1 in evm/differences-with-ethereum.mdx

View workflow job for this annotation

GitHub Actions / audit

Description is 210 chars (ideal 50-160)
title: 'Sei EVM vs Ethereum: Key Differences'
sidebarTitle: 'Divergence from Ethereum'
description: "A comparison of Sei EVM and Ethereum, highlighting Sei's advantages in blocktime, throughput, finality, and execution environment, as well as technical differences in opcodes, state storage, and other features."
Expand All @@ -6,6 +6,7 @@
---

import { SstoreGasLive } from '/snippets/sstore-gas-live.jsx';
import { PendingStateComparison } from '/snippets/finality-diagrams.jsx';

Sei has full EVM compatibility, but Sei EVM and Ethereum differ in some ways:

Expand Down Expand Up @@ -75,7 +76,7 @@
| DIFFICULTY | Alias of PREVRANDAO | Alias of PREVRANDAO (EIP‑4399) | Returns the same value as PREVRANDAO. |
| Blob‑related opcodes | Not supported (Pectra without blobs) | Supported post‑Cancun (EIP‑4844) | Blob transactions are not enabled on Sei. |

### PREVRANDAO

Check warning on line 79 in evm/differences-with-ethereum.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

Sei.Headings

Use sentence case for headings: 'PREVRANDAO'.

Proof of Stake (PoS) Ethereum uses pseudo‑randomness to determine the next
validator. Sei does not rely on the same method, so it does not have the
Expand Down Expand Up @@ -183,13 +184,15 @@

On Ethereum, the block proposer executes its proposed block first and updates
its local state. Then it broadcasts the proposal to others. The updated state
is marked "pending" until the node is accepted by other nodes.
is marked "pending" until the block is accepted by other nodes.

However, on Sei, the block proposer broadcasts the proposal first. It executes
the proposal only if the proposal is accepted. This means that every node
executes the block at roughly the same time, so Sei does not have a window
when a "pending state" exists.

<PendingStateComparison />

## Gas model & fees

Sei does not burn the base fee. All transaction fees go to validators. Fees are calculated as:
Expand All @@ -210,7 +213,7 @@

</Info>

## SSTORE gas cost

Check warning on line 216 in evm/differences-with-ethereum.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

Sei.Headings

Use sentence case for headings: 'SSTORE gas cost'.

On Sei, the gas cost of the `SSTORE` opcode is a configurable on-chain parameter. A governance proposal can adjust it without a chain upgrade. This lets governance tune storage costs based on EVM state size and network conditions.

Expand Down
4 changes: 4 additions & 0 deletions evm/evm-parity/finality.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ title: 'Finality and Block Tags'
description: 'How Sei instant finality affects block tag behavior and pending state'
---

import { BlockTagsComparison } from '/snippets/finality-diagrams.jsx';

# Finality and block tags

Sei uses Twin Turbo Consensus, which gives instant finality. Every committed block is final immediately. There is no period in which a reorganization could remove it.
Expand All @@ -19,6 +21,8 @@ On Ethereum, `latest`, `safe`, and `finalized` refer to different points in the

On Sei, all three tags resolve to the same block. After a block is committed, there is no reorg risk at any point, so the distinction does not exist.

<BlockTagsComparison />

<CodeGroup>

```ts viem
Expand Down
21 changes: 5 additions & 16 deletions learn/twin-turbo-consensus.mdx
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
---

Check warning on line 1 in learn/twin-turbo-consensus.mdx

View workflow job for this annotation

GitHub Actions / audit

Description is 198 chars (ideal 50-160)
title: "Twin Turbo Consensus: Sei's High-Speed Blockchain Consensus"
sidebarTitle: 'Consensus'
description: "Explore how Sei's Twin Turbo consensus mechanism achieves higher transaction throughput by separating block building from consensus, with detailed explanations of the protocol's design and benefits."
keywords: ['twin turbo consensus', 'high-speed blockchain', 'transaction throughput', 'blockchain performance', 'validator coordination', 'consensus mechanism']
---

import { TwinTurboPipeline } from '/snippets/consensus-diagrams.jsx';

## Introduction

Sei's consensus mechanism, often called Twin Turbo Consensus, is a set of optimizations designed for low block finality times. The target is approximately 400 milliseconds. Sei does not use a new consensus algorithm to reach this finality. Instead, Sei significantly enhances the underlying Tendermint Byzantine Fault Tolerant (BFT) consensus engine and tunes its configuration aggressively. The consensus engine also integrates tightly with Sei's parallel execution layer and the SeiDB storage system. The goal is near-instant transaction confirmation, which supports a new class of high-performance dApps, particularly dApps built for the EVM.
Expand All @@ -24,21 +27,7 @@
- At the same time, the validator takes part in the standard BFT prevote and precommit voting rounds for the proposed block `H`.
4. **Rapid finalization and commit:** Transaction execution overlaps significantly with the consensus voting process. This greatly reduces the time between reaching 2/3+ precommits for block `H` and having the resulting state changes ready to commit. When consensus is reached, the validated state changes that were buffered during parallel execution are committed efficiently to the underlying SeiDB storage layer. This commit uses the high I/O capabilities of SeiDB.

**Optimized & pipelined consensus**

<Columns cols={2}>
<Card horizontal title="Pre-consensus (TX preparation)">
- Transaction collection & analysis
- State prefetching (SeiDB)
</Card>
<Card horizontal title="Optimized BFT consensus (voting & concurrent execution)">
- Block proposal reception & initial validation
- BFT voting (prevote/precommit)
- Parallel TX execution (optimistic)
</Card>
</Columns>

_(Consensus reached)_ → **Finalize state & commit to SeiDB**
<TwinTurboPipeline />

This diagram shows the conceptual overlap. Transaction preparation feeds into a process where BFT voting happens _alongside_ parallel transaction execution. The preceding concurrent work lets the final commit to SeiDB happen quickly after consensus.

Expand All @@ -57,7 +46,7 @@

The rapid block times enable and encourage these development patterns:

**1. Minimal confirmation waits:** Off-chain applications and scripts should rely on one block confirmation (`txResponse.wait(1)`) for probabilistic finality. This significantly speeds up application logic that depends on transaction inclusion.
**1. Minimal confirmation waits:** Off-chain applications and scripts should rely on one block confirmation (`txResponse.wait(1)`), because a committed block is final. This significantly speeds up application logic that depends on transaction inclusion.

```javascript
// Fast transaction submission leveraging ~400ms finality
Expand Down
5 changes: 5 additions & 0 deletions node/statesync.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,17 @@
description: 'Detailed guide for using statesync to join the network'
keywords: ['sei node', 'blockchain node', 'node configuration', 'seidb', 'node maintenance', 'system operations']
---

import { StateSyncFlow } from '/snippets/statesync-diagrams.jsx';

Use state sync to start a new full node and join an existing network quickly.

## State sync

State sync lets a new node join a network without fetching and replaying all historical blocks. Instead, the node fetches a snapshot of the application state at a recent height. This can reduce the time to sync with the network from days to minutes.

<StateSyncFlow />

<Warning>Set `ss-backend = "pebbledb"` before you start state sync. This is especially important if you rebuild a node that previously used RocksDB. RocksDB support for the SeiDB state store will be removed, and there is no published target release for the removal. For the full migration checklist, see [Move off RocksDB](/node/node-operators#move-off-rocksdb).</Warning>

<Danger>Do not use state sync to migrate an archive node. State sync starts from a recent height and does not preserve the earlier state-store versions. Follow the archive-node guidance in [Move off RocksDB](/node/node-operators#move-off-rocksdb).</Danger>
Expand Down Expand Up @@ -50,7 +55,7 @@
cp $HOME/priv_validator_state.json $HOME/.sei/data/priv_validator_state.json
```

## Statesync script

Check warning on line 58 in node/statesync.mdx

View check run for this annotation

Mintlify / Mintlify Validation (seilabs) - vale-spellcheck

Sei.Headings

Use sentence case for headings: 'Statesync script'.

Set up the RPC servers for the primary and secondary endpoints. You can use one of these RPC endpoints for state sync.

Expand Down
16 changes: 8 additions & 8 deletions snippets/agentic-wallet-diagrams.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@ export const AgenticWalletFlow = () => {
},
{
title: 'The policy engine checks it',
text: 'Spending limits, address allowlists, and network rules run before anything is signed.'
text: 'Spending limits, address allowlists, and other guardrails run before anything is signed.'
},
{
title: 'The TEE signs',
text: 'The private key stays inside a Trusted Execution Environment (TEE). The signer hands back only the signed transaction.'
title: 'The signer signs',
text: <>In a managed wallet such as Privy, the private key stays inside a Trusted Execution Environment (TEE), and the signer hands back only the signed transaction. With a self-custodial <code>ViemWalletProvider</code>, you hold the key yourself and there is no TEE.</>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] The new caption says a self-custodial ViemWalletProvider has no TEE, but other parts of the diagram still say a TEE always signs: the step title ('The TEE signs', line 36), the stage node ('TEE signer', line 54), and the SVG aria-label ("the TEE signer signs it"). Readers and screen-reader users still get the claim this PR is meant to correct. Use a generic label such as "The signer signs" / "Signer" / "holds the key" and leave the provider-specific TEE detail to the caption.

Comment thread
cursor[bot] marked this conversation as resolved.
Resolved
},
{
title: "Broadcast to Sei's EVM RPC",
Expand All @@ -51,7 +51,7 @@ export const AgenticWalletFlow = () => {
{ label: 'LLM / agent', sub: 'decides what to do' },
{ label: 'Wallet SDK', sub: 'builds the transaction' },
{ label: 'Policy engine', sub: 'checks the rules' },
{ label: 'TEE signer', sub: 'holds the key' },
{ label: 'Signer', sub: 'holds the key' },
{ label: 'Sei EVM RPC', sub: 'broadcasts it' }
];
const stageX = (i) => 30 + i * 172;
Expand Down Expand Up @@ -164,7 +164,7 @@ export const AgenticWalletFlow = () => {
<div ref={rootRef} className="not-prose w-full my-5">
<div className="rounded-xl border p-4 text-neutral-800 dark:text-neutral-200" style={{ borderColor: hairline, backgroundColor: 'rgba(128, 128, 128, 0.05)' }}>
<div className="overflow-x-auto">
<svg viewBox="0 0 880 232" role="img" aria-label="An agentic wallet flow: the LLM agent decides, the wallet SDK builds the transaction, the policy engine checks it, the TEE signer signs it, and Sei's EVM RPC broadcasts it. A request over the spending limit stops at the policy engine" style={{ width: '100%', minWidth: 640, height: 'auto', display: 'block' }}>
<svg viewBox="0 0 880 232" role="img" aria-label="An agentic wallet flow: the LLM agent decides, the wallet SDK builds the transaction, the policy engine checks it, the signer signs it, and Sei's EVM RPC broadcasts it. A request over the spending limit stops at the policy engine" style={{ width: '100%', minWidth: 640, height: 'auto', display: 'block' }}>
<defs>
<marker id="awf-a" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
<path d="M 0 1 L 9 5 L 0 9 z" fill={ink} fillOpacity="0.6" />
Expand Down Expand Up @@ -193,7 +193,7 @@ export const AgenticWalletFlow = () => {
<g style={shown(step >= 2 && !rejected, 200)}>
<text x={centerX(2)} y={152} fontSize="9.5" textAnchor="middle" fill={ok}>✓ spending limit</text>
<text x={centerX(2)} y={167} fontSize="9.5" textAnchor="middle" fill={ok}>✓ allowlist</text>
<text x={centerX(2)} y={182} fontSize="9.5" textAnchor="middle" fill={ok}>✓ network</text>
<text x={centerX(2)} y={182} fontSize="9.5" textAnchor="middle" fill={ok}>✓ other guardrails</text>
</g>
<g style={shown(rejected, 300)}>
<text x={centerX(2)} y={152} fontSize="9.5" textAnchor="middle" fill={bad}>✕ over the spending limit</text>
Expand All @@ -205,11 +205,11 @@ export const AgenticWalletFlow = () => {
</g>

<g style={shown(step >= 3 && !rejected, 200)}>
<g transform={`translate(${centerX(3) - 46} 147)`}>
<g transform={`translate(${centerX(3) - 62} 147)`}>
<path d="M 2 0 v -3 a 4 4 0 0 1 8 0 v 3" fill="none" stroke={gold} strokeWidth="1.3" />
<rect x={0} y={0} width={12} height={9} rx={2} fill={gold} fillOpacity="0.5" stroke={gold} strokeWidth="1" />
</g>
<text x={centerX(3) + 8} y={155} fontSize="9.5" textAnchor="middle" fill={ink} fillOpacity="0.75">key stays inside</text>
<text x={centerX(3) - 44} y={155} fontSize="9.5" fill={ink} fillOpacity="0.75">key stays with the signer</text>
</g>
<text x={centerX(4)} y={152} fontSize="9.5" textAnchor="middle" fill={ok} style={shown(step === 4, 300)}>✓ submitted</text>

Expand Down
Loading
Loading