Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
141 changes: 141 additions & 0 deletions docs/general-info/gasless-transactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
---
sidebar_label: '⛽ Gasless Transactions'
title: Gasless Transactions on Status Network
description: Learn how Status Network implements gasless transactions using RLN (Rate Limiting Nullifier), and Karma tiers for spam prevention and fair usage.
keywords: [Status Network, Gasless Transactions, Linea, RLN, Rate Limiting Nullifier, Karma, Zero-Knowledge Proofs, ZKP, Soulbound Tokens, Blockchain, Layer 2, L2, Spam Prevention]
---

# Gasless Transactions in Status Network


Status Network aims to introduce gasless transactions at scale. The key component of this gasless approach is Vac's Rate Limiting Nullifier, which permits transaction rate limitation without the need for traditional gas fees. The document describes the architecture and integration elements needed to safely enable gasless transactions.

### 1.2 RLN

RLN is a zero-knowledge system designed to prevent spam without compromising user privacy unless a violation occurs. It replaces traditional gas fees with cryptographic rate limits enforced via ZKPs and Shamir's Secret Sharing.

RLN characteristics:

- **Zero-Knowledge Proofs:** Users generate ZKPs verifying their RLN group membership without revealing their identity. The group membership indicates the maximum gasless transaction throughput for each tier.
- **Shamir's Secret Sharing and Nullifiers:** Users hold a secret key used to generate unique nullifiers for transactions. If a user exceeds their transaction limit within an epoch (e.g., block or timestamp), their secret key becomes recoverable, exposing them.
- **Spam Detection:** Users exceeding limits effectively reveal their secret, leading to penalties like Deny List inclusion, higher future gas costs, or potential token slashing.

### 1.3. RLN Membership Management

RLN uses Sparse Merkle Trees to efficiently handle large-scale membership proofs. A benchmarking study determined that a tree height of 20, supporting 1 million accounts, provides optimal performance for proof generation and verification. For scalability beyond 1 million accounts, multiple SMTs can be used with a registry to direct users to the appropriate tree.

The Prover includes a Registrar Service that listens for events from the Karma Contract, where Karma is allocated to new addresses. Upon detecting such an event, the Registrar Service onboards the user to the RLN Membership Contract by generating and registering their RLN credentials (identitySecretHash and identityCommitment). The RLN Prover Service generates proofs for transactions, which are streamed via gRPC to the RLN Verifier in the Sequencer. The Verifier stores these proofs in memory and matches them with incoming transactions based on transaction hashes, as the process is asynchronous.

```mermaid
graph TD
A[User Wallet] -->|First L2 Action via Whitelisted App| B(Karma Issued)
A -->|Bridges into SN| B
B -->|Soulbound Token| C{Tier Assignment}

subgraph "Tier Limits"
D[Basic]
E[Active]
F[Regular]
G[Power User]
H[High-Throughput]
I[S-Tier]
end

C --> D
C --> E
C --> F
C --> G
C --> H
C --> I

%% RLN Flow
A -->|Submits Gasless Tx| J[RPC Node]
J -->|Forwards Tx Data| K[Prover]
subgraph "Prover Services"
K --> K1[Registrar Service]
K --> K2[RLN Prover Service]
K --> K3[Karma API Service]
K1 -->|Listens for Karma Events| L[Karma Contract]
K1 -->|Onboards User| M[RLN Membership Contract]
K2 -->|Generates RLN Proof| N[gRPC Stream]
K3 -->|Tracks Tx and Karma Tiers| O[Storage]
end
J -->|Sends Tx| P[Sequencer]
N -->|Streams RLN Proof| P

%% Sequencer Section
subgraph "Sequencer Operations"
P --> Q[RLN Verifier Plugin]
Q -->|Subscribes to gRPC Stream| N
Q -->|Stores Proofs In-Memory| R{Match Tx Hash}
R -->|Validates RLN Proof| S{Quota Check}
S -->|Within Limit| T[Add to Mempool]
S -->|Exceeds Limit| U[Deny List]
U -->|Flags Address| V[Premium Gas Required]
Q -->|Spam Detected| W[Slash RLN Stake]
end

%% Gas Estimation Flow
A -->|Requests Gas Estimate| X[Modified linea_estimateGas RPC]
X -->|Queries| U
U -->|Address Listed| Y[Apply Premium Gas Multiplier]
Y -->|Pay Premium Gas| Z[Remove from Deny List]
Z -->|Earn Karma| B
U -->|Address Not Listed| AA[Standard Gas Estimate]

%% Styling
classDef wallet fill:#FFD700,stroke:#DAA520,color:#333
classDef karma fill:#98FB98,stroke:#2E8B57,color:#333
classDef tier fill:#87CEFA,stroke:#4682B4,color:#333
classDef tierNode fill:#ADD8E6,stroke:#4682B4,color:#333
classDef rln fill:#FFB6C1,stroke:#DB7093,color:#333
classDef sequencer fill:#DDA0DD,stroke:#BA55D3,color:#333
classDef gas fill:#FFA07A,stroke:#FF4500,color:#333

class A wallet
class B,L karma
class C tier
class D,E,F,G,H,I tierNode
class J,K,K1,K2,K3,M,N,O rln
class P,Q,R,S,T,U,V,W sequencer
class X,Y,Z,AA gas
```

## 3. System Components

### 3.1 Prover

The Prover is a system comprising three services:

1. **Registrar Service**: Listens for Karma allocation events from the Karma Contract. When a new address receives Karma, it onboards the user to the RLN Membership Contract by generating RLN credentials and registering them.
2. **RLN Prover Service**: Generates RLN proofs for transactions using the Zerokit library. Proofs are streamed directly to the RLN Verifier in the Sequencer via a gRPC stream.
3. **Karma API Service**: Tracks transactions made by users within an epoch and maintains their Karma tier status. It stores transaction data in an internal database for efficient querying and tier management.

These services ensure secure credential management, proof generation, and transaction tracking, with gRPC enabling low-latency communication with the Sequencer.

### 3.2 RLN Verifier

The RLN Verifier is a besu plugin inside the sequencer, leveraging RLN's Zerokit Rust library via Java Native Interface.
The Verifier:

- Subscribes to the gRPC stream from the RLN Prover Service to receive RLN proofs as they are generated.
- Stores proofs in memory and matches them with incoming transactions based on transaction hashes, accounting for the asynchronous arrival of transactions (via RPC Node) and proofs (via gRPC).
- Verifies proof authenticity, nullifier uniqueness, and user transaction quotas.

Transactions failing verification are rejected, and users may be temporarily added to the Deny List.

### 3.3 Deny List

The Deny List temporarily restricts users exceeding quotas or engaging in spam:

- Entries expire after a set duration (e.g., hours or days) based on the throughput tiers
- Users can bypass restrictions by paying premium gas fees
- Paying premium fees removes users from the list and earns additional Karma

### 3.4 `linea_estimateGas` RPC Modification

The linea_estimateGas method is customised to account for users on the Deny List:

- Checks user's Deny List status
- Adds premium gas multipliers if needed
- Provides transparency and accurate gas estimations to the users
2 changes: 1 addition & 1 deletion docs/tools/testnet-faucets.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The Status Network testnet faucet is available at [faucet.status.network](https:

### Details
- **Faucet Contract**: [`0x06338B70F1eAbc60d7A82C083e605C07F78bb878`](https://sepoliascan.status.network/address/0x06338B70F1eAbc60d7A82C083e605C07F78bb878)
- **Amount**: 0.1 ETH per request
- **Amount**: 0.01 ETH per request
- **Cooldown**: One request per address per day

### How to Get Testnet ETH
Expand Down
5 changes: 5 additions & 0 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ const config: Config = {
},
},

markdown: {
mermaid: true,
},
themes: ['@docusaurus/theme-mermaid'],

plugins: [
[
'@acid-info/docusaurus-umami',
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
---
sidebar_label: '⛽ ガスレストランザクション'
title: Status Networkのガスレストランザクション
description: Status NetworkがRLN(Rate Limiting Nullifier)とKarmaティアを使用してスパム防止と公正な使用のためのガスレストランザクションを実装する方法を学びます。
keywords: [Status Network, ガスレストランザクション, Linea, RLN, Rate Limiting Nullifier, Karma, ゼロ知識証明, ZKP, ソウルバウンドトークン, ブロックチェーン, レイヤー2, L2, スパム防止]
---

# Status Networkのガスレストランザクション

Status Networkは大規模なガスレストランザクションの導入を目指しています。このガスレスアプローチの主要コンポーネントは、VacのRate Limiting Nullifierで、従来のガス手数料を必要とせずにトランザクション速度制限を可能にします。この文書では、ガスレストランザクションを安全に有効にするために必要なアーキテクチャと統合要素について説明します。

### 1.2 RLN

RLNは、違反が発生しない限りユーザーのプライバシーを損なうことなくスパムを防ぐように設計されたゼロ知識システムです。ZKPとShamirの秘密分散を通じて実行される暗号化速度制限で従来のガス手数料を置き換えます。

RLNの特徴:

- **ゼロ知識証明:** ユーザーは自分のアイデンティティを明かすことなくRLNグループメンバーシップを検証するZKPを生成します。グループメンバーシップは各ティアの最大ガスレストランザクション処理能力を示します。
- **Shamirの秘密分散とNullifier:** ユーザーはトランザクションの一意のnullifierを生成するために使用される秘密鍵を保持します。ユーザーがエポック(ブロックやタイムスタンプなど)内でトランザクション制限を超えると、秘密鍵が回復可能になり、露出します。
- **スパム検出:** 制限を超えるユーザーは効果的に自分の秘密を明かすことになり、拒否リストへの追加、将来の高いガス費用、または潜在的なトークンスラッシングなどのペナルティを受けます。

### 1.3. RLNメンバーシップ管理

RLNは大規模なメンバーシップ証明を効率的に処理するためにスパースマークルツリーを使用します。ベンチマーク研究により、100万アカウントをサポートする高さ20のツリーが証明生成と検証に最適なパフォーマンスを提供することが判明しました。100万アカウントを超えるスケーラビリティのために、レジストリと共に複数のSMTを使用してユーザーを適切なツリーに誘導できます。

ProverにはKarmaが新しいアドレスに割り当てられるKarma Contractからのイベントを監視するRegistrar Serviceが含まれています。そのようなイベントを検出すると、Registrar ServiceはRLN認証情報(identitySecretHashとidentityCommitment)を生成して登録し、ユーザーをRLN Membership Contractにオンボーディングします。RLN Prover Serviceはトランザクションの証明を生成し、gRPCを介してSequencerのRLN Verifierにストリーミングされます。Verifierはこれらの証明をメモリに保存し、プロセスが非同期であるため、トランザクションハッシュに基づいて受信トランザクションと照合します。

```mermaid
graph TD
A[ユーザーウォレット] -->|ホワイトリストアプリ経由の最初のL2アクション| B(Karma発行)
A -->|SNへのブリッジ| B
B -->|ソウルバウンドトークン| C{ティア割り当て}

subgraph "ティア制限"
D[Basic]
E[Active]
F[Regular]
G[Power User]
H[High-Throughput]
I[S-Tier]
end

C --> D
C --> E
C --> F
C --> G
C --> H
C --> I

%% RLNフロー
A -->|ガスレスTx送信| J[RPCノード]
J -->|Txデータ転送| K[Prover]
subgraph "Proverサービス"
K --> K1[Registrar Service]
K --> K2[RLN Prover Service]
K --> K3[Karma API Service]
K1 -->|Karmaイベント監視| L[Karma Contract]
K1 -->|ユーザーオンボーディング| M[RLN Membership Contract]
K2 -->|RLN証明生成| N[gRPCストリーム]
K3 -->|TxとKarmaティア追跡| O[ストレージ]
end
J -->|Tx送信| P[Sequencer]
N -->|RLN証明ストリーム| P

%% Sequencerセクション
subgraph "Sequencer操作"
P --> Q[RLN Verifierプラグイン]
Q -->|gRPCストリーム購読| N
Q -->|メモリに証明保存| R{Txハッシュマッチング}
R -->|RLN証明検証| S{クォータチェック}
S -->|制限内| T[Mempoolに追加]
S -->|制限超過| U[拒否リスト]
U -->|アドレスフラグ| V[プレミアムガス必要]
Q -->|スパム検出| W[RLNステークスラッシュ]
end

%% ガス推定フロー
A -->|ガス推定リクエスト| X[修正されたlinea_estimateGas RPC]
X -->|クエリ| U
U -->|アドレスリスト済み| Y[プレミアムガス倍率適用]
Y -->|プレミアムガス支払い| Z[拒否リストから削除]
Z -->|Karma獲得| B
U -->|アドレス未リスト| AA[標準ガス推定]

%% スタイリング
classDef wallet fill:#FFD700,stroke:#DAA520,color:#333
classDef karma fill:#98FB98,stroke:#2E8B57,color:#333
classDef tier fill:#87CEFA,stroke:#4682B4,color:#333
classDef tierNode fill:#ADD8E6,stroke:#4682B4,color:#333
classDef rln fill:#FFB6C1,stroke:#DB7093,color:#333
classDef sequencer fill:#DDA0DD,stroke:#BA55D3,color:#333
classDef gas fill:#FFA07A,stroke:#FF4500,color:#333

class A wallet
class B,L karma
class C tier
class D,E,F,G,H,I tierNode
class J,K,K1,K2,K3,M,N,O rln
class P,Q,R,S,T,U,V,W sequencer
class X,Y,Z,AA gas
```

## 3. システムコンポーネント

### 3.1 Prover

Proverは3つのサービスで構成されるシステムです:

1. **Registrar Service**: Karma ContractからKarma割り当てイベントを監視します。新しいアドレスがKarmaを受け取ると、RLN認証情報を生成して登録し、ユーザーをRLN Membership Contractにオンボーディングします。
2. **RLN Prover Service**: Zerokitライブラリを使用してトランザクションのRLN証明を生成します。証明はgRPCストリームを介してSequencerのRLN Verifierに直接ストリーミングされます。
3. **Karma API Service**: エポック内でユーザーが行ったトランザクションを追跡し、Karmaティアステータスを維持します。効率的なクエリとティア管理のために内部データベースにトランザクションデータを保存します。

これらのサービスは安全な認証情報管理、証明生成、トランザクション追跡を保証し、gRPCがSequencerとの低遅延通信を可能にします。

### 3.2 RLN Verifier

RLN Verifierはsequencer内のbesuプラグインで、Java Native Interfaceを介してRLNのZerokit Rustライブラリを活用します。
Verifierは:

- RLN Prover ServiceからgRPCストリームを購読して生成されるRLN証明を受信します。
- 証明をメモリに保存し、トランザクション(RPCノード経由)と証明(gRPC経由)の非同期到着を考慮して、トランザクションハッシュに基づいて受信トランザクションと照合します。
- 証明の真正性、nullifierの一意性、ユーザートランザクションクォータを検証します。

検証に失敗したトランザクションは拒否され、ユーザーは一時的に拒否リストに追加される場合があります。

### 3.3 拒否リスト

拒否リストはクォータを超過したりスパムに関与したりするユーザーを一時的に制限します:

- エントリは処理能力ティアに基づいて設定された期間(時間や日など)後に期限切れになります
- ユーザーはプレミアムガス手数料を支払うことで制限を回避できます
- プレミアム手数料を支払うとユーザーがリストから削除され、追加のKarmaを獲得します

### 3.4 `linea_estimateGas` RPC修正

linea_estimateGasメソッドは拒否リストのユーザーを考慮するようにカスタマイズされています:

- ユーザーの拒否リストステータスをチェックします
- 必要に応じてプレミアムガス倍率を追加します
- ユーザーに透明性と正確なガス推定を提供します
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Status Networkテストネットフォーセットは[faucet.status.network](htt

### 詳細
- **フォーセットコントラクト**: [`0x06338B70F1eAbc60d7A82C083e605C07F78bb878`](https://sepoliascan.status.network/address/0x06338B70F1eAbc60d7A82C083e605C07F78bb878)
- **配布量**: リクエストあたり0.1 ETH
- **配布量**: リクエストあたり0.01 ETH
- **クールダウン**: アドレスあたり1日1回のリクエスト

### テストネットETHの入手方法
Expand Down
Loading