블로그/What Is Sparse Merkle Tree (SMT)? How RLN Uses SMT for Rate Limiting
status-network-blog

What Is Sparse Merkle Tree (SMT)? How RLN Uses SMT for Rate Limiting

Kamila LipskaKamila Lipska
Mar 24, 2026
Sparse Merkle Tree diagram showing height-20 structure with rate limiting.

A Sparse Merkle Tree (SMT) is a fixed-size cryptographic tree where most leaves are empty by default. It proves membership or non-membership of any value in constant time without scanning every entry.

In blockchain rate limiting, SMTs allow protocols to track user quotas and detect violations using zero-knowledge proofs, without exposing identity or requiring gas fees per check.

What Is a Merkle Tree?

A Merkle Tree is a binary tree where each leaf holds a hash of data. Each parent node holds the combined hash of its two children. The root hash summarizes the entire dataset in a single value.

Change any leaf, and the root changes. This property makes Merkle Trees ideal for compact, tamper-evident proofs.

Standard Merkle Trees are built from actual data. You only store the leaves you have. The structure is dense and variable in size.

What Makes a Sparse Merkle Tree Different?

A Sparse Merkle Tree has a fixed, predetermined size. Every possible leaf position exists from the start, even if it holds no data.

Empty leaves store a known default value, typically a hash of zero. Non-empty leaves store actual data.

The key difference: you can prove that a leaf is empty just as easily as proving it is full. This is called a non-membership proof.

For a tree of height 20, there are 2^20 possible leaf positions, which equals exactly 1,048,576 slots. Most are empty. The tree is "sparse" because only a small fraction of leaves hold real values.

Why Height 20 Matters for RLN

Rate Limiting Nullifiers (RLN) on Status Network use an SMT of height 20. That number is not arbitrary.

Height 20 gives exactly 1 million possible account slots. This is the designed capacity for the system.

Each registered user occupies one leaf. The leaf stores a commitment derived from the user's secret key. The SMT root reflects the full state of all registered users at any point in time.

Provers generate ZK proofs against this root. Verifiers check those proofs without learning anything about the underlying secrets.

How Does RLN Use the SMT?

RLN is the spam-prevention mechanism powering gasless transactions on Status Network. Instead of charging gas per transaction, it enforces per-epoch message quotas using cryptographic rate limits.

Here is how the SMT fits into that system:

  1. Registration

A user registers by inserting a cryptographic commitment into the SMT. The commitment is derived from a secret they hold locally. No identity is revealed on-chain.

  1. Proof Generation

When sending a message, the user generates a ZK proof. The proof demonstrates two things: their commitment exists in the SMT (membership proof), and they have not exceeded their quota for the current epoch.

  1. Nullifier Output

Each valid message produces a nullifier. Two messages in the same epoch from the same user will produce the same nullifier. This is the detection mechanism.

  1. Quota Violation

If a nullifier appears twice, the protocol can reconstruct the user's secret key using Shamir's Secret Sharing. The user is then added to the Deny List.

The SMT is the foundation for step 2. Without efficient membership proofs, every quota check would require full tree traversal or expensive on-chain lookups.

Shamir's Secret Sharing: The Penalty Mechanism

Shamir's Secret Sharing splits a secret into shares. You need a minimum number of shares to reconstruct it.

In RLN, each message a user sends reveals one share of their private key. Sending within quota reveals only partial shares, which is not enough to reconstruct anything. Exceeding quota reveals enough shares to fully reconstruct the key.

Once the key is exposed, the system can slash or ban the user. This disincentivizes spam without requiring a central moderator or gas-based penalty.

The SMT enables this by making key commitment verification efficient inside a ZK circuit.

Zero-Knowledge Proofs Inside the SMT

Generating a ZK proof against an SMT works because the tree structure is deterministic.

For any given leaf position, the path from leaf to root is always the same length (equal to tree height). In a height-20 SMT, every proof path is exactly 20 hashes long.

This consistency is critical for ZK circuits. A circuit must have a fixed structure at compile time. Variable-length proof paths would require dynamic circuits, which are incompatible with current ZK proving systems like Groth16 or PLONK.

Fixed-height SMTs solve this. Every membership proof is the same size. Every circuit is the same shape.

SMT vs. Standard Merkle Tree: Direct Comparison

Why Not Use Gas Fees for Spam Prevention?

The traditional answer to spam on a blockchain is gas. If every transaction costs money, spamming becomes expensive.

Status Network rejects this model entirely. The network is designed to be gasless for users. Charging gas for spam prevention would contradict the core design.

RLN with SMTs provides a cryptographic alternative. Spam is disincentivized by the risk of key exposure, not by monetary cost. Users who stay within quota pay nothing and reveal nothing.

This aligns with the broader economic model: native yield from bridged assets (ETH converting to stETH, DAI converting to sDAI) funds network operations, while ZK-based rate limiting handles security.

The Deny List: What Happens to Quota Violators

Users who exceed their quota and have their key reconstructed are added to the Deny List. Their SMT commitment is marked invalid.

Future messages from that commitment will fail the membership proof. The ZK verifier rejects invalid commitments at the proof level, before any message is processed.

Importantly, a banned user is not permanently excluded. They can earn Karma back over time, which may restore their gasless transaction quota. Karma is a soulbound reputation token on Status Network, earned through staking SNT, bridging assets, providing liquidity, and other contributions.

This creates a recovery path without a centralized appeals process. The system is self-governing.

Frequently Asked Questions

What is a Sparse Merkle Tree in simple terms?

A Sparse Merkle Tree is a fixed-size cryptographic tree where every possible leaf position exists from the start. Empty positions store a default zero hash. This design allows efficient proofs of both presence and absence without scanning the entire tree.

Why does RLN on Status Network use a height-20 Sparse Merkle Tree?

Height 20 creates exactly 1,048,576 leaf slots, enough to register 1 million accounts. This fixed size also ensures every ZK proof path is exactly 20 hashes long, which is required for the ZK circuit to have a consistent, compile-time structure.

What is a non-membership proof and why does it matter for rate limiting?

A non-membership proof cryptographically demonstrates that a value does not exist in the tree. In rate limiting, this allows the system to verify that a user has not already consumed their quota for a given epoch, without revealing any details about other users or their activity.

How does Shamir's Secret Sharing work with RLN to punish spammers?

Each message a user sends reveals one share of their private key, derived using Shamir's Secret Sharing. Staying within quota reveals too few shares to reconstruct the key. Exceeding quota reveals enough shares to reconstruct and expose the key, triggering removal from the system.

Can a user recover from being added to the RLN Deny List on Status Network?

Yes. Users on the Deny List can earn Karma back through contributions such as SNT staking, bridging assets, or providing liquidity. Accumulating sufficient Karma can restore their gasless transaction quota over time, without requiring any centralized intervention.

Why are Sparse Merkle Trees better than standard Merkle Trees for ZK proofs?

Standard Merkle Trees have variable depth depending on how many leaves are populated. ZK circuits require a fixed structure at compile time.

Sparse Merkle Trees have a constant height regardless of how many leaves are filled, making every proof path the same length and compatible with ZK proving systems.

What is a nullifier in the context of RLN rate limiting?

A nullifier is a deterministic output produced when a user sends a message within a given epoch. If the same user sends two messages in the same epoch, both messages produce the same nullifier. Duplicate nullifiers reveal the secret key shares needed to identify and ban the account.

Does the RLN Sparse Merkle Tree store user identities on-chain?

No. The SMT stores cryptographic commitments derived from users' secret keys, not identities. No personal information or wallet address is embedded in the commitment. The ZK proof system allows quota verification without revealing who the user is.