Live data from Hacker News

Escaping the Dark Forest

samczsun.com

31–40 of 142 posts

Re: Escaping the Dark Forest

#31

I still don't understand what's happening at the core of this and the other dark forest post from a few weeks ago. How exactly are these bots front-running/stealing the ethereums? My understanding: -these bots scan the smart contracts that are waiting to be executed by the miners -the bots find vulnerabilities (another grey area in my mind) in the contract -the bots adjust the destination address of where the contrac…

You put your gold in a box and stuck it in the ground in a ranch in the middle of nowhere. No one knows there is gold in a box in the ground so it's safe. But people know that other people but gold in boxes and stick it in the ground.

One day you go to get it so you load up your pickup with gold digging equipment and drive to the ranch. On the way are spotters. They see your truck has gold digging equipment. They see that the road you're going down leads to the ranch. It's obvious what you're going to do.

They load up their faster Ford Ranger and blaze down the road. You can't catch up. They have a faster car. You get there. They have taken your gold.

If you hadn't gone there, the gold was relatively safe. Maybe some day someone happens on it but realistically probably not.

But you went. By looking for it you revealed you were looking and you revealed where you were looking.

Re: Escaping the Dark Forest

#32
post #25
post #16

i tried writing some toy Ethereum smart contracts circa 2016. at that time it was immensely difficult to write them in a secure way -- even a simple "hello world" level Solidity contract could easily have exploitable bugs if you don't code in an extremely defensive style. i'm told things have improved since then -- can anyone who's used Solidity more recently comment on this? is it true? this, plus the fact that putt…

Well, what are the fixes? Writing "smart contracts" is not meant to be for anybody but very seasoned developers. Also if you write a contract and do not get it audited by 3rd parties than nobody will (or should) take for anything other than a toy application. That's just the nature of writing immutable code that potentially transfers a value. About Solidity in particular - I think most people would say it's not the b…

I've posted this before [0], but it's still apropos regarding the foolishness that is Ethereum.

[Ethereum] only makes sense if all of the following obtain:

(a) the code is 100% bug-free (b/c accidents cannot be rewound)

(b) all code-writers are 100% honest (their code does what they say)

(c) all contract participants are 100% perfect code readers (so as to not enter into fraudulent contracts)

(Strictly speaking, only one of (b) and (c) needs to be true).

None of these conditions will ever obtain.

[0] https://news.ycombinator.com/item?id=14471465

Re: Escaping the Dark Forest

#33

I still don't understand what's happening at the core of this and the other dark forest post from a few weeks ago. How exactly are these bots front-running/stealing the ethereums? My understanding: -these bots scan the smart contracts that are waiting to be executed by the miners -the bots find vulnerabilities (another grey area in my mind) in the contract -the bots adjust the destination address of where the contrac…

It's much simpler than that. (Also, you appear to have a few concepts mixed up. For instance, one doesn't execute smart contracts, but rather transactions. Smart contracts just sit there until someone sends a transaction to one, at which point it executes that transaction.)

What the bot does is that it checks each transaction that is waiting to be executed and simulates sending that transaction itself on a private blockchain forked from the real network. If the simulation results in a profit, it frontruns that transaction -- i.e., it sends the transaction itself for real, but bidding a higher price than the original sender did, so that its transaction will get executed rather than the the original transaction it's copying.

It doesn't need to perform any sort of vulnerability scan; it just mimics other people exploiting arbitrage or vulnerabilities and pays more to get there first.

Similarly, it doesn't need to adjust any destination addresses. It's just looking for arbitrage opportunities or vulnerabilities that will direct ether to the sender. Smart contracts are entirely capable of getting the address of the message sender, and using that as a destination to send ether to. So the bot doesn't need to adjust the transaction data at all, which would be substantially more complicated.

Re: Escaping the Dark Forest

#34

I still don't understand what's happening at the core of this and the other dark forest post from a few weeks ago. How exactly are these bots front-running/stealing the ethereums? My understanding: -these bots scan the smart contracts that are waiting to be executed by the miners -the bots find vulnerabilities (another grey area in my mind) in the contract -the bots adjust the destination address of where the contrac…

Imagine that everyone agreed that just one slow computer would handle banking, contracts, and the stock markets for the entire world. This gets rid of any pesky concurrency issues. To move money from person to person, or to execute contracts or programs, you write up a sticky note with what you want to have done, sign it, and attach some money to it. Once every couple minutes, the computer administrators come out, collect a couple notes with the most money on them, and feed those into the computer.

The Dark Forest attack is possible because everyone can see all the notes on the board waiting to be processed, and everyone can simulate exactly, precisely what the really slow computer will do with a given note.

Suppose you found someone wanting to sell TSLA stock for $5 and someone wanting to buy it for $400. You would write up a note to buy it for $5 and sell it for $400, and stick it on the board. However, the moment you put the note on the board, the attackers and their automated telescopes have simulated that this note results in the holder having $395 more than they started with, and gave nothing away in return. The attacker then simulates an alternate future in which they post the note instead, and verify that they get the money. It works! So the attacker copies your note, signs it themselves, puts a much bigger wad of cash on it than you did, and slaps it up on the board.

When the operators come out, they collect the attackers note first (more cash) and by the time your note is run, the opportunity is no longer there.

Re: Escaping the Dark Forest

#35

Makes me think of salvage operations, and then raises the question of how do people get paid? They're providing a valuable service. I think in shipping there are both conventions and an ability to quickly negotiate that allows contracting for a salvage ship to rush to the aid of a grounded or sinking container vessel.

you will pay a higher fee to a trusted miner to process your transaction without sending to mempool.

Re: Escaping the Dark Forest

#37

This read like a piece by William Gibson in the Neuromancer universe. I finally understand now why people are attracted by cryptocurrencies.

Yes, if you're an enthusiast, it seems like good, technical fun. But I have no idea how an "investor" could read this and think they can price the risk correctly. This isn't even the wild west of finance--this is intergalactic space.

It's way safer and less complex than you would expect. Most staking contracts are a copy-paste of two basic staking contracts (from synthetix and sushiswap), so it's enough to do a text diff and see what was changed, which is trivial. For more complex contracts that do something more, funds at risk are the best bug bounty there is - in the current environment if something had >$10M for a month and wasn't hacked, it most likely can't be trivially hacked. Bzrx, the single most incompetent defi platform, was hacked just two weeks after a relaunch for $8M - most likely someone was waiting from the start for it to get enough funds to make the hack worthwhile. Almost no hacks happened during the entire yield farming craze.

Key word trivially - some contracts are custodial, so if someone hacked the owners (or they turned out to be scammers) funds could be stolen, which arguably has a reverse Lindy effect in the beginning. Fortunately people are starting to demand at least timelocks and/or multisigs. Another risk is how well liquidations function during a price crash, for protocols that need them.

The current risk premium was and still is absurdly overestimated, but that was a good thing (for me) as without it three or even four digit APYs wouldn't last a day, but thanks to the unwarranted risk premium they lasted about 2 months. During the short peak three weeks ago it was possible to make even ~8% per day (on millions of dollars - good liquidity), completely risk free (trivial staking contracts). The great crypto bullrun of 2020 already happened and few outside of ethereum even noticed.

You will see billions flow into defi on ethereum as others realize the real level of risk too (which guarantees those astronomical returns are never going to return - but even 10% apy on dollars is good in the current environment).

Re: Escaping the Dark Forest

#38
post #14
post #2

I love that they're continuing the Dark Forest analogy! Makes me also realize I never want to dip my toe in crypto like that. It's like an amateur going up to an entirely unregulated wall street and expecting to earn some quick cash.

Amateur has nothing to do with that. Ethereum, and "smart contracts" in general, are built on such shaky foundations that unless shakiness is what you're looking for, you have nothing of interest to find there.

Yes. Stay away from Ethereum altogether if for investment and simply put amounts you are willing to invest into Bitcoin.

Ethereum DeFi currently ongoing is extremely risky and insecure in the longterm for various reasons. The open smart contracting is super dangerous, the Ethereum blockchain is way too bloated, the fees are shooting up, and it was designed to be a shared computer, an EVM for running things. Bitcoin is an investment and sound money. They do not compare and don't have the same end goals.

Re: Escaping the Dark Forest

#39
post #18

Earlier quoted context omitted.

Can you elaborate? Why do you find that "smart contracts" are built on a shaky foundation?

Because there is no real formal verification process for smart contracts, it's extremely easy to slip bugs into the contract code, the contract itself is generally immutable (can't fix bugs), and the effects of a breach are generally catastrophic and irreversible. Need more reasons?

This as well. Immutable bugs.

Re: Escaping the Dark Forest

#40
Nice work, but honestly I'm not sure why they bother.

The article states that the purpose of these smart contracts is:

"Stake your tokens with us and you could be the next cryptocurrency millionaire"

That's an obvious scam. Anyone who gave real money to such a cause has already lost it. So why is the author giving away his time to help the scammers?

Post reply on HN