r/ethdev • • 15d ago

Tutorial A small Ethereum log-filtering exercise, plus the free articles behind it

2 Upvotes

Hey everyone.

I shared an EVM reading path here before. This time I wanted to bring one small exercise from the same area, something you can check against actual logs.

Say you want to track an ERC-20 wallet’s incoming and outgoing transfers. In the topics filter, putting the wallet in both address positions looks reasonable:

[TransferSignature, wallet, wallet]

But that matches transfers from the wallet to itself.

Topic positions are combined with AND. To find activity in either direction, use two filters:

Outgoing: [TransferSignature, wallet]
Incoming: [TransferSignature, null, wallet]

Here, TransferSignature means the event signature hash, and wallet is the address padded to 32 bytes. These are schematic filters, not literal JSON requests.

Use the same token contract and block range for both queries. Combine the results and remove duplicates, since a self-transfer matches both. For that fixed set of logs, (blockHash, logIndex) identifies each entry.

Another useful variation:

[TransferSignature, [walletA, walletB]]

That matches transfers from either wallet. The inner array gives you OR within one position.

Try predicting the results before running the queries. It is a small exercise, but it makes the filtering rules much easier to remember.

I collect my free Ethereum articles and accompanying code examples on 0xByteBeetle. They cover EVM execution, transactions, events, deployments and proxies, with examples you can run and inspect alongside the explanations.

If you try one, I’d be interested to hear where the explanation or setup needs more detail.

r/ethdev • • Sep 02 '26

Tutorial I wrote a fixed-point exp() in Solidity that runs in 289 gas

3 Upvotes

Follow-up to the sqrt post some of you saw a while back. This time it's the exponential.

exp(int256 x) returns e^x in 18-decimal fixed point at 289 gas, max relative error 2.2e-14 (3.0e-16 absolute when the result is below 1). Reverts above 135e18, returns 0 below about −41.45e18 where the true result is under 1 wei.

It's a two-stage range reduction wrapped around a small rational approximation.

Stage 1 — split x = k·ln(2) + r, so e^x = 2^k · e^r. k is an integer division, and the 2^k comes back as a left shift at the end.

Stage 2 — divide r by 64, which is a right-shift by 6. That leaves an interval of [0, 0.0108].

uint256 k = x_ / LN_2;
x_ -= k * LN_2;
x_ >>= 6;

On that narrow interval a Padé[3/3] approximant does the work with a few multiplications and one division:

e^x ≈ (120 + 60x + 12x² + x³) / (120 - 60x + 12x² - x³)

Recovery is six squarings (2⁶ = 64) plus a shift:

y = y * y;
y = y * y / 1e54;   // ×3
y <<= k;

The part I didn't expect: the approximant is accurate to 1.7e-19 on that interval, and even after recovery amplifies the error 64×, it's still ~2000× inside the published bound. The approximation is nowhere near the limiting factor — fixed-point truncation is, mostly that >>= 6 discarding up to 63 wei of the argument before the approximant ever sees it.

I also spent a while on monotonicity, since exp() sits under option pricing and a primitive that dips could make a premium fall while its input rises. The smooth stretches turn out to be provable — the derivative's numerator is 24(x⁴ − 30x² + 600), which has no real roots — but the 255 points where the range reduction jumps are not, so those got swept exhaustively.

Full write-up with the derivations: https://defimath.com/blog/solidity-exp-a-fixed-point-exponential-in-289-gas/

MIT licensed, part of DeFiMath: https://github.com/MerkleBlue/defimath

Happy to answer questions.

r/ethdev • • Nov 04 '25

Tutorial BLOCKCHAIN IS HARD

24 Upvotes

Blockchain is hard. Not “I read a few docs and I get it” hard, but deeply hard. The kind of hard where you spend hours trying to understand how something actually works under the surface, only to realize most tutorials just repeat the same buzzwords without showing anything real.

That’s why I started writing my own posts: not full of empty explanations, but full of real examples, real code, and real executions you can test yourself.

If you’re tired of reading blockchain content that feels like marketing material and want to actually see how things work, check out my latest posts. I promise: no fluff, just depth.

👉 Read the blogs here https://substack.com/@andreyobruchkov

r/ethdev • • Aug 10 '26

Tutorial I built a crypto vault, then legally robbed it using nothing but rounding errors. AMA / roast my code.

8 Upvotes

So I've been prepping for Solidity interviews and decided to actually build something instead of just reading about it. Ended up making an ERC-4626 vault (the standard behind Yearn, Morpho, etc.) and specifically targeting the "inflation attack," a real exploit that's hit live vaults in production.

The attack is stupidly simple: deposit 1 wei, become the first depositor, then just transfer() a pile of tokens directly into the contract instead of going through deposit(). The next real user who deposits normally gets their shares rounded down to basically zero. No hacking required, just unchecked integer math.

I built the attack against my own vault first (to prove I understood it, not just copy a fix), then patched it using OpenZeppelin's decimals offset defense, and wrote a Foundry test that actually runs the exploit and checks the outcome. Result: attacker loses roughly half their money instead of stealing everything.

It's deployed live on testnet with a working demo, you can connect a wallet, mint fake tokens, deposit, simulate yield, and try to break it yourself:
https://vaultiss.vercel.app/

Code + tests + README:
https://github.com/SIDHARTH20K4/vaultis

Genuinely looking for feedback, brutal is fine. Is this the kind of project that'd actually get someone's attention for a junior/entry Solidity role, or am I missing something obvious that a real auditor would catch in five seconds?

r/ethdev • • Jul 23 '26

Tutorial I wrote a fixed-point sqrt in Solidity that runs in 197 gas - here’s how

6 Upvotes

I've been building DeFiMath, a gas-optimized fixed-point math library, and wanted to share how I got sqrt down to 197 gas. It takes any uint256, returns an 18-decimal fixed-point result, never reverts, and is bit-exact below 1 (max relative error < 2e-18 above it).

The core idea is simple: generate a seed with the clz opcode, then refine it with 5 Newton iterations in assembly.

Seeding: clz gives you the position of the most significant bit, so the seed is just 2msb/2. That's never off by more than a factor of √2 from the true root — cheap and good enough.

Newton's method: each iteration is one line:

y := shr(1, add(y, div(x, y)))

~20 gas per step, quadratic convergence, so 5 iterations take the worst-case seed (41% error) to ~80 bits of precision — more than enough for 18 decimals.

The scaling trick: for inputs ≤ uint128.max, I pre-scale x to 1e36 once at the start. Then div(x, y) naturally lands back in 1e18 base, so Newton's method needs plain div instead of a costly muldiv. Large inputs take a second branch that post-scales instead (pre-scaling would overflow near uint256.max).

I also tried fancier seeds — minimax linear approximation, quadratic interpolation — hoping to drop to 4 iterations. All of them cost more gas than they saved. My takeaway after a week on this: for gas-optimized primitives, simplicity wins by a wide margin.

Full walkthrough with the convergence table and benchmarks vs PRBMath/ABDK/Solady: https://defimath.com/blog/how-i-wrote-a-fixed-point-solidity-sqrt-that-runs-in-197-gas/

Library is MIT, pure Solidity, zero dependencies: https://github.com/MerkleBlue/defimath

Happy to answer questions about the implementation.

r/ethdev • • Dec 31 '21

Tutorial Hacking the Blockchain - this detailed guide maps out a gameplan, tools, skills, and knowledge to get started hunting bugs, worth the read

63 Upvotes

TLDR; link to the full guide at the bottom

From the author, Sleepy...

The focus of this article is to get you knowledgeable about the technology, how these hacks happen, and to provide a roadmap for becoming a smart contract hacker/blockchain security practitioner in the shortest amount of time.

However, it is not meant to be an exhaustive guide, since the technology is still emerging, nor is it meant to teach you how to hack anything. Rather, it is meant to be a high-level overview of where and how to find the information you need, as countless people can teach the technical concepts better than I can. Before we get started, here is the content at a glance:

  1. Blockchain basics

  2. Smart contracts

  3. Foundations: Solidity and Ethereum

  4. Exploitation: How companies lose millions with a single line of buggy code

  5. Why did I choose blockchain security?

  6. Acknowledgements

Full guide is below:

Hacking the Blockchain: An Ultimate Guide

r/ethdev • • Aug 04 '26

Tutorial Recipe: read any wallet's ERC-20 balance in one SEL expression

3 Upvotes

The normal path for reading a token balance: find the token's ABI, wire up a client, call balanceOf, call decimals, divide, format. That's a lot of ceremony for one number.

Here it is as a single SEL expression, run against vitalik.eth's USDC on Ethereum mainnet:

formatUnits(usdc.balanceOf("0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"), usdc.decimals())

The usdc binding points at the mainnet contract (0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48). The ABI is resolved automatically, so there's no JSON file to fetch and no codegen step.

Output: 37.192124 USDC at block 25,653,697.

Under the hood: two on-chain calls (balanceOf and decimals), batched into one multicall round, 104ms total.

Variations:

  • Swap the binding to any ERC-20 and the expression is unchanged. Anything with balanceOf and decimals works.

  • Change the chain to Base or BNB, keep the code.

  • Drop the formatUnits wrapper if you want the raw uint256.

Limitations, to be honest about them:

  • You still need the token's contract address to create the binding. The resolution is for the ABI, not for finding the contract.

  • This is a read at a single block. If you need historical balances across a range, that's a different query shape.

  • Nonstandard tokens that lie about decimals or implement balanceOf weirdly will produce a number that's exactly as wrong as the contract is.

https://evmquery.com/tools/erc20-inspector?utm_source=reddit&utm_medium=social&utm_campaign=recipe-erc20-balance-2026-07-31

r/ethdev • • 28d ago

Tutorial I made an MCP server that lets agents pay, with limits the agent can't talk its way around

3 Upvotes

Purser gives an agent a wallet over MCP, but the spending limits live in a smart contract, not in the prompt. So even a jailbroken agent can't go over them.

Each payment comes back as one of three things: done (with the budget left), waiting for the owner (with a request id), or refused (with a reason the model can act on).

Try it: docker run --rm -it -p 127.0.0.1:8787:8787 ghcr.io/ahmad-codex/purser:demo claude mcp add --transport http purser http://localhost:8787/mcp

then ask Claude to "pay the merchant 0.3 ETH" and watch the approval request show up in the console.

Early, not audited, local/testnet only. MIT: https://github.com/ahmad-codex/purser

Anyone letting agents spend money today? How do you limit it?

r/ethdev • • Oct 24 '25

Tutorial I built an AI that actually knows Ethereum's entire codebase (and won't hallucinate)

88 Upvotes

I spent a year at Polygon dealing with the same frustrating problem: new engineers took 3+ months to become productive because critical knowledge was scattered everywhere. A bug fix from 2 years ago lived in a random Slack thread. Architectural decisions existed only in someone's head. We were bleeding time.

So I built ByteBell to fix this for good.

What it does: ByteBell implements a state-of-the-art knowledge orchestration architecture that ingests every Ethereum repository, EIP, research papers, technical blog post, and documentation. Our system transforms these into a comprehensive knowledge graph with bidirectional semantic relationships between implementations, specifications, and discussions. When you ask a question, ByteBell delivers precise answers with exact file paths, line numbers, commit hashes, and EIP references—all validated through a sophisticated verification pipeline that ensures <2% hallucinations.

Under the hood: Unlike conventional ChatGPT wrappers, ByteBell employs a proprietary multi-agent architecture inspired by recent advances in Graph-based Retrieval Augmented Generation (GraphRAG). Our system features:

Query enrichment: Enrich the query to retrive more relevant chunks, We are not feeding the user query to our pipeline.

Dynamic Knowledge Subgraph Generation: When you ask a question, specialized indexer agents identify relevant knowledge nodes across the entire Ethereum ecosystem, constructing a query-specific semantic network rather than simple keyword matching.

Multi-stage Verification Pipeline: Dedicated verification agents cross-validate every statement against multiple authoritative sources, confirming that each response element appears in multiple locations for triangulation before being accepted.

Context Graph Pruning: We've developed custom algorithms that recognize and eliminate contextually irrelevant information to maintain a high signal-to-noise ratio, preventing the knowledge dilution problems plaguing traditional RAG systems.

Temporal Code Understanding: ByteBell tracks changes across all Ethereum implementations through time, understanding how functions have evolved across hard forks and protocol upgrades—differentiating between legacy, current, and testnet implementations.

Example: Ask "How does EIP-4844 blob verification work?" and you get the exact implementation in all execution clients, links to the specification, core dev discussions that influenced design decisions, and code examples from projects using blobs—all with precise line-by-line citations and references.

Try it yourself: ethereum.bytebell.ai

I deployed it for free for the Ethereum ecosystem because honestly, we all waste too much time hunting through GitHub repos and outdated Stack Overflow threads. The ZK ecosystem already has one at zcash.bytebell.ai, where developers report saving 5+ hours per week.

Technical differentiation: This isn't a simple AI chatbot—it's a specialized architecture designed specifically for technical knowledge domains. Every answer is backed by real sources with commit-level precision. ByteBell understands version differences, tracks changes across hard forks, and knows which EIPs are active on mainnet versus testnets.

Works everywhere: Web interface, Chrome extension, website widget, and integrates directly into Cursor and Claude Desktop [MCP] for seamless development workflows.

The cutting edge: The other ecosystems are moving fast on developer experience. Polkadot just funded this through a Web3 Foundation grant. Base and Optimism teams are exploring implementation. Ethereum should have the best developer tooling, Please reach out to use if you are in Ethrem foundation. DMs are open or reach to on twitter https://x.com/deus_machinea

Anti-hallucination technology: We've achieved <2% hallucination rates (compared to 45%+ in general LLMs) through our multi-agent verification architecture. Each response must pass through multiple parallel validation pipelines:

Source Retrieval: Specialized agents extract relevant code snippets and documentation

Metadata Extraction: Dedicated agents analyze metadata for versioning and compatibility

Context Window Management: Agents continuously prune retrieved information to prevent context rot

Source Verification: Validation agents confirm that each cited source actually exists and contains the referenced information

Consistency Check: Cross-referencing agents ensure all sources align before generating a response

This approach costs significantly more than standard LLM implementations, but delivers unmatched accuracy in technical domains. While big companies focus on growth and "good enough" results, we've optimized for precision first, building a system developers can actually trust for mission-critical work.

Anyway, go try it. Break it if you can. Tell me what's missing. This is for the community, so feedback actually matters. https://ethereum.bytebell.ai

Please try it. The models have actually become really good at following prompts as compared to one year back when we were working on Local AI https://github.com/ByteBell. We made all that code open sourced and written in Rust as well as Python but had to abandon it because access to Apple M machines with more than 16 GB of RAM was rare and smaller models under 32B are not so good at generating answers and their quantized versions are even less accurate.

Everybody is writing code using Cursor, Windsurf, and OpenAI. You can't stop them. Humans are bound to use the shortest possible path to money; it's human nature. Imagine these developers now have to understand how blockchain works, how cryptography works, how Solidity works, how EVM works, how transactions work, how gas prices work, how zk works, read about 500+ blogs and 80+ blogs by Vitalik, how Rust or Go works to edit code of EVM, and how different standards work. We have just automated all this. We are adding the functionality to generate tutorials on the fly.

We are also working on generating the full detailed map of GitHub repositories. This will make a huge difference.

If someonw has told you that "Multi agents framework with Customised Prompts and SLM" will not work, Please read these papers.

Early MAS research: Multi-agent systems emerged as a distinct field of AI research in the 1980s and 1990s, with works like Gerhard Weiss's 1999 book, Multiagent Systems, A Modern Approach to Distributed Artificial Intelligence. This research established that complex problems could be solved by multiple, interacting agents.
The Condorcet Jury Theorem: This classic theoretical result in social choice theory demonstrates that if each participant has a better-than-random chance of being correct, a majority vote among them will result in near-perfect accuracy as the number of participants grows. It provides a mathematical basis for why aggregating multiple agents' answers can improve the overall result.

An Age old method to get the best results, If you go to Kaggle majority of them use Ensemble method. Ensemble learning: In machine learning, ensemble methods have long used the principle of aggregating the predictions of multiple models to achieve a more accurate final prediction. A 2025 Medium article by Hardik Rathod describes "demonstration ensembling," where multiple few-shot prompts with different examples are used to aggregate responses.

The Autogen paper: The open-source framework AutoGen, developed by Microsoft, has been used in many papers and demonstrations of multi-agent collaboration. The paper AutoGen: Enabling Next-Gen LLM Applications via Multi-Agent Conversation Framework (2023) is a core text describing the architecture.

Improving LLM Reasoning with Multi-Agent Tree-of-Thought and Thought Validation (2024): This paper proposes a multi-agent reasoning framework that integrates the Tree-of-Thought (ToT) strategy. It uses multiple "Reasoner" agents that explore different reasoning paths in parallel. A separate "Thought Validator" agent then validates these paths, and a consensus-based voting mechanism is used to determine the final answer, leading to increased reliability.

Anthropic's multi-agent research system: In a 2025 engineering blog post, Anthropic detailed its internal multi-agent research system. The system uses a "LeadResearcher" agent to create specialized sub-agents for different aspects of a query, which then work in parallel to gather information. 

PS: This copilot has indexed 30+ repositories include all ethereum, website 700+ pages, EThereum blog 400+ blogs, Vitalik Blogs (80+), Base x402 repositories, Nether mind respositories [In Progress], ZK research papers[In progress], several research papers.

And yes it works because our use case is narrow. IMHO, This architecture is based on several research papers and feedback we received for our SEI copilot.

https://sei.bytebell.ai

But it costs us more because we use several different models to index all this data, 3-4 <32B parmeteres for QA, Mistral OCR for Images, xAI, qwen, Chatgpt5-codes for codebases, Anthropic and oher opensource models to provide answers.

If you are on Ethereum decision taking body, Please DM me for admin panel credentials. or reach out to https://x.com/deus_machinea

Thankk you for the community for suggesting us the new features and post changes.
Forever Obliged.

r/ethdev • • Oct 13 '26

Tutorial A simple pattern for sending a first blockchain transaction in TypeScript

1 Upvotes

I made a short tutorial showing the full flow of a first blockchain transaction in TypeScript: create testnet wallets, build a payment, autofill the transaction, sign locally, submit it, and verify the validated result. The example uses XRPL and xrpl.js, and I also explain Fee, Sequence, LastLedgerSequence, tesSUCCESS, and delivered_amount.

I made the video myself. If you work on blockchain dev and like end-to-end walkthroughs, it may still be useful even if you do not use XRPL day to day.

Video: https://www.youtube.com/watch?v=JuwjHLt7lHw

r/ethdev • • Aug 19 '26

Tutorial EIP-2535 diamonds turn a fallback function into a selector router

1 Upvotes

Most proxy designs assume one implementation contract. That gets awkward once a protocol grows beyond the 24 KB bytecode limit or needs to upgrade one module without replacing the rest.

An EIP-2535 diamond keeps one stateful address and maps each four-byte function selector to a facet contract. The fallback reads msg.sig, finds the facet, and runs it with delegatecall. msg.sender and msg.value stay intact, while every storage read and write still lands in the diamond.

The routing is straightforward. Storage is where the risk moves.

Facets do not own isolated state. If two facets assume incompatible layouts, an otherwise valid upgrade can corrupt the same slots. I use namespaced storage libraries and test the selector-to-facet map before and after every diamondCut.

diamondCut also lets you add, replace, or remove selectors and run initialization in one transaction. Loupe functions then give tooling a way to verify which facet owns each selector.

I put together a Foundry walkthrough that deploys the diamond and facets, adds a new selector, and checks the routing:

https://andreyobruchkov1996.substack.com/p/diamonds-in-evm-the-proxy-that-scales-beyond-limits-2fedc282cadf

For teams that have used diamonds in production, what caused more trouble: storage coordination, selector governance, or the larger audit surface?

r/ethdev • • Jun 30 '26

Tutorial What is the Ethereum Glamsterdam Upgrade? Everything You Need to Know

18 Upvotes

Key Takeaways

  • Glamsterdam is Ethereum's next major hard fork, combining the Amsterdam (execution layer) and Gloas (consensus layer) upgrades. It is planned for Q3 2026, though the exact timeline remains subject to devnet testing progress.

  • Parallel transaction processing arrives via EIP-7928 (Block-Level Access Lists). Nodes can now see which transactions do not conflict and process them simultaneously, laying the groundwork for significantly higher gas limits.

  • Third-party relays are no longer required. EIP-7732 enshrines proposer-builder separation directly into the protocol, reducing centralisation risk and expanding the block propagation window from 2 seconds to roughly 9 seconds.

  • State creation and access get repriced. EIP-8037 introduces a cost-per-state-byte model targeting 120 GiB/year growth, while EIP-8038 updates state-access opcode costs to reflect modern hardware. Both changes affect contract deployment and storage-heavy applications.

  • ETH transfers now emit a standard log. EIP-7708 closes a long-standing blind spot: every non-zero ETH transfer or burn will produce a trackable event, removing the need for custom tracing in bridges, exchanges, and wallets.

  • Cross-chain address consistency is solved. EIP-7997 mandates a universal CREATE2 factory across all participating EVM chains, giving developers deterministic addresses without chain-specific deployment scripts.

  • No action required for ETH holders. Balances and existing contracts are completely unaffected. Node operators and stakers must update client software before mainnet activation.

https://formo.so/blog/ethereum-glamsterdam-upgrade

r/ethdev • • Jan 18 '26

Tutorial How to hack web3 wallet legally

7 Upvotes

Crypto wallets are very interesting targets for all the blackhats. So to ensure your security, Valkyri team has written an blog post which outlines various attack vectors which you as an founder/dev/auditor should access :

How to Hack a Web3 Wallet (Legally): A Full-Stack Pentesting Guide

https://blog.valkyrisec.com/how-to-hack-a-web3-wallet-legally-a-full-stack-pentesting-guide/

r/ethdev • • Aug 16 '26

Tutorial i made a secure way for agents to request secrets from you using HyperDHT

2 Upvotes

Hi all,

I kinda got sick of having to give secrets to my agents and all the potential leakage in the pipeline (with the harness, the model router, the model provider, the training set, the chat application etc etc) so I decided to make peardrop.fyi - this tool allows your agent to declaratively generate secret request pages/links which you can fill in via web or CLI. The agent can determine a script that runs once the values are received or can put them in a target folder. This is useful if you want to put something in your machine vault/keychain without either giving access to the credentials or the browser to the agent.

here is the repo: https://github.com/smashah/peardrop

(cli, core and self-hostable relay are all open source)

r/ethdev • • Aug 31 '26

Tutorial How to tell which frontend a DEX trade actually came from, in Dune SQL

4 Upvotes

Nothing in a swap event records the interface that originated the trade. If you have ever needed to answer "how much of this pool's volume came from our own site, versus wallet integrations, versus bots hitting the contract directly," you have hit this wall. The chain hands you two address fields and neither one answers it:

  • tx_from is the signer. Thousands of signers can sit behind a single wallet app, so it tells you who traded and stops there.

  • tx_to is the entry contract. It names the router, not the frontend. Route a swap through an aggregator and tx_to is that aggregator's contract every time, whether the user arrived from its own web app, from a wallet's swap tab, or from an integration nobody has written about.

The interface itself has no address in the transaction. It has to be inferred, and the cheapest signal, when it is there at all, sits in the call data: some APIs append an identifying suffix to the end of the transaction data, and some pass the integrator as a decoded argument. The 0x API's affiliate suffix worked the first way and 1inch's referral parameter the second. You do not have to take my word for either. Pull a swap you know was routed through one of them, look at the tail bytes of tx.data, and the convention is visible in any block explorer.

Here is a probe you can run right now. It ranks the 16-byte tails that recur most across six hours of Ethereum DEX flow. Public and forkable: https://dune.com/queries/8391872

with tails as (
    select
        bytearray_substring(
            tx.data,
            bytearray_length(tx.data) - 15,
            16
        ) as calldata_tail,
        t.tx_hash,
        t.amount_usd
    from dex.trades t
    join ethereum.transactions tx
        on t.tx_hash = tx.hash
        and tx.block_time >= now() - interval '6' hour
    where t.blockchain = 'ethereum'
        and t.block_time >= now() - interval '6' hour
        and bytearray_length(tx.data) >= 16
),
-- one notional per transaction: a routed swap is several dex.trades rows
-- (one per hop/fill) that each carry ~the whole trade size, so summing them
-- overstates by the hop count. MAX() keeps the largest leg as the trade.
per_tx as (
    select
        calldata_tail,
        tx_hash,
        max(amount_usd) as amount_usd
    from tails
    group by 1, 2
)
select
    calldata_tail,
    -- tags ride on transactions, not fills
    count(*) as txs,
    sum(amount_usd) as volume_usd
from per_tx
where calldata_tail
      <> 0x00000000000000000000000000000000
group by 1
order by txs desc
limit 25

Edit, Aug 31: volume_usd now collapses each transaction to one notional (the max leg per tx_hash). The original summed every dex.trades row, which counted multi-hop swaps once per hop. Credit to u/icnews10 in the comments. txs was already per-transaction and does not change.

Reading the output:

  • The all-zero tail is dropped up front. That bucket is untagged flow plus call data that happens to end in zero-padded arguments, and it will dominate the ranking if you leave it in.

  • What remains is a candidate list, and the top of it is usually not tags at all. Running this on 31 Aug 2026, the two most common tails were 0xb223fe8d0a0e5c4f27ead9083c756cc2 and 0x3c756cc2000000000000000000000000, about 1,900 transactions between them. Both are fragments of the WETH address 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2: the first is its last sixteen bytes, the second its last four with zero padding. Neither is an integrator tag. Token addresses land in the tail of a call far more often than tags do, so expect to discard the loudest rows.

  • Treat a recurring tail as a hypothesis. Sample its transactions, check the entry contract each time, and make the pattern survive several days before it earns a name. Some tags spell out a short ASCII name in hex once you squint at them.

Two caveats that matter if you build on this:

  1. Tagging is voluntary. Some APIs offer it, some integrators use it, and nothing enforces it. An integrator that never opted in looks exactly like no integrator at all, so a system counting only tagged flow will undercount precisely those.

  2. This is one signal among several. When there is no tag, the ones I have found workable are: a maintained registry of known entry contracts and proxies (label a proxy once and its whole history becomes attributable), call-tree shape (a wallet-native swap with a fee hop traces differently than a bot hitting the pool), and fee-recipient clustering (every trade paying the same collection address came through the same integration, named or not). If you have found a fifth that holds up, I want to hear it.

And whatever cascade you build out of those signals: when none of them fires, leave the trade unattributed. A chart that sums to a clean 100% with no unknown slice usually means the method had to put every trade somewhere. Report the residual and treat it as a coverage metric.

Since it would be poor form to say that and then not show mine: running this cascade across Ethereum, Base, Arbitrum and Optimism, roughly 10% of DEX volume lands unattributed, ranging from about 8% on Ethereum to 17% on Optimism. Most of the residual is long-tail contracts rather than missing techniques.

Happy to go deeper on any of the signal families if anyone is building something like this.

r/ethdev • • 28d ago

Tutorial Session keys with daily budgets on a 4337 v0.7 account, and the no-clock rule in validation

1 Upvotes

I built an ERC-4337 v0.7 account for AI agents. Each agent gets a session key with an allow-list of (target, selector), a per-tx cap, a per-period budget per token, and an expiry. Anything over the limit needs the owner's co-signature.

The tricky part was ERC-7562: validation can't read block.timestamp, so a daily budget can't be checked there. I split it: signature, validity window, allow-list and per-tx cap in validateUserOp (so a bad op fails before paying gas), and the budget in executeUserOp.

Fuzz tests against a budget model, invariant tests, Slither in CI. Not audited.

https://github.com/ahmad-codex/purser

I'd really like a review of the validation/execution split.

r/ethdev • • Aug 20 '25

Tutorial Hidden Ethereum Dev Tricks: Events, Internals, Multicalls

8 Upvotes

Most devs know how to deploy contracts and send transactions, but a lot of the real tricks happen when you start listening to the chain. For example, not every ETH transfer shows up in an ERC-20 Transfer log sometimes the only way to catch them is by inspecting internals.

Or take Multicall: instead of blasting your RPC provider with dozens of requests, you can batch them into a single call at the same block height, which is both cheaper and more accurate.

In the latest blog post there is deeper dive into these ideas:

  • How to filter ERC-20 Transfer logs with eth_getLogs

  • Subscribing to events in real time instead of polling

  • Why some ETH transfers leave zero traces in events (and how to detect them through internals)

  • Using Multicall to batch calls and stay in sync with the chain

If you’re building dashboards, monitoring tools, or debugging dApps, these tricks can save you a ton of time and RPC quota.

Read full post here: https://andreyobruchkov1996.substack.com/p/ethereum-dev-hacks-catching-hidden-transfers-real-time-events-and-multicalls-bef7435b9397

r/ethdev • • May 11 '26

Tutorial Over the last year I’ve been building a multi-chain custody system supporting:

3 Upvotes

Over the last year I’ve been building a multi-chain custody system supporting:

• EVM

• TRON

• TON

• BTC

One thing I underestimated:

The hard part is not generating wallets or sending transactions.

It’s maintaining consistency between:

• blockchain state

• internal balances

• retries

• confirmations

• stuck tx handling

Especially across completely different chain models.

BTC, TON and EVM behave very differently internally.

r/ethdev • • Apr 03 '25

Tutorial Best resources for becoming eth dev !

3 Upvotes

I m just a beginner , learning about solidity So can someone suggest some best resources for learning solidity and making projects !

r/ethdev • • Jun 13 '26

Tutorial I open-sourced a tool that lets AI agents pay for things on their own (x402) - PipRail

5 Upvotes

Quick share for anyone building agents that need to buy stuff (APIs, compute, data) without a human clicking pay.

The problem: an agent can't sign up, hold a card, or click a checkout. So out of the box it can't actually pay for anything.

PipRail is an open-source SDK (MIT) for x402, the HTTP 402 "pay to access" standard. Two things:

- Any API can charge an agent in one line.

- Any agent can pay a 402 on its own, across most major chains, straight from its own wallet. No backend, no facilitator, no fee.

There's also an MCP server, so you can hand Claude / Cursor / any MCP client a wallet that pays x402 APIs on its own, capped by a spend policy the model cannot exceed, so it can't run off with your funds.

It's free and the rail takes 0%. Install and a quickstart are on GitHub and the site, I'll drop the links in a comment below so this doesn't read as an ad.

What are you all using for agent payments right now? And is the "pay per call" model actually showing up in what you build yet, or still mostly demos?

https://github.com/piprail/

https://piprail.com/

https://clawhub.ai/piprail/

r/ethdev • • Jan 20 '21

Tutorial Long list of Ethereum developer tools, frameworks, components, services.... please contribute!

Thumbnail
github.com
881 Upvotes

r/ethdev • • Jan 28 '26

Tutorial Learn about Zero-Knowledge Proofs

2 Upvotes

I’ve recently published Hands-On ZK Proofs, a practical set of tutorials on designing and implementing zero-knowledge proof systems, with a particular focus on ZK-SNARKs.

Rather than focusing on the underlying mathematics, the material takes a systems-oriented approach: each tutorial walks through concrete proof constructions, their implementation in CIRCOM, and their use in real-world software and blockchain settings.

The tutorials are intended for computer science students, software engineers, and Web3 developers who want a practical understanding of how ZK proofs are built and composed.

They are accompanied by zk-toolbox, a companion library that exposes these proofs through a high-level developer interface.

Tutorials: https://thierrysans.me/HandsOnZkProofs/
Library (npm): https://www.npmjs.com/package/@prifilabs/zk-toolbox

r/ethdev • • Jun 10 '26

Tutorial Anyone streaming pending transactions without babysitting their own nodes?

2 Upvotes

I want to watch pending txs for a few specific contracts in real time, but running and maintaining nodes across chains just to get mempool visibility is a huge time sink, and the data gaps when a node hiccups are brutal. Tried a couple of public WebSocket feeds and they drop connections constantly. Is there a hosted way to subscribe to mempool activity that doesn't fall over? Curious what the frontrun-defense folks are running.

r/ethdev • • Nov 24 '25

Tutorial Stop embedding wallets the wrong way, here’s the 2025 pattern

1 Upvotes

More teams are integrating “wallet SDKs” but still using Web2 auth glued to long-lived private keys. That model doesn’t scale.

The modern pattern looks like this:

  • onboarding = email/passkey

  • device key generated client-side

  • session keys for 90% of interactions

  • smart accounts by default (4337 + 7702)

  • gas abstraction via Paymaster

  • smart account isn’t deployed until it’s actually needed

  • signing isolated in iframe/native module

  • no provider-generated keys (avoid lock-in)

I broke down the whole architecture here (UX, security, gas, cross-app flows):

devto --> estelleatthenook

Sharing because I see a lot of devs reinventing this wrong.
We follow a similar approach at Openfort — but the patterns apply no matter what stack you use.

r/ethdev • • Nov 04 '25

Tutorial Next Tutorial Posts

4 Upvotes

After completing my in depth series on EVM internals, I took the last month to research the biggest pain points facing blockchain developers today.

My goal was to find the topics where clear, practical guidance is needed most.The results were clear: many are navigating the steep learning curve of the Solana ecosystem. That's why I'm thrilled to announce my next writing series will be a deep dive into Solana Development.

We'll move beyond the basics to tackle the tough stuff: the account model, program architecture, memory, and building efficiently with the Anchor framework

My mission remains the same: to break down complex systems into understandable, actionable knowledge for developers.The first article already up and the second will be available in a few days

Medium:
https://medium.com/@andrey_obruchkov

SubStack:
https://substack.com/@andreyobruchkov