As I understand it, smart contract languages generally have to be specifically tailored to the primitive operations offered by the EVM (Ethereum Virtual Machine). Binary size is at a strict premium, because the price to deploy a smart contract (currently in the thousands of dollars on the main Ethereum network) directly depends on it.
Did no one stop at the “it costs thousands of dollars to deploy a binary” step and realise this isn’t going to work? They don’t need a new language for smaller binaries, they need to solve what seems to be a core roadblock.
No, because an L2 rollup isn't a typical cloud server. It's a form of verifiable computation: the server does some computation, and after a while posts a cryptographic proof of the state changes to a more secure ledger (the L1).
The benefit of this is that you get a high throughput system that inherits the same security guarantees as the L1. This is why something like a ZK rollup operator cannot "steal your funds" compared to something like a CEX operator.
Don’t think in terms of a „web app“. Instead, consider this: A block chain is basically just a distributed append-only database. Actually quite similar to how GIT works but with stronger security guarantees.
That doesn’t really answer the question of what it offers over a sharded cloud hosted web app if you’re having to move things to L2 to scale.
Edit: also unrelated, but I hate the tendency for crypto fans to keep moving the conversation to new analogies. The vast majority of threads here are analogies and buzzwords without very concrete technical discussion of the merits of the architecture.
Well, the details are more convoluted than two sentences on a public forum can convey. If you are seriously interested in how digital money works, I suggest you to read „Mastering Bitcoin“ which I found quite accessible even without a strong background in cryptography. Once you understood the BTC network you get a good grasp of what ETH is doing.
The former also employs an execution stack for running transactions but it is much more limited and I believe Turing incomplete (as a conscious choice).
The problem is these contracts will have bugs, as most software written by normal coders can attest to. Further! there is no decentralized way to settle disputes. Finally, modern contracts are at least ostensibly premised on being human readable. You may think such "pure logic" of some JS-alike smart contract is somehow easier to understand, but this will never be true while keeping the language meangfully capable, due to turing completeness (and other friends).
Such a system, where stakeholders are required to trust coders, destroys the benefits you claim. You now have the bottleneck of required human vetting/interacting. -This- is what people mean when they say such a system cant work in practice and is essentially no better (and definitely has lots of strange quirks like gas fees) than existing financial instruments.
> -This- is what people mean when they say such a system cant work in practice
Not sure what you are talking about. First of all I did not argue whether smart contracts have benefits (the thread was about L2 chains in the ETH context and whether that was overengineered).
Secondly, I would suggest you try ETH out. With the bubble over, gas fees are back to reasonable values. Buy a hundred bugs of ETH on Coinbase, move that to your Coinbase wallet and store some of it in the AAVE lender contract. While you might lose about $10 in gas fees and Coinbase fees, you’ll earn an interest rate on a decentralized network not involving banks. I found that pretty cool when I tried it for my first time.
The test may be more fun if you happen to know sb willing to sell you ETH directly and guide you through the ramp up phase.
I bought 10$ of ETH once about a year ago in the hopes that I could donate to some developers on GitHub. I never used it, and certainly wouldn't hold it for speculation as that is just pumping US cash dollars into a system full of people trying to cash out on a greater fool's scheme.
Anyway, doesn't seem like we are going to see eye-to-eye and no one has the energy to refute the complex uselessness that is crypto-currency. Dan Olson did a better job than I ever could -
case in point, this fun little copy-pasta you've given us:
"Secondly, I would suggest you try ETH out. With the bubble over, gas fees are back to reasonable values. Buy a hundred bugs of ETH on Coinbase, move that to your Coinbase wallet and store some of it in the AAVE lender contract. While you might lose about $10 in gas fees and Coinbase fees, you’ll earn an interest rate on a decentralized network not involving banks. I found that pretty cool when I tried it for my first time.
The test may be more fun if you happen to know sb willing to sell you ETH directly and guide you through the ramp up phase. "
My favorite part about this is that you deliberately explain _none_ of it (don't worry, I'm really not interested). Do you really think average people know what all this is? Or are you just hoping they'll ask so you can cheerlead each concept individually?
> Appeals to “the potential for innovation” are always amorphous and hand-wavy rhetorical gestures towards the potential for some tech that could exist but which we don’t fully understand the implications of. However bitcoin is a technology which did not arise out of an engineering effort directed towards a specific problem or market inefficiency, but instead out of a anarchist political narrative that views democratic control of the money supply and law enforcement as the problem.
Yeah, it looks like the information that I quickly Googled was oversimplified and also outdated. It seems like the price could still easily run into the hundreds of dollars, if the traffic on the network or the price of ETH in USD were to experience another significant increase.
That's interesting. It appears that the resources I was looking at were mostly from last year, which had both higher gas fees in gwei and higher ETH prices in USD. This contract (at 1.2 M gas) still only comes out to the hundreds of dollars at most; perhaps it is smaller than the kind of contracts that most people were considering at the time. (Incidentally, why is it so difficult to find any good order-of-magnitude estimates of the gas usage of deploying a contract?)
Determining how much a contract will cost to deploy is really easy for blockchain devs (the "user-friendly" resources probably don't make this easy because it's not relevant to people who aren't doing it).
Transactions on Ethereum all contain a certain amount of data which will live on the blockchain forever (often ~100 bytes, for non-contract-deployment transactions). Ethereum processes one block every 12 seconds, and blocks can contain up to 1 MB of data, so effectively people "bid" to get their transactions on by including the fee-per-byte they're willing to spend with their transaction (I'm glossing over a lot here, they're also bidding on computation resources for transactions which call code, and there is some dynamic targeting of fees, all to say that block sizes are typically much closer to 80 KB than 1MB)
In order to get an idea of how much it would cost to deploy a contract, you first compile it (get the bytecode size) and then look at the typical "gas cost" (what transactions are currently paying in fees). You can get this data from the chain directly, or go to https://etherscan.io/ and look at the "Med gas price" (currently 14 gwei, or 0.000000014 ETH). Your dev tooling can tell you how much gas should be required to deploy the contract based on the bytecode size, the storage (space in the virtual machine reserved for that contract's variables), and the amount of computation that needs to happen in the contract's constructor.
Once you know how much gas will be required to deploy the contract (the "gas amount") you multiply that by the gas price to get an amount of ETH. A very large contract might cost 8 million gas to deploy (gas is basically a unit used by the Ethereum virtual machine to price operations and storage). So if that's you, you multiply that by 0.000000014 ETH and get 0.112 ETH at the current gas price. If you want to pay less, you could always submit your transaction with a lower gas price (like 0.000000001 ETH lets say, to pay closer to 0.01 ETH); it'll just take longer to get validated (an indeterminate amount of time depending on how heavily the network is being used)
Obviously I've glossed over a lot here to make things more approachable, but hopefully that explains the situation well enough.
By the way, the tooling around blockchain development is still really primitive relative to its complexity; but contract deployment gas estimation isn't too hard for anyone doing it.
If the Ethereum platform places such a heavy premium on binary size then that seems like a real step backwards from a software engineering perspective. Our industry has learned through painful experience that optimizing for highly compressed binaries isn't a great way to ensure program reliability or correctness.
Such limitations aren't introduced for fun but stem from the desire to build a decentralized system. If you don't believe in decentralization or the separation of money from the state, then nearly all aspects of cryptocurrency will seem backwards to you. However, those who support decentralization view these limitations as necessary trade-offs.
Just a clarification, it's not "thousands of dollars" to deploy a smart contract to Ethereum, though a defi application might be comprised of a group of related contracts.
There's a limit on the size of a contract, and the largest contract one can deploy to Ethereum would cost about $120 at today's gas price and ETH price. For example, this transaction from a couple of hours ago deploys a contract that is at the contract size limit: https://etherscan.io/tx/0x5ed0c6d517fa0bf7c5074bf49ae0f73633...
You can see they spent $120 in gas fees to deploy it.
When the network is incredibly busy, of course, this could be much higher (but when it's dead, it could also be as cheap as $40)
At the peak of the bubble (ETH price around $5000), you're right, contracts this size would have been "thousands of dollars to deploy" when the network was congested. Even then, most contracts would have been cheaper, and you could still deploy contracts for $100-200
If ETH (the token) continues to appreciate in price then it's entirely possible "thousands of dollars" for a contract could become the norm, but that's obviously not a certainty, and if that does happen (before network improvements which may also decrease fees), there are always alternative blockchains and L2s that you could deploy Solidity contracts to.
The total gas cost of a smart contract is determined by its running time that is the number of operations a smart contract needs to execute. So a large contract may actually be cheap to run if it never executes most of its code base.