185 points · by tosh · 4y ago · 70 comments
Perhaps a transaction reusing a nonce made it to the mempool, but the attacker, watching the mempool, immediately submitted (or even cooperated with a mining pool to) a transaction emptying the sending account, using a much larger fee to push out the other transaction. That would leave no trace of the nonce reuse on chain.
So really R=k*G generates a new point R, where k is the nonce and G is a point that is part of the ECDSA standard. Then r is taken as the x-coordinate of R.
It is easy to derive k in b=k*a mod N if you know a and b, but nearly impossible to derive k in B=k*A if B is k self additions of A on an elliptic curve.
https://corecursive.com/064-ethereum-rescue-with-dan-robinso...
Dan: Maybe I’m like a predator in this environment where… In this case, I was a white hat hacker, but maybe I’m a black hat hacker. Maybe I’m trying to take money from a smart contract. And I think I’m so smart. Like I put a bunch of effort into figuring out this way to steal this money from it. And as soon as I go to do that, just this whale comes up from the deep and just devours me whole. I think I’m actually at the top of the food chain and I’m not even close.I mostly don't touch, like or welcome meme shitcoins. I think NFTs are as much a grift as ICOs were in 2017, etc. etc. I still love the tech. I still love the mindsets of the people I got to meet through crypto and while there is a lot of BS, there are also a lot of very smart people working to build things that give us a fighting chance to take back some of the control and privacy that we have surrendered to FAANG and co.
So, criticize away. Or just shit on it if you want, which is what some of HN is really doing. It changes nothing. I for one am grateful for everything constructive being said, because it paves the way to a future I and many others are hopeful and excited about.
For one, they don't rely on "number go up" to make money, they use strategies similar to those used by HFT firms to make money from market inefficiencies. They generally don't have loyalty to a particular crypto platform, they just go wherever they can find a competitive advantage. They also tend to be much less politically outspoken and often left-leaning, in contrast to the vocal libertarian views that permeate the rest of the field.
They also most certainly aren't "imagining" making money. Most of their strategies are essentially elaborate forms of arbitrage, which are risk-free sources of profit by nature (until out-competed). Their only losses come from fees paid for deploying strategies that turn out to be unsuccessful. Even fees for failed transactions are pretty much a non-issue these days because of Flashbots.
This is a minority of the people in tech and on HN. It's not taboo in general (as those groups only make up a tiny fraction of the population), nor even taboo for those specific groups - so I think that makes calling it a "taboo" at all a stretch.
There are various techniques people use for them: a careful counter, a precise timestamp, a hash of the rest of the data, or a random number. Often you can choose as the user... as long as you don't use the same value twice; alternatively, your choice of nonce might be verified by your counter-party (as with Ethereum's account nonces).
The consequences of using the same value twice will also differ: your request might be rejected/ignored, you might be penalized or cause an error, it might expose your identity to a system where you were otherwise anonymous, or it might allow someone to calculate your private key. The high-level idea is what matters, not the specifics.
People use some kind of "replace by fee" transactions all the time, as far as I know these broadcasted transactions, typically with higher fees, have the exact same nonce as the previous one.
If simply reusing the same nonce allowed someone to crack the private key, it'd be a much bigger issue than a few wallet emptied. It'd be a tremendous amount of wallets emptied, daily.
Can someone explain in more details?
How could reusing a nonce once lead to a full compromise?
Or is it only if the nonce is reused, but for the exact same transaction, with all the parameters identical, then signed using the same private key but some other random point?
Modern signature schemes such as EdDSA do not have this footgun as they specify a completely deterministic procedure for deriving a fresh nonce for each pair of (message, private key), simply by applying a cryptographic hash function to their concatenation. This is MUCH safer for the implementor, and also simpler to implement because one doesn't have to bother with maintaining a stateful PRNG
So there would be very little reason to duplicate a chain for that. You can already get the free stuff and you can’t copy the rest because clubs will look at their register not yours.
But...the interesting part. What happens when cross-chain asset movement is much simplified? I don't see there being any issue with legitimacy (original owners could still verify ownership, you couldn't). But if you flooded original chain with fakes, uh...
Talked myself out of it. nevermind
It is an interesting scenario to think through, in particular what happens with stablecoins etc. which would not be redeemable.
Ultimately, I predict such efforts to fail badly. The fact that e.g. Ethereum NFTs are copied will in fact work against such a fork getting traction.
*Would this actually work? Not a Ethereum/Bloclkchain guy myself.
2) Unless you are a malicious BTC\ETH mining node that got the future transaction (which uses the nonce again), it will be too late. You will learn about the re-use only after the blockchain update propagates.
It may assume some knowledge of things like etherscan and the EVM though.
It was a scam.
I wonder how it was done, Etherscan didn't show anything and compiling it led to a few bytes of difference between what was compiled and what was deployed.
Fortunately, there are tools like Ganache, which you can run with `ganache-cli --fork` to reliably emulate locally what will happen when transactions are sent to mainnet. I would accept no substitute approach when dealing with suspect contracts.
[1]: Like this Unicode RLO exploit for instance: https://krebsonsecurity.com/2021/11/trojan-source-bug-threat...
[2]: https://tenderly.co or mainnet forking using hardhat are convenient ways to achieve this.
That bot is doing pretty bad in such an active year
One thing to check about the other addresses is if they compromised themselves on other networks like public testnets or other blockchains