www.alchemy.com Open in urlscan Pro
2606:4700:4400::ac40:9a6d  Public Scan

URL: https://www.alchemy.com/overviews/what-is-a-mempool
Submission: On May 24 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

zkSync is live on Alchemy! Deploy on zkSync Mainnet and zkSync Sepolia Testnet
today.
Get started
Products
APIsChainsSDKsTools

Supernode

The web3 engine

NFT API

Build any NFT app

Token API

Token balances and metadata

Transact

Send transactions 7.9x faster

Transfers API

Complete transaction history in one call

Transaction Simulation

Transaction previews for any use case

Pipelines

beta

Blockchain data pipelines made easy

Subgraphs

Speedy indexing for custom GraphQL APIs

Webhooks

Fast, consistent push notifications

Custom Webhooks

Real-time data for custom events

Smart Websockets

Blockchain connection for ongoing data

Embedded Accounts

Plug-n-play web3 accounts with web2 UX

Account Contracts

Smart contract accounts for every use case

Gas Manager API

Cover gas costs for your users

Bundler API

Reliably land UserOps onchain


Solutions
Case studiesVerticals

Polygon

95% app growth

Optimism

Unleashing developer success

Treasure

Cut indexing times 50%

Royal

$400k engineering costs saved

OpenSea

$33B+ in ETH and Polygon sales

Collab.Land

Powering +40k communities

Zapper

30% cost savings

Decentral Games

99.99% uptime

0x

Billions of dollars traded on 0x. Powered by Alchemy.

View all case studies
Enterprise
Company

About us



Careers



Ventures



Startup Program



Newsroom



Newsletter



Blog



Contact sales



Join the best team in web3

See careers

Developers

Get started

Documentation



Alchemy API Overview



Alchemy Quickstart Guide



SDK Quickstart



AA SDK Quickstart



Account Kit



Learn Web3 Development

Alchemy University



JavaScript for Ethereum



Learn Solidity



Ethereum Bootcamp



Alchemy University Discord



Web3 Tutorials



Resources

Status



Faucets



Overviews



Dapp Store



Gwei Calculator



Learn Account Abstraction



Pricing
Contact sales
Sign in



Products
APIsChainsSDKsTools

Supernode

The web3 engine

NFT API

Build any NFT app

Token API

Token balances and metadata

Transact

Send transactions 7.9x faster

Transfers API

Complete transaction history in one call

Transaction Simulation

Transaction previews for any use case

Pipelines

beta

Blockchain data pipelines made easy

Subgraphs

Speedy indexing for custom GraphQL APIs

Webhooks

Fast, consistent push notifications

Custom Webhooks

Real-time data for custom events

Smart Websockets

Blockchain connection for ongoing data

Embedded Accounts

Plug-n-play web3 accounts with web2 UX

Account Contracts

Smart contract accounts for every use case

Gas Manager API

Cover gas costs for your users

Bundler API

Reliably land UserOps onchain


Solutions
Case studiesVerticals

Polygon

95% app growth

Optimism

Unleashing developer success

Treasure

Cut indexing times 50%

Royal

$400k engineering costs saved

OpenSea

$33B+ in ETH and Polygon sales

Collab.Land

Powering +40k communities

Zapper

30% cost savings

Decentral Games

99.99% uptime

0x

Billions of dollars traded on 0x. Powered by Alchemy.

View all case studies
Enterprise
Company

About us



Careers



Ventures



Startup Program



Newsroom



Newsletter



Blog



Contact sales



Join the best team in web3

See careers

Developers

Get started

Documentation



Alchemy API Overview



Alchemy Quickstart Guide



SDK Quickstart



AA SDK Quickstart



Account Kit



Learn Web3 Development

Alchemy University



JavaScript for Ethereum



Learn Solidity



Ethereum Bootcamp



Alchemy University Discord



Web3 Tutorials



Resources

Status



Faucets



Overviews



Dapp Store



Gwei Calculator



Learn Account Abstraction



Pricing

0%
HomeOverviewsEthereum
What is a Mempool?


WHAT IS A MEMPOOL?

Written by Alchemy

Reviewed by Brady Werkheiser

Published on 2022-04-074 min read

--------------------------------------------------------------------------------

In a blockchain transaction, a mempool, or memory pool, is a list of pending
transactions waiting for validation from a node before it is committed to a
block on the blockchain. This is similar to using 'Staging' environments in
traditional software development to perform testing and quality control before
releasing to production. 

While traditional 'Staging' environments are centralized, each node has its own
mempool to manage. Let's look at the transaction flow to understand the purpose
of the mempool and how, by accessing it, we can learn important information: 


ETHEREUM TRANSACTION FLOW

Ethereum transactions fall into 3 categories: 

1) Simple Transfer - value is sent from one public address to another address.
This could be a payment for an NFT or a service. 

2) Deployment of a smart contract - whenever a smart contract is deployed on the
blockchain, it creates a transaction. 

3) Execution of a smart contract - if an address would like to send funds or
data to a smart contract address. 

You can monitor Ethereum transactions using an Alchemy's monitoring tool, and
find the history of transactions for a given address by using tools like the
Alchemy Transfers API

Every type of Ethereum transaction follows the same transaction lifecycle: 

1) A user creates a transaction and signs using their private key. 

2) A node receives the transaction and stores it in the mempool 

3) While in the mempool, the node performs validation tests of the transaction.
If the mempool pass the tests, the transaction status is moved to 'Pending'

4) The node broadcasts the pending transaction to all other nodes on the network
to add the transaction to their own mempools.

5) A block constructor will then include the transactions with the highest gas
prices once a new block is created. This will move the transaction to a
'Successful' state. 

6) Transactions will receive confirmations after the node adds each new block
after the one it is included in. This provides assurance that the transaction is
permanently added to the blockchain, since the risk of block reorganizing
decreases over time. 

Ethereum transaction flow

You can learn more about sending transactions and send your own here. 


PURPOSE OF A MEMPOOL

Since blockchains are immutable, it is important that transactions entered onto
the blockchain are valid and without errors. The node hosting the mempool plays
an important role in validating each transaction before the process is started
to commit it to the blockchain.

For developers, it is important to understand the validation tests to understand
why transactions might fail or be stuck in 'Pending' state: 


1. AVAILABILITY OF FUNDS 

The node validates whether the sender address has enough funds to cover the cost
of both the funds being sent and the gas for completing the transaction. If this
validation fails, the transaction will be removed from the mempool. It is
important to use the correct parameters of sending and the destination address
to ensure that this validation is passed. 


2. VALIDITY OF TRANSACTION SIGNATURES

Each transaction needs to be signed by the sender's address. This is to identify
that the sender is indeed the address owner. The node will validate that the
signature is the correct one attached to the sender's address. 

Validity of Transaction Signatures


3. CORRECT NONCE VALUE 

The nonce value is the number of transactions that have been sent from the
sender address. Each time a sender transaction sends a new transaction, the
nonce value is increased by 1.  The nonce value is important because it forces
each transaction from a given address to happen in the order in which they were
sent. 

Node validation of Nonce value

When the transaction’s nonce values cannot be duplicated or skipped, this
prevents the issue of double-spending or overspending available funds. The node
validates that the correct nonce value is attached to the pending transaction.
If this test fails, the transaction will not progress. 


4. GAS PRICE

Depending on the mempool, there is a limit to how many transactions can be in
the mempool at once. Geth, the popular Ethereum client, has a default limit of
4096 pending and 1024 queued transactions. When this limit is reached, the
transactions with the lowest gas prices are removed from the pool to manage the
space.  


ACCESS A MEMPOOL

A major advantage to the mempool structure is replacement transactions can
overwrite pending transactions to correct, speed up, or cancel them altogether.
You can find out how to speed up transactions so they are picked up by miners
faster using Metamask. 

Other than correcting pending transactions stuck in a mempool, accessing a
mempool can be useful for other cases such as: 

 1. Estimating Gas Fees

Looking at the current pending transaction list and their connected fees can
help avoid overpaying fees.

2. NFT Mining

‍By using a mempool scanner, users can get insight into pending transactions
interacting with NFT contracts and outbid those transactions with higher gas
fees. 

3. Performance Insights‍

By using services like the Notify API, smart contract developers can get
insights on smart contract activity from the mempool. Pending transactions can
give information on bugs and vulnerabilities of a smart contract. 


CONCLUSION

A mempool plays an important part in the function and health of a blockchain.
Allowing nodes to validate transactions and miners to prioritize pending
transactions according to gas fees is an essential part for the flow of
transactions.

Developers can also use the data provided by a mempool to reduce costs and
issues in their smart contracts. Mempools have been often described as "dark
forests" of a blockchain but platforms like Alchemy Monitoring tools enable
users to get more clarity in this critical step. 

Get free Ethereum RPCs and developer tools
Get your API key
📚 Table of contents

--------------------------------------------------------------------------------

 * Ethereum Transaction Flow
 * Purpose of a mempool
 * Access a mempool
 * Conclusion

Share:



RELATED OVERVIEWS

Ethereum
Ethereum Sharding: An Introduction to Blockchain Sharding

What is Blockchain Sharding and How Does it Relate to Ethereum?


Ethereum
What are reinforced transactions?

Explore a New Transaction Type that Guarantees Transactions are Mined and
Optimized for Gas


Ethereum
What are Ethereum commitment levels?

Learn About Safe (Justified), Finalized, and Latest Commitment Levels




BUILD BLOCKCHAIN MAGIC

Alchemy combines the most powerful web3 developer products and tools with
resources, community and legendary support.

Get your API key

The web3 development platform




SUPERCHARGE YOUR INBOX

Sign up for our developer newsletter.

Subscribe


PRODUCTS

 * Supernode
 * NFT API
 * Webhooks
 * Custom Webhooks
 * Websockets
 * Pipelines
 * Subgraphs
 * Transfers API
 * Token API
 * Transact
 * Transaction Simulation
 * Embedded Accounts
 * Account Contracts
 * Bundler API
 * Gas Manager API
 * Spearmint


DEVELOPERS

 * Sign in
 * Sign Up
 * Status
 * Docs
 * Account Kit Docs
 * Sepolia Faucet
 * Starknet Faucet
 * Arbitrum Faucet
 * Optimism Faucet
 * Base Faucet
 * Amoy Faucet
 * Gwei Calculator
 * Create Web3 Dapp
 * Request a Chain
 * Chain Connect
 * Smart Contracts


COMMUNITY

 * Alchemy University
 * Blog
 * Bug Bounties
 * Case Studies
 * Dapp Store
 * Enterprise
 * Overviews
 * Newsletter
 * Startup Program
 * Use Cases


COMPANY

 * About us
 * Careers
 * Customers
 * Newsroom
 * Press Kit
 * Security
 * Terms of Service
 * Dapp Store Terms
 * Privacy Policy


CONTACT

 * Sales
 * Press
 * Email
 * Discord

2024 Alchemy Insights, Inc. · Terms of service

Powered by Alchemy