0%
HomeBlogProducts
Introducing Transaction Simulation: Transact with Confidence

Introducing Transaction Simulation: Transact with Confidence

Author: Alchemy Team

Reviewed by Brady Werkheiser


Published on January 25, 20232 min read

Today, we’re excited to bring you Transaction Simulation, the newest product within Alchemy Transact, a suite of products built to make every step of the transaction lifecycle easier and more effective. By previewing how transactions will behave on-chain, we believe Transaction Simulation will empower every web3 user to send transactions with confidence.

Why Transaction Simulation is So Important 

According to Chainalysis, ~$5B was lost in cryptocurrency scams in 2022 [1]. At first glance, this number is astounding. But when you think about the root cause, it starts to make a bit more sense: understanding blockchain transactions is hard

Scams are predicated on information imbalance between users and malicious actors. The vast majority of users don’t understand the details within opaque smart contracts. Every time they sign a transaction, they take a blind leap of faith, hoping the assets they expect to be transferred are the ones actually transferred. 

This is particularly problematic given the ubiquity of wallets across web3: they’re every user’s gateway into the ecosystem. Wallets and complementary transaction tools need to be a source of clarity, comfort and predictability for every user. And developers need that information too. 

Before sending a transaction, anyone should be able to know: 

  • What tokens will be transferred?

  • Will this transaction revert on-chain? 

  • Will this sequence of transactions revert on-chain? 

Simulating transactions is difficult and doing it at scale is even harder. Methods like eth_call and debug_traceCall are limited in terms of the types of transactions you can input, and the usability of the outputs. Other alternative methods are prohibitively expensive, unintuitive to use, or lack key product functionality and chain availability.

3 New Transaction Simulation APIs

With the launch of Transaction Simulation, and three new APIs, our goal is to empower every web3 user to understand their transactions ahead of time and to enable every developer to choose the format and granularity of the preview data they receive. 

Let’s break it down!

1. Asset Changes 

With alchemy_simulateAssetChanges, simulate a transaction and receive simulation data that is sanitized and simplified, to quickly discern the asset deltas of a transaction, before it's executed. Available today. 

2. Execution Simulation 

With alchemy_simulateExecution, receive an end-to-end simulation of a transaction’s EVM execution, inclusive of ABI decoded results and comprehensive logs, events and traces data. Available today. 

3. Bundle Simulation 

With alchemy_simulateBundle, pass in an array of transactions to accurately simulate and preview sequential or dependent transactions. Coming soon. 

Early adopters rave about Alchemy’s Transaction Simulation APIs

By removing smart contract opacity and giving users full visibility into the predicted outcomes of their transactions, we believe Transaction Simulation can set a new standard in web3. Early beta partners, from wallets to security teams, are saying the same thing:

"Alchemy's Transaction Simulation API will give Rainbow users a simple way to preview their transactions and understand exactly what will be transferred when they sign. Rainbow is all about empowering users with tools to transact confidently. This is exactly the type of feature we're excited about in 2023." - Wayne Cheng, CTO, Rainbow

“Stelo is dedicated to making web3 secure and easy to use. We’re building tools to understand transactions from every angle and Alchemy's Transaction Simulation product is now critical to our mission. The API's reliability, usability, and performance work perfectly for us." - Ben Scharfstein, CEO & Co-Founder, Stelo Labs

How to get started 

As of today, Asset Changes and Execution Simulation are: 

Bundle Simulation is coming soon, as well as Optimism availability across methods. 

Head to our Transaction Simulation Quickstart Guide to get started, and sign up for an Alchemy account to get building. 


References:
[1] https://blog.chainalysis.com/reports/2023-crypto-crime-report-introduction/

Section background image

Build blockchain magic with Alchemy

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