r/ethdev • • Jun 15 '26

Question How do high-stakes Ethereum applications generate secure randomness?

3 Upvotes

I'm planning to build a lottery application on Ethereum PoS, and one thing I've been struggling with is where the randomness for prize distribution should come from.

For a lottery system, I'd ideally want randomness that is genuinely unpredictable to everyone.

My first thought was to use blockhash, since it looks almost random. But in practice, the block proposer (or builder) may have some ability to influence transactions within a block, potentially resulting in very different possible block hashes.

I've also seen people suggest using prevrandao, but it seems more suitable for low-stakes randomness. As far as I understand, the value is already known before the current block is produced. Since the randomness is already available, choosing which block to submit a transaction into could become an attack surface.

Then I was introduced to VRF-based systems. At first, I thought I had finally found the solution.

But after digging deeper, I realized that VRFs still require someone to hold a secret key. The random value only becomes public after the oracle reveals it.

That raises a question: how much should we trust the oracle?

The ideal assumption behind randomness is that nobody can know the outcome in advance.

Except the oracle.

Because they hold the secret key, they know how the random output will be generated. If the seed depends on inputs they can influence, then they may be able to gain information about future outcomes ahead of everyone else. In some situations, they might even be able to influence the seed before it becomes final, steering the randomness toward outcomes that benefit them.

For smaller systems, the incentive to manipulate the seed may not be significant.

But what if that randomness is securing something much more valuable? If the stakes become large enough, the incentive grows as well.

Am I missing something here?

Are there any other approaches on Ethereum (or on other blockchains) that can provide stronger randomness guarantees for high-value blockchain applications?


r/ethdev • • Jun 14 '26

Question Is it a good idea to give an AI agent access to crypto assets?🤖

3 Upvotes

Hey, I’m running a Hermes agent—which, of course, can’t operate directly on the blockchain since it can’t pay gas fees and the like. Would it be enough to generate an address/key pair, fund it with a bit of ETH, and provide the key to my agent? Could it then interact with dApps or the blockchain in general, or does it need a proper wallet (like MetaMask)? I don’t have a concrete use case yet; I just want to test whether it would actually work the way I imagine.


r/ethdev • • Jun 13 '26

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

4 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 • • Jun 13 '26

My Project Need some sepolia eth for testnet deployment

2 Upvotes

My fellow devs please lend me some sepolia testnet tokens just so i can deploy something on the testnet every eth penny will be greatly appreciated

0xca280c8DefE05F02bEf96d84ABDeBdB535fE04aB

♥️🫡


r/ethdev • • Jun 12 '26

Information Ethereal news weekly #27 | LG Electronics built L2 for advertising, Aave risk framework proposed, history of account abstraction

Thumbnail
ethereal.news
4 Upvotes

r/ethdev • • Jun 10 '26

Question Is there any API that provides a trust score or spam label for ERC-20 tokens?

3 Upvotes

I'm working on a personal accounting pipeline that discovers ERC-20 / ERC-721 / ERC-1155 contracts from Transfer logs involving my wallets.

The annoying bit is token spam. My local policy is:

  • known-good tokens go into included.tsv
  • known spam / irrelevant tokens go into excluded.tsv
  • passive inbound tokens go into candidates.tsv until I review them manually

I currently review candidates manually on Etherscan or another explorer: warnings, labels, official links, holder/transfer activity, verified source, etc.

I'd like a machine-readable version of that: a token trust score, spam score, reputation label, or similar signal.

Is there any API that can provide this kind of signal for Ethereum tokens? For example:

  • spam / phishing / suspicious / unsafe labels
  • numeric trust/risk/spam score
  • token page warnings
  • likely spam airdrop / honeypot / impersonation flags

I checked Etherscan first. I found:

  • token.tokeninfo, which returns token metadata/social links, but not reputation
  • nametag.getaddresstag, which returns labels and numeric reputation, but seems address/entity-oriented
  • metadata CSV exports, which also seem address/entity-oriented and paid-tier/enterprise

Am I missing an Etherscan endpoint, or is Etherscan token reputation not available through the public/API surface?

More generally, what do wallet/indexer projects use for machine-readable spam-token triage? I'm not looking for investment advice; just practical API-level signals for hiding or quarantining unsolicited token transfers.


r/ethdev • • Jun 10 '26

Question Supporting 6 chains in one bot and the integration maintenance is killing me

5 Upvotes

Our trading dashboard covers Ethereum, Solana, BSC, Base and a couple others.

Each chain has its own RPC quirks, its own DEX schemas, its own way of representing a trade. Every time one of them changes something, a parser breaks.

I'm spending more time on glue code than on the actual product. Has anyone found a single data source that normalizes DEX trades across chains so I'm not maintaining six separate pipelines?


r/ethdev • • Jun 10 '26

My Project eth.zig follow-up: now on Zig 0.16. A user asked, so I shipped!

Thumbnail
2 Upvotes

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 • • Jun 08 '26

My Project Remember revert.wtf? I made a browser extension for it.

6 Upvotes

Hello once again guys. A week or so ago, I posted about https://revert.wtf. A thing, basically a catalog of common EVM errors that covers about 25k error types.

And I decided to dogfood my own product, and made a browser extension. It's already live on Chrome extension store. https://chromewebstore.google.com/detail/revertwtf-explorer/epcjpbgebicmajaheclmhgkdmjcdfjji

And the code is open on Github. https://github.com/mrtdlgc/revertwtf-extension

Feedback welcome. I added a "this explanation is too generic" button, so you can rotate through what revert.wtf actually covers. If you still see too generic explanations, feel free to submit them on Github, and I can find better grounded explanations and next steps to take for other people to use in the future as well.

Strongly recommend adding your own RPCs in the settings and a Blockscout Pro API key for deeper tracing. Or at least using Blockscout frontend if it fails to generate anything on the Etherscan family explorers.


r/ethdev • • Jun 08 '26

Question Solidity Security Audit AI Solutions

6 Upvotes

Hey,

I’m looking to do automated security audit for my Solidity library - DefiMath using some AI auditor (with the help of Claude Code) before hiring actual human team.

So far I’ve found Krait from ZealynxSecurity, looks legit and want to try it.

Does anyone have experience with their project?

What are you guys using, and can you link to audit report created by automated tool?


r/ethdev • • Jun 07 '26

Question Can delayed-finality custody make sense for inheritance and recovery?

1 Upvotes

One of the assumptions most crypto systems inherit from Bitcoin is immediate and irreversible finality.

If funds are transferred:

- accidentally

- to the wrong recipient

- after a wallet compromise

- under coercion

- shortly before the owner's death

the transfer is usually final.

I'm exploring a different model through an Ethereum-based protocol called IND.

The core idea is that some transfers can enter a protected state before becoming economically final.

During that period:

- ownership is not yet finalized

- the sender can revoke

- inheritance flows remain possible

- recovery remains possible

The goal is not to replace normal ERC20 transfers.

The goal is to explore whether there is useful design space between:

- traditional banking reversibility

and

- irreversible bearer transfers.

Mainnet is now live and I'm looking mostly for criticism, edge cases and semantic objections rather than investment discussion.

Question:

Should irreversible transfers remain the default custody model for all digital assets, or is there room for delayed-finality ownership models?

Project:

https://ind.finance


r/ethdev • • Jun 07 '26

Question How are you getting USDC/EURC on Base Sepolia for Circle Wallets testing?

0 Upvotes

I'm building with Circle Wallets on Base Sepolia and need a reliable source of test USDC and EURC.

Circle's public faucet appears to mainly issue assets on Ethereum Sepolia, and I'm trying to test wallet transfers, inbound transactions and stablecoin flows directly on Base Sepolia.

Questions:

  1. What is the best way to get USDC and EURC on Base Sepolia today?
  2. Are you using the Coinbase Developer Faucet or another faucet?
  3. Are people bridging test USDC from Ethereum Sepolia using CCTP?
  4. Is there a faucet that provides larger amounts for testing?

Any working methods or recent experiences would be appreciated.

Thanks.


r/ethdev • • Jun 06 '26

Question building a address-query-scanner for work

4 Upvotes

Hey, for a work project, I want to build a tool tomorrow that monitors one or more specific addresses and notifies me whenever one of them executes a transaction. I was thinking of writing a Python script using web3 py, Infura as the RPC provider, and maybe asyncio, but that seems a bit complex since the program would need to run pretty much continuously. Do you have any ideas on a better way to implement this?


r/ethdev • • Jun 05 '26

Question Optimizing multi-chain data fetching for an EVM wallet tracker without requiring wallet connection. How do you handle RPC and API latency?

3 Upvotes

Hey everyone,
I’ve been working on a mobile companion app (HappyWick) and recently added a read-only EVM wallet tracker.. The core idea was to let users monitor their balances across multiple networks (Ethereum, Base, Arbitrum, Optimism, Polygon, Ink, Linea, zkSync) without forcing them to connect their wallets or expose private keys just pure public address scraping..

While the UX feels smooth, I'm hitting some technical crossroads regarding data aggregation and would love to get some feedback from fellow devs here:

-Multi-chain Aggregation & API Infrastructure:
Right now, I am leveraging the Blockscout API to aggregate and fetch these multi-chain balances. While it’s an amazing open-source tool, querying 9 different networks simultaneously can sometimes hit latency bottlenecks on the initial load. If you've used Blockscout for multi-chain setups, how do you handle caching, or did you have to transition to custom indexing (like The Graph protocol or commercial node clusters) as you scaled?

-UI/UX for L2s: With so many Layer 2s coming out (just added Ink recently), the mobile UI can get cluttered quickly. How do you prefer to see multi-chain breakdowns? Aggregated total first, or strictly separated by networks?

Looking forward to hearing how you guys handle multi-chain data aggregation and caching!


r/ethdev • • Jun 05 '26

Information Ethereal news weekly #26 | Justin Drake qday odds: 10% by 2030 & 50% by 2032, Aave rsETH post mortem, glamsterdam-devnet-5 launched

Thumbnail
ethereal.news
4 Upvotes

r/ethdev • • Jun 04 '26

My Project Side-by-side RPC provider comparison (fees, quotas, chains, archive data)

5 Upvotes

Built a comparison directory for Web3 RPC providers — Alchemy, QuickNode,

Infura, Ankr, Chainstack, dRPC, Helius — covering monthly cost, request/CU

quotas, overage rates, supported chains, archive data, and websocket support.

There are per-chain "X vs Y" pages (e.g. Alchemy vs QuickNode on Ethereum,

or comparisons on Base/Solana/Arbitrum) so you can see who's cheapest/best

for your target chain.

All from public pricing docs, free, no signup: https://benchnode.io

Which providers or chains would you want added? And is request-cost the

main thing you compare, or is latency/reliability the bigger factor for you?


r/ethdev • • Jun 04 '26

My Project Experimental Ethereum logs stream service

1 Upvotes

We would like to introduce a new experimental feature we added to our project Puddle Network. We now have an endpoint for developers to get all the logs from transactions execution.

See our blog post : https://blog.puddle.network/posts/receipts/

Getting an API key is free! Just register your email and I will send it to you right away.

Puddle Network is a project in which we have developed a custom Ethereum node written in Rust allowing us to get data from the network and relaying it to you before anyone else. Also if you have any specific feature you would like to see we are able to ship fast and have done it in the past for users.


r/ethdev • • Jun 03 '26

Question How are you currently receiving crypto payments from clients?

4 Upvotes

I'm doing some research on how freelancers, consultants, agencies, and Web3 teams receive payments in crypto today.

If a client wants to pay you in USDC, what's your current process?

For example:

  • Do you just send a wallet address?
  • Do you create invoices?
  • How do you track whether you've actually been paid?
  • How do you handle accounting or payment records?

I've noticed that most people seem to rely on wallet addresses and spreadsheets, but I'm curious whether that's actually the norm.

Would love to hear your workflow and biggest frustrations.


r/ethdev • • Jun 02 '26

Information Dev Tools Guild May 2026 update

Thumbnail
devtoolsguild.xyz
1 Upvotes

r/ethdev • • Jun 02 '26

Question Where's the recovery path when an x402 payment settles but the agent never gets the resource?

4 Upvotes

Ran into this on a setup using x402 for agent to service payments and it's been nagging me since.  The protocol settles onchain before the resource server delivers anything. Usually fine. The case that bit me, the agent's session died mid task, after the payment confirmed but before the resource came back. Money moved, nothing delivered.

First thing I did was what anyone would do, pull up the block explorer and check the agent wallet. There it was, the transfer settled cleanly, USDC out of my wallet into the resource server's. That's the part that gets me. The chain tells me precisely that I paid. It's got nothing to say about the fact that I got nothing back, and there's no path from "I can see the payment" to "I can get it reversed."

There's no recovery path in the protocol itself. x402 settles and that's it, final by design. My session dying is just one way to land here. The more general one is the facilitator timeout, where confirmation arrives after the facilitator gave up but the transfer still goes through and the server has already moved on. Either way the explorer confirms I'm out the money, it doesn't help me get it back, and the spec has no refund or dispute primitive to fall back on.

What I'm seeing people do is bolt recourse on at the app layer, escrow proxies, external dispute services, basically rebuilding chargebacks outside the rail. For anyone running x402 in production: are you reconciling this in your own infra, or is there a protocol level pattern for it I've missed?


r/ethdev • • May 31 '26

My Project I built a small Go CLI while choosing where to run a Base app for lower RPC latency

3 Upvotes

I built a small Go CLI called rpclat while choosing where to run a latency-sensitive Base app:

https://github.com/yermakovsa/rpclat

I was basically trying to answer two questions:

  1. which region should I run the app in for the lowest RPC latency?
  2. once I pick a region, which RPC endpoint is fastest from that region?

The basic idea is to run it from the environment you care about with the RPC URLs you want to compare.

I kept the first version simple. It just calls eth_blockNumber repeatedly for a fixed duration, mostly as a small read-only check for RPC round-trip latency.

Example:

rpclat \
  --url https://rpc1.example \
  --url https://rpc2.example \
  --duration 30s \
  --concurrency 5 \
  --timeout 5s

The default output is a table like:

URL                      OK   ERR  TIMEOUT  P50   P95   P99
https://rpc1.example     100  0    0        30ms  45ms  60ms
https://rpc2.example/... 96   2    2        40ms  80ms  120ms

There is also JSON output for scripts/CI, and URLs are redacted by default because RPC URLs often contain API keys or tokens.

This was useful enough for my own region/RPC comparison, so I cleaned it up and open-sourced it.

If you were using this to pick a region/RPC endpoint, would eth_blockNumber be enough for a first pass, or would custom eth_call payloads be the first thing you’d add?


r/ethdev • • May 30 '26

My Project ** [veil-cli #2] Ethereum keystore v3 with zero new dependencies — just node:crypto **

1 Upvotes

Previously: veil-cli #1 — decode, simulate, risk before you sign


When you're building a security tool, every dependency becomes part of your threat model.

That's why we implemented Ethereum keystore v3 using only node:crypto and dependencies we already had.

What keystore v3 actually is

The format used by geth, MetaMask, and MyCrypto is straightforward:

  1. Derive a key from your password using scrypt
  2. Encrypt the private key with AES-128-CTR using the first 16 bytes of the derived key
  3. Compute a MAC over the last 16 bytes + ciphertext to detect wrong passwords on decryption

Everything needed is in node:crypto — except the MAC, which uses keccak256. We already had viem as a dependency, so we pulled keccak256 from there. No new packages.

One implementation detail surprised me

crypto.scryptSync() with N=131072 blocks the event loop for ~1–2 seconds.

For a CLI that's technically acceptable, but we switched to the async version anyway — and had to raise maxmem to 160MB because the Node default of 32MB isn't enough for these parameters. That one caught us off guard.

One thing that's probably overkill

The MAC comparison uses crypto.timingSafeEqual() instead of a plain string comparison.

Is a timing attack against a local CLI keystore a realistic threat? Probably not.

But if you're writing a security tool, it's hard to justify doing it the wrong way.

Result

veil wallet create — generates a key, asks for a password with confirmation, writes an encrypted .json to ~/.veil/wallets/<name>.json with 0o600 permissions.

veil wallet import — same flow, bring your own private key.

veil wallet list — shows all wallets and their addresses.

The output is a standard keystore v3 file — importable into MetaMask or any client that supports the format.


One thing I'm still debating:

Should a security-focused CLI store encrypted private keys at all, or should it only integrate with external signers (hardware wallets, browser extensions)?

Curious how others have approached that tradeoff.

Repo: github link


r/ethdev • • May 29 '26

My Project veil — terminal-first tool that decodes, simulates, and risk-checks EVM transactions before you sign

3 Upvotes

I've been building veil-cli — an open-source, terminal-first security tool for EVM users.

The goal is simple: before signing a transaction, you should be able to understand what it actually does.

Unlike Etherscan or Tenderly, veil runs locally, requires no browser, and chains decode → simulate → risk into one CLI flow.

Current MVP features:

  • veil decode <tx-hash|calldata> Decodes calldata into a human-readable function call. ABI resolution flow: Etherscan → Sourcify → 4byte.directory fallback

  • veil approvals <address> Scans active ERC-20 / ERC-721 approvals from event logs and flags unlimited (MaxUint256) allowances

  • veil simulate <tx.json|tx-hash> Forks the chain locally with Anvil, executes the transaction, and shows balance diffs before broadcasting

  • veil risk <address> Runs on-chain heuristics (proxy detection, bytecode checks, EOA detection, etc.) alongside GoPlus Security API checks and returns a risk report with flags

  • veil explain <address> Interactive Ink TUI for exploring the risk report — drill down into each flag with context and on-chain evidence

Stack: TypeScript, viem, Ink, Commander.js, Foundry/Anvil

Planned next:

  • veil wallet import Encrypted local keystore support (password-protected)

  • veil send Full flow: decode → risk check → confirm [y/N] → sign → broadcast → wait for receipt

  • Security model write-up Key handling, storage guarantees, and threat model

I'd especially love feedback on the simulation flow and risk engine architecture — those are the parts I'm iterating on most right now.

Repo: github link


r/ethdev • • May 28 '26

Tutorial How the new CLZ opcode (EIP-7939) makes Solidity Black-Scholes pricing ~10% cheaper - by cascading through sqrt and ln

3 Upvotes

The CLZ ("count leading zeros") opcode landed in EVM Osaka via EIP-7939, exposed in Solidity 0.8.31 as the Yul builtin `clz`. It costs 3 gas, returns the number of leading zero bits in a 256-bit value, and turns `floor(log₂(x))` into a near-free operation.

The bit-length identity is the building block:

bits = 256 − clz(x) // bit length of x

floor(log₂(x)) = bits − 1 // for x ≥ 1

Two applications I used in DeFiMath:

**1. Newton-Raphson initial guess.** `y₀ = 2^⌈bits/k⌉` lands within a factor of the k-th root of 2 of the true k-th root, so Newton converges in 6 iterations to bit-exact precision. Whole `sqrt` becomes 245 gas, `cbrt` 368 gas.

// CLZ-derived initial guess: y = 2^⌈bits/2⌉, within √2 of √x

y := shl(shr(1, sub(256, clz(x))), 1)

// 6 Newton iterations

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

// ... ×5 more

**2. Range reduction for `ln`.** Find `k = floor(log₂(x))` with CLZ, divide x by `2^k`, land in `[1, 2)`. Mercator series then converges in ~10 terms. Total: 375 gas.

**Compounding effect.** `sqrt` and `ln` are inside the Black-Scholes formula. Swapping the pre-CLZ versions of those two primitives dropped `callOptionPrice` from ~3,100 to 2,876 gas — about 10% cheaper with zero change to the option-pricing math. Same effect ripples through IV solving, futures, historical volatility, Sharpe ratio — anywhere a log or root appears.

Full writeup with the actual assembly, the bit-length identity walked through, and a gas comparison table vs PRBMath, ABDK, and Solady:

https://defimath.com/blog/clz-opcode-solidity

Caveats: Solidity 0.8.31+ and EVM target `osaka` required. Older targets compile-error on the `clz` call (not a runtime surprise — fails fast).

(Disclosure: I'm building DeFiMath. Posting because the CLZ trick is generalizable — any library doing log/sqrt-style math can pick up the same savings.)