Why Transaction Simulation Matters
Last Line of Defense
Users trust your app to protect them—make that trust count
Permit Protection
Catch EIP-712 signatures that can drain wallets without transactions
Approval Awareness
Show users their existing exposure before they add more
- Pre-signing simulation — Show users exactly what will happen before they approve
- EIP-712 signature analysis — Decode and risk-score permit/signature requests
- Approval risk detection — Identify dangerous existing approvals
- Recipient verification — Catch address poisoning before users confirm
- Multi-chain support — Same APIs for ETH, Polygon, Arbitrum, Base, and more
Prerequisites
Before implementing transaction simulation, ensure you have:- A Webacy API key (sign up here)
- Basic familiarity with REST APIs or the Webacy SDK
- Your application’s transaction signing flow identified for integration
Pre-Signing Protection
The moment before a user signs a transaction is your last chance to protect them.Transaction Simulation
Simulate every transaction before it gets signed. The endpoint isPOST /scan/{fromAddress}/transactions, where fromAddress is the signer, and it takes the serialized unsigned transaction (raw), not the to/data/value fields. Every EVM library produces it as a 0x hex string: ethers Transaction.from({...}).unsignedSerialized, viem serializeTransaction(...), web3.js bytesToHex(tx.serialize()) (its serialize() returns bytes). A 66-character tx hash is also accepted for a transaction that is already mined.
The chain can be passed either as
chain in the body (1, 56, 137, 10, 42161, 8453, or "sol" for Solana) or as the ?chain= query (eth, bsc, pol, opt, arb, base, or sol); the query wins when both are present. tx.from must match the fromAddress in the path.Solana Transaction Simulation
The same endpoint scans Solana transactions. Passchain=sol (as the ?chain=sol query or "chain": "sol" in the body) and send the transaction as standard base64 in tx.raw:
- Legacy, v0 and version 1 transactions are accepted, up to 1232 bytes (4096 bytes for a version 1 transaction).
- The transaction does not need to be signed. Serialize it without requiring signatures (
@solana/web3.js1.x:tx.serialize({ requireAllSignatures: false }).toString('base64')for aTransaction,Buffer.from(tx.serialize()).toString('base64')for aVersionedTransaction). Signatures are never checked. fromAddressmust be one of the transaction’s required signers, usually the wallet that is about to sign.
A transaction that hands the signer’s funds or accounts to another address (an
APPROVE or CALL change) usually reads at least Risk, even when that address has no history. A scan that could not verify or fully score the transaction is never Benign.
Solana scans have no signed
descriptor; read riskScore instead. Omit block and operation for Solana: any value, 0 included, returns 400, as does a signer whose balance cannot pay for the transaction. A scored, verified result is cached for 60 seconds per transaction and signer; pass refreshCache=true to rescan.EIP-712 Permit Signature Verification
Permit signatures are one of the most dangerous attack vectors. A single signature can authorize unlimited token spending without any on-chain transaction.Only Ethereum mainnet is supported for EIP-712 scans:
data.domain.chainId must be 1 (or pass ?chain=eth). msg.from must match the fromAddress in the path. Pass the dApp origin as domain to get simulation.domainRisk.Approval Risk Management
Users often have approvals they’ve forgotten about. Help them understand their exposure.Current Approval Scanning
Show users their existing approvals before they add more.Dangerous Approval Detection
Flag approvals that could be used to drain the wallet.Recipient Verification
Before a user sends funds, verify the recipient address isn’t part of an attack.Address Poisoning Check
Risk Profiling
Get a quick risk assessment of any recipient.Complete Integration Workflow
Pre-Signing Check Flow
Approval Health Check Flow
Full TypeScript Implementation
Complete Transaction Security Module
Complete Transaction Security Module
Example Addresses for Testing
Permit Phishing
Address Poisoning
Known Drainers
Clean Addresses (for comparison)
API Quick Reference
Next Steps
Get Your API Key
Start protecting your users
API Reference
Complete endpoint documentation
Install the SDK
TypeScript SDK for integration
Address Poisoning
Learn more about this attack vector