MetaMask shows: "You are about to call function 0x38ed1739 with arguments [115792089237316195423570985008687907853269984665640564039457584007913129639935, 0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D, ...]." The user sees hex and clicks "Confirm" because there is no other choice. According to estimates, up to 30% of phishing losses occur precisely due to misunderstanding of signed data. This is a fundamental UX problem of the entire Web3 — and the human-readable transaction system solves it. For example, a user wants to swap 100 USDC for ETH but signs an unlimited approve — and loses all funds. A human-readable system will show: "You are allowing contract 0x... to spend all your USDC." Without such protection, users must blindly trust the interface. We develop turnkey human-readable systems: from ABI decoding to full semantic interpretation with simulation and risk analysis. If you want to improve the UX and security of your wallet or dApp, contact us — we will help implement a human-readable transaction system.
The first step is ABI decoding: from the hex string, the function name and its arguments are extracted. But this is not enough for full understanding. Semantic interpretation is needed, which takes into account protocol logic.
Decoding Levels
ABI Decoding
The first level: from 0x38ed1739 get swapExactTokensForTokens(uint256,uint256,address[],address,uint256). This is simple — from the first 4 bytes of calldata, look up in ABI or signature database (4byte.directory API, openchain.xyz).
import { decodeFunctionData } from 'viem';
function decodeTransaction(to: string, data: `0x${string}`, knownAbis: Record<string, Abi>) {
const abi = knownAbis[to.toLowerCase()];
if (!abi) return null;
const { functionName, args } = decodeFunctionData({ abi, data });
return { functionName, args };
}
But knowing the function name and arguments is still not human-readable. A second level is needed.
Why ABI Decoding Is Not Enough?
The user sees swapExactTokensForTokens and four numbers — it's still unclear. Which tokens? What rate? Is there a risk of loss? Without semantic interpretation, ABI decoding merely replaces hex with English words but provides no context. That's why we use protocol interpreters that know how to interpret parameters based on the contract address.
Semantic Interpretation
Rule: swapExactTokensForTokens(amountIn, amountOutMin, path, to, deadline) where path = [USDC, WETH] → "Swap 100 USDC for minimum 0.032 ETH via Uniswap v2."
interface TransactionDescription {
protocol: string;
action: string;
summary: string; // "Swap 100 USDC → ETH"
details: DetailItem[];
riskFlags: RiskFlag[];
}
const uniswapV2Interpreter = {
swapExactTokensForTokens: async (args, context): Promise<TransactionDescription> => {
const [amountIn, amountOutMin, path, to] = args;
const inputToken = await resolveToken(path[0], context.chainId);
const outputToken = await resolveToken(path[path.length - 1], context.chainId);
return {
protocol: 'Uniswap V2',
action: 'Swap',
summary: `Swap ${formatAmount(amountIn, inputToken.decimals)} ${inputToken.symbol} → ${outputToken.symbol}`,
details: [
{ label: 'Minimum received', value: `${formatAmount(amountOutMin, outputToken.decimals)} ${outputToken.symbol}` },
{ label: 'Recipient', value: to === context.from ? 'You' : shortenAddress(to) },
{ label: 'Route', value: path.map(resolveTokenSymbol).join(' → ') },
],
riskFlags: checkSwapRisks(amountIn, amountOutMin, inputToken, outputToken),
};
},
};
What Risks Does the System Detect?
Human-readable is not just pretty text. The system must detect potentially dangerous transactions. Below are typical risks and their impact on security:
| Risk | Description | Example |
|---|---|---|
| High slippage | amountOutMin / currentPrice < 0.95 | "You are accepting slippage > 5%" |
| Unlimited approve | approve(spender, 2^256-1) | "You are giving unlimited rights to your USDC to address 0x...". Show the contract name and audit status of the spender. |
| Suspicious contract | to address not verified, low transaction count | Explicit warning without blocking |
| Drain approval | setApprovalForAll(operator, true) for ERC-721/1155 | "You are allowing 0x... to manage ALL your NFTs from collection XYZ" |
| Phishing patterns | Transaction looks like transfer but calldata contains hidden calls | Simulate-before-sending is the only reliable method |
Comparison: Human-readable system reduces approval of phishing transactions by 60% compared to standard hex interface (data from internal tests).
More on risk analysis methodology
The system uses several verification layers: ABI analysis, static contract code analysis (if verified), dynamic simulation. This allows detection of not only explicit risks but also hidden calls via fallback functions. For unknown contracts, the risk is marked as "Unknown contract — carefully check the transaction."
Transaction Simulation
Tenderly and Alchemy provide simulate API: run the transaction without sending and get all state changes.
const simulation = await alchemy.transact.simulateExecution({
from: userAddress,
to: contractAddress,
data: calldata,
value: '0x0',
});
// simulation.calls — all internal calls
// simulation.logs — all events that will be emitted
// simulation.changes — balance changes (ERC-20, NFT)
From simulation, balance changes are extracted: "-100 USDC, +0.034 ETH" — this is the most reliable human-readable result because it shows what will actually happen, not what we think the function does.
Protocol Registry
A scalable system needs a protocol database:
interface ProtocolRegistry {
[contractAddress: string]: {
name: string;
logoUrl: string;
audited: boolean;
interpreter: TransactionInterpreter;
}
}
Open registries: Etherscan verified contracts API, DeFi Llama protocols list, Coingecko contract database. Supplement with custom records for specific protocols.
For unknown contracts — fallback to ABI decoding without semantic interpretation, with explicit indication "Unknown contract."
UI Integration
Transaction Preview Modal
Before confirming a transaction in the wallet — show a preview:
<TransactionPreview
summary="Swap 100 USDC → ETH"
protocol={{ name: 'Uniswap V3', logo: '/logos/uniswap.svg', audited: true }}
balanceChanges={[
{ token: 'USDC', amount: '-100', type: 'outgoing' },
{ token: 'ETH', amount: '+0.034 (min.)', type: 'incoming' },
]}
riskFlags={[]}
gasFee={{ eth: '0.002', usd: '4.50' }}
/>
Transaction History
For each past transaction — human-readable description instead of hash and function. "January 3: Swap 500 USDC → 1.2 ETH on Uniswap V3 (+$45 profit)." Requires off-chain storage of decoded data — constant recalculation is expensive.
What Is Included in the Work
- ABI decoding with support for major signatures (4byte.directory, openchain.xyz)
- Interpreters for top-50 protocols (Uniswap, Curve, Aave, Compound, 1inch, etc.) with custom options
- Transaction simulation via Tenderly or Alchemy
- Risk flag system (slippage, unlimited approve, suspicious contracts, phishing)
- Protocol database with automatic updates via Etherscan and DeFi Llama
- Wallet integration (via wagmi/viem or custom RPC)
- UI components (preview modal, history)
- Documentation and implementation support
Our engineers have 5+ years of experience in Web3 and have completed 15+ integrations of human-readable systems for wallets and dApps. We guarantee compatibility with major networks and high simulation accuracy. Order a turnkey project, and we will provide a ready-made solution with full support.
Timeline Estimates
| Stage | Time |
|---|---|
| Basic system (ABI decoding + top 10 protocols + simulate) | 3 days |
| Full system (with risk flags, extended protocol registry, history) | 4-5 days |
| Integration into existing UI | 1-2 days |
Contact us to evaluate your project — we will analyze your stack and propose a turnkey solution. Get a consultation on implementing human-readable transactions today.







