An Introduction to the Web3 Transaction Lifecycle

onboard-theme

The Importance of Pre-Chain Data for a Confident Web3 Experience
Introducing a Standard Model for the Web3 Transaction Lifecycle
Pre-Chain Risks and Opportunities
1. Where it all begins: intent to transact
2. From intent to reality: composing a transaction
3. Gas, gas, gas: pricing transaction fees
4. Peek into the future: previewing results
5. Propagation throughout the network: distributing a transaction
6. Transaction pending, now what? Monitor in-flight transactions
7. Making it on-chain or not: transaction finality
Summary of Pre-chain Transaction Risks
Take Control of the Web3 Transaction Lifecycle with Blocknative

 

The Importance of Pre-Chain Data for a Confident Web3 Transaction Experience

Web3 can be notoriously complicated, both for new and experienced crypto users alike. Usability continues to be a huge issue for the ecosystem, from friction in connecting your wallet of choice, to sending funds to the wrong network, to the myriad of complications resulting from composing or pricing a transaction incorrectly.

This friction stems from limitations in accessing and leveraging the pre-chain layer—a part of blockchain that is often overlooked despite its central role in determining the success or failure of a transaction. The majority of the Web3 transaction lifecycle happens in this pre-chain layer, yet most Dapps, exchanges, wallets, protocols, networks, and bridges fail to incorporate its complexities and its nuances. 

A successful Web3 UX will embrace and expose the transaction lifecycle, making each stage clear and transparent for end-users. The result is an increase in transaction confidence and a corresponding decrease in transaction anxiety, which leads to growth in active users who, in turn, conduct more transactions of greater value. 

web3-expectation-vs-reality

 

In short, Web3 UX best practices are highly constructive for the health and vibrancy of the Web3 ecosystem as a whole. As the industry focuses on onboarding the next billion users, Web3 usability is central. But Web3 friction can not be solved without first addressing pre-chain risks found in the Web3 transaction lifecycle.

 

Introducing a Standard Model for the Web3 Transaction Lifecycle

Blockchain technology gives users the freedom to transact in ways that have previously not been possible. Rather than rigid transaction rules defined and enforced by centralized institutions, Web3 enables truly programmable transactions with possibilities bounded only by developer imagination and creativity. 

At Blocknative, we approach the Web3 transaction lifecycle as seven discrete stages: 

  1. Intent: “I want to swap X for Y”
  2. Compose: “Here is how I plan to achieve my intent.” 
  3. Price: “To do this, how much do I expect to pay in transaction fees?”
  4. Preview: “What would happen if I submitted this transaction right now?”
  5. Transmit: “I have signed and submitted my transaction to the network.”
  6. Monitor: “What is happening with my transaction? Is it going to be confirmed soon?”
  7. Finality: “Did my transaction succeed? What were the outcomes?”

 

web3-transaction-lifecycle-simple

 

While these stages may seem simple on the surface, the reality of the Web3 user experience is often much more complicated – as many developers and traders can attest. This is because, in Web3, users now have the ability to take complete control of their transactions. But this control comes with hidden complexities at each stage of the lifecycle that could prevent a transaction from reaching a user’s intended outcome.

Even the most knowledgeable crypto users – especially those accustomed to working with centralized exchanges – have encountered the inherent difficulties and uncertainties when transacting via decentralized DeFi exchanges and protocols. 

For example, Web3 users must set their own transaction fees (including gas price and gas limits), understand how gas prices ebb and flow, make sure they are transacting on the correct network, and know what to do if a transaction gets dropped or stuck, among a series of other factors. 

 

web3-tx-lifecycle-introduces-many-complexities

 

Fortunately, the path from transaction intent to transaction finality does not need to be linear. While on-chain transactions are immutable, all bets are off in the pre-chain layer as inflight transactions can be updated and replaced. This flexibility enables users to revisit the different phases of the transaction lifecycle to achieve a specific desired end result when finalized.

 

web3-tx-lifecycle-not-always-linear

 

As Web3 goes multi-chain, the transaction lifecycle becomes increasingly complex as additional steps are required as value moves in new ways, often across multiple networks. We may discuss how cross-chain bridges, token wrapping, and rollups affect the transaction lifecycle in the future. 

 

Pre-Chain Risks and Opportunities at Each Stage of the Web3 Transaction Lifecycle

Each stage of the transaction lifecycle introduces its own series of risks and opportunities that can impact user experience and transaction finality. Understanding how to influence these outcomes empowers:

  • End-users to make informed decisions about their transactions.
  • Dapp developers to build better UX and decrease user churn.
  • DEXs to onboard users and allow them to transact across multiple networks, using the wallet of their choice with minimal friction.
  • NFT Marketplaces to reduce failed transactions and improve user satisfaction.
  • Wallets to provide accurate gas estimates and transaction previews to reduce transaction anxiety.
  • Protocols to enable new tooling for developers and traders.
  • L1 and L2 Networks to ensure that all network participants have equitable access to pre-chain data. 

The following is a breakdown of each stage of the Web3 transaction lifecycle and the different risks and opportunities they present to developers and traders.

 

1. Where it all begins: intent to transact

The first stage of any Web3 transaction is the Intent stage. In this stage, a user is deciding to make a specific transaction, such as swapping USDC for ETH, but has not decided whether or not to do so, which decentralized application (Dapp) to conduct this transaction on, which L1 or L2 to conduct it on, and more.  

A Dapp’s ability to enable a user to effortlessly traverse the following stages will influence how likely users are to continue to use its services.

 

2. From intent to reality: composing a transaction

Next, a user will need to decide how they would like to conduct their transaction. As the number of Dapps, centralized and decentralized exchanges, marketplaces, aggregators, smart wallets, and DeFi protocols continues to grow exponentially, users will have many options to choose from for most transactions. 

While trading pairs and current market conditions may govern which DeFi protocols are usable options, the user experience and fees paid will dictate a user’s go-to choice. 

As Web3 becomes increasingly multi-chain and multi-wallet, Dapps must adapt to ensure users are able to seamlessly access their preferred wallets on their preferred networks. An open-source toolkit like Web3-Onboard enables developers to readily integrate the top hardware and software wallets into their Dapps and allows their users to seamlessly switch between networks to simplify on-ramping to different protocols.

Pre-chain transaction risks at this stage: 

  • Onboarding friction
  • End-user is unable to access their preferred wallet(s) 
  • End-user is unable to switch to the required network
  • End-user is confused about which protocol to use on which network

3. Gas, gas, gas: pricing transaction fees

One of the most pivotal elements of composing a transaction is gas pricing. Users must decide how much they are willing to spend on gas based on how quickly they want their transaction to be written to the blockchain. 

When gas prices spike, accurate gas estimates could be the difference between a rapidly confirmed transaction and a dropped or stuck transaction. If the transaction is time-sensitive, accurate gas estimates avoid unnecessary gas fee overpayment. 

Traders can also use the Blocknative Gas Estimator browser extension to get desktop alerts when gas prices fall above or below pre-defined thresholds.

Pre-chain transaction risks at this stage: 

  • Volatile gas fees and inaccurate gas estimates can lead to stuck or dropped transactions
  • Underpriced gas can lead to a slow transaction confirmation, resulting in foregone gains
  • Overpriced gas fees can reduce or eliminate profitability.

4. Peek into the future: previewing results before submitting a transaction

Before actually signing and transmitting a transaction, Dapps and wallets can leverage real-time API’s to provide a predictive preview of how the transaction may execute under the current state of the target blockchain. Traders rely on the accuracy of these previews to ensure their trades execute successfully.  

If users are not satisfied with the predicted results and balance impact, they can return to a previous stage and adjust transaction parameters accordingly. For example, if the preview does not indicate the transaction will be included within the next three blocks, a user can increase the gas price appropriately. Alternatively, if the preview indicates that the transaction will fail – if, for instance, an NFT mint has been exhausted – the user can avoid submitting the transaction entirely and save the frustration of failed transaction and lost gas fee. 

Ensuring accurate transaction previews is vital. Advanced tools like Blocknative’s Transaction Preview API allow a user to accurately preview the estimated speed and cost of a given transaction, as well as inform the user on whether or not the transaction will succeed. In the case of a predicted transaction failure, Transaction Preview API shows why it is expected to fail. Transaction Preview also improves security by determining the impact of internal events, including hidden smart contract calls.

Pre-chain transaction risks at this stage: 

  • Lack of previews requires blind faith when approving a transaction. 
  • Inaccurate transactions previews can lead to failed transactions, unexpected outcomes, and forgone gains
  • Transacting with fraudulent smart contracts can drain liquidity

5. Propagation throughout the network: distributing a transaction

If a user is satisfied with the previewed outcomes, they can approve and sign the transaction. This will transmit the transaction to a node. The node will then propagate the transaction across the network to be validated and added to the mempool, where it will wait until it is successfully included in a block. 

It is important to note that there is no singular mempool— instead, each node in the network has its own unique collection of pending transactions. Each node will perform its own checks, adding valid transactions to its mempool before broadcasting the transaction along to its peers. 

Pre-chain transaction risks at this stage: 

  • Transaction errors due to nonce gaps
  • Transaction not propagated to the wider network
  • Eclipse attacks and partial eclipse attacks

6. Transaction pending, now what? Monitor in-flight transactions

The process of going from a signed transaction to confirmed in one block is complex, even under normal mempool conditions. But as mempool congestion increases, so does the complexity associated with your transaction getting confirmed. 

Unfortunately, some block explorers have a limited view of in-flight transactions and can only tell a user that a transaction is pending. This lack of pre-chain visibility can result in increased transaction anxiety that many long-time crypto users can relate to as we constantly refresh our page in the hopes of receiving an updated transaction status. The addition of pre-chain insights, however, can alleviate this transaction anxiety by ensuring users always have visibility into the exact status of their transaction in the mempool.

Ideally, Dapps and wallets will keep a user updated on the transaction’s status within the mempool. This enables the user to know if they need to go back and perform a replacement transaction because, as long as the transaction remains pending in the mempool, the user is able to return to any of the previous steps of the transaction lifecycle. However, it is important to note that, when replacing a transaction, an accurate gas estimation is imperative so that the user can appropriately price the gas on the speed-up or cancel to avoid repeating the issue. 

If a transaction is underpriced in terms of its gas fee, the inability to detect a speed-up or cancel transaction could leave the transaction indefinitely “pending” on a Dapp's UI, resulting in a confusing user experience as well as potentially preventing any further use of that account.

Pre-chain transaction risks at this stage: 

  • Lack of pre-chain visibility prohibits inflight corrections
  • Information asymmetries enable front running and timing attacks
  • Increased user friction from failed, dropped, and stuck transactions

7. Making it on-chain or not: transaction finality

After your transaction is picked up and added to a block, your transaction will either be confirmed (yay!) or fail. 

There are various reasons why a transaction might fail. Transaction errors cause friction that may lead to user churn. For this reason, accurate transaction previews, gas estimates, and the ability to monitor a transaction’s progress through the mempool are vital to the sustainability of a project.

Even after a transaction has been confirmed, it may be important to continue to monitor the number of confirmations for some time to ensure no issues, such as your transaction being included in an uncled or reorganized block that could result in delayed network consensus – or even altered terms of settlement – for your transaction.

Some transactions may be dropped and become stuck, resulting in them ‘never’ reaching finality. This is often the result of improper gas or transaction previews. Fortunately, this can be remedied through the use of speed-up or cancel transactions. Unfortunately, these types of replacement transactions can be confusing for end-users and often break Dapp UXs without the proper transaction orchestration infrastructure in place, as detailed in the Monitor phase. 

 

Summary of Pre-chain Transaction Risks

Pre-chain risks when composing a transaction: 

  • Onboarding friction
  • End-user is unable to access their preferred wallet(s) 
  • End-user is unable to switch to the required network
  • End-user is confused about which protocol to use on which network

Pre-chain risks when pricing a transaction: 

  • Volatile gas fees and inaccurate gas estimates can lead to stuck or dropped transactions
  • Underpriced gas can lead to a slow transaction confirmation, resulting in foregone gains
  • Overpriced gas fees can reduce or eliminate profitability.

Pre-chain risks when previewing a transaction: 

  • Lack of previews requires blind faith when approving a transaction. 
  • Inaccurate transactions previews can lead to failed transactions, unexpected outcomes, and forgone gains
  • Transacting with fraudulent smart contracts can drain liquidity

Pre-chain risks when submitting a transaction: 

  • Transaction errors due to nonce gaps
  • Transaction not propagated to the wider network
  • Eclipse and partial eclipse attacks

Pre-chain risks when monitoring a transaction: 

  • Lack of pre-chain visibility prohibits inflight corrections
  • Information asymmetries enable front running and timing attacks
  • Increased user friction from failed, dropped and stuck transactions

Take Control of the Transaction Lifecycle with Blocknative Transaction Orchestration

Understanding the Web3 Transaction Lifecycle is fundamental for developers and traders alike. Developers need to know how to decrease friction on their platforms and ensure the best user experience, while traders need to understand how to best optimize their transactions and identify and correct any issues that may come up. 

To help Web3 developers get their users transacting with confidence, Blocknative operates a rich product portfolio that is the easy way to work with pre-chain data across multiple networks.

 

take-control-of-the-web3-tx-lifecycle-with-blocknative

 

As the industry focuses on adopting the next billion users, Web3 usability is central. Blocknative’s platform lets you take control of the Web3 transaction lifecycle and pre-chain layer— which are central to creating a frictionless Web3 experience. We encourage all Web3 builders and traders to go hands-on with our tools. 

Create your free Mempool Explorer account today to see how transactions move through the mempool before being confirmed on-chain. You can monitor your own wallet or watch any one of our pre-programmed DEX feeds. Or review our documents and try out our powerful APIs to monitor and control Web3 transactions.

 We encourage interested builders and traders to join our Discord Community where you can connect directly with our team if you have any questions or feature requests. Blocknative is here to help.

 

About Blocknative

Blocknative provides real-time Web3 infrastructure. The Blocknative Transaction Orchestration platform enables dynamic user experiences and better decisions via pre-chain insights. Blocknative levels the playing field for accessing pre-chain data across multiple Web3 networks, including Ethereum, Gnosis Chain, Polygon, Fantom, BNB Chain Chain, and Bitcoin. 

Founded in 2018, Blocknative works with many forward-thinking Web3 developers, Defi protocols, and infrastructure projects. This includes Curve, Compound, Synthetix, Balancer, Bancor, Yearn, Badger Finance, Gitcoin, Aavegotchi, Polygon, Fantom, the Ethereum Foundation, and more.


Request a demo

 

Most Recent
eth-gas-price-alerts:-always-know-the-best-time-to-transact-on-ethereum
Gas

ETH Gas Price Alerts: Always Know the Best Time to...

understanding-eth-simulation-bundles-and-when-to-use-them
Transaction Simulation

Understanding ETH Simulation Bundles and When to Use...

simulate-multiple-transactions-with-bundle-support-for-transaction-preview
Transaction Simulation

Simulate Multiple Transactions with Bundle Support for...

introducing-base-fee-prediction-and-intelligent-max-fee-estimates
Gas Platform

Introducing Base Fee Prediction and Intelligent Max...