114 points · by 0xedb · 4y ago · 211 comments
https://vyper.readthedocs.io/en/stable/
Vyper is being used in Curve and Yearn (both billions of dollars of TVL): https://ethereum.org/en/developers/docs/programming-language...
https://blog.ethereum.org/2020/01/08/update-on-the-vyper-com...
that’s not to discredit anyone using vyper, just that when putting “billions of dollars” in play on a project like this, you better have teams of folks looking into the security implications of using such a technology with known caveats that the ethereum foundation team publicised.
now things may have changed in the meanwhile between the time that notice was published and now, but if you are using or recommending vyper, it’s worth it to ask or state explicitly “which” vyper and “which version” of vyper, or “did you fork vyper in order to fix some of the issues outlined in the audit” as well as “if you are using vyper in critical applications, are you contributing your fixes back to the community?”
If some of the answers are
"the ethereum foundation team are too conservative"
"the audit doesn't mean anything"
"we don't have anyone looking into the security aspects of vyper"
then you have your answer: they're going to get hacked.
Vitalik was pushing Vyper quite hard for a while, but he seems to have ramped that down.
I wonder if Vyper is in any way better than Solidity.
At any rate, smart contract languages have security / verifiability constraints that few other domain of application have, and I don't believe any of the current languages offer what is really needed (integrated formal proof of behavior of the smart contract).
In solidity, there are types called "contracts" which are like classes in other languages. When you call a function in a different contract, the dispatch is routed using the first few bytes of the has of the signature [1].
For example, to transfer ERC-20 tokens you dispatch using `hash(transfer(address, uint256))[:4]`, meaning that you put those first four bytes at the beginning of the data that you pass to the receiving contract.
Just like the native world, this causes a problem when you try to interface between different languages. In Fe, the types have different names so this hashing scheme can't work without a translation layer. From some of the issues it looks like interoperability may be a problem [2]. That's ok if you write all the contracts that your dApp interacts with, but as time goes on dApps interact and call into one another more and more often.
There are probably also lots of opportunities here for exploiting confusion at these boundaries, so if you're inclined and know how to use tornado you may be able to make quite a bit of money off contracts that use Fe.
[1] https://docs.soliditylang.org/en/v0.8.10/abi-spec.html#funct...
https://github.com/ethereum/fe/blob/bfeffe82b4f8623330c1ebb1...
It's not obvious to me though and I couldn't find documentation for ABI compatibility. For example, does delegatecall to solidity work? That requires that Fe also use the same "binary" layout for storage in which slot index is used to generate the storage hash:
https://docs.soliditylang.org/en/v0.8.10/internals/layout_in...
I am a longtime smart contract developer who has been burned by Solidity’s downsides so I am excited about new EVM languages. I’ve read the Fe README, the announcement blog post, and the Uniswap v2 examples, but still have no concrete set of improvements over Solidity that I can point to. Maybe it’s just because things are still early, but from 15 minutes looking at Fe it still seems like Solidity but this a Pythonic syntax. As a Solidity dev, I want to see concretely how Fe improves on my existing smart contract language.
Thank you for pushing the frontier on smart contract development! I feel we’re in the very beginning of smart contract development and languages like Fe can be the path towards preventing tons of these hacks we see every week.
Vyper also had other issues such as (IMHO) its choice of implementation language which led to a lot of internal tech debt. Also, at the time I was working on Vyper, it actually used Python's standard parser library and so we often had to shoehorn language features into the Python syntax. Vyper may have corrected those things since then but I don't know. In any case, I eventually just decided to start over in my spare time using Rust as an implementation language.
There was other work planned for Fe such as providing a "strict" compiler mode that would facilitate formal verification of contracts written in Fe (that was basically a goal of Vyper). Also, we planned to provide a thorough specification and semantics for the language also for that purpose. I believe a lot of those plans are still in place but the current team should probably comment.
As you say, I think part of the issue is that things are still very early. The core devs are always figuring out useful things to add along the way that end up differentiating the language from its competitors. I'd say more but I'm on my phone :).
What's the reasoning behind this? I thought we have a lot of documentation about inheritance being bad, but in Solidity not only this is core, but multiple inheritance is also core. This is then combined with (occasional) implicit access to permanently stored data, and with something that I can only describe as function inheritance.
While discovering this, I started having the thought that it was done on purpose (easy to find faulty contracts that could be hacked for money). This was a nasty thought, indeed, but I found a lot of anti-features.
Nice pun.
This claim sounds suspicious. If the authors really solved this, they have a bright future. A turing award for sure.
With this language, it looks like: they force all dynamically-sized objects (any string, any array) to set a maximum size at compile time, and limit loops to be statically sized (or on the length of one of those static sized objects). It feels like this gets them most of the way.
The missing bit is some reasoning about recursion: I didn’t look close enough to see what they do, but it seems like you could either disallow it (not great, but in the smart contracts I’ve written it’s not been super useful anyways), or you could do some sort of static reasoning about the recursive parameters to the function getting smaller (the gas accounting seems tricky here).
IMHO, the hard part of this language is convincing anyone the compiler is totally bug-free. In as hostile an environment as a blockchain, where a single bug can lead to all your money going bye bye, using a “new” language is a risk most people will choose to avoid, unless there is a seriously good reason to choose this new language.
IMO, decidability is not a killer-enough feature to convince people to take this risk.
https://github.com/clarity-lang/reference/blob/master/refere...
There's a game-theoretic argument that pretty much solves the issue: you pay money to run your smart contract.
The more it runs, the more it costs, until you run out of funds (gas).
Sounds pretty decidable to me.
But that would cost you such a large amount of money that no one does it.
In other words, the system, while breakable in theory, isn't in practice because of a set of economic incentives (or as it were, dis-incentives in this case).
And I'm saying this as a fan of cryptocurrencies and someone who wants to see them succeed.
(My dismissal was of the smart contracts of the OP, not crypto in general, which many commenters seem to assume.)
If you read these threads you must know this isn't a universal for cryptocurrencies as it does not apply to multiple of the biggest projects. Even Ethereum which this post is about is scheduled to move away from PoW next quarter though their timeline claims are to be taken with some salt.
Comparing a discussion on a programming language to eugenics and phrenology just shows you have a bone to pick rather than trying to be helpful.
>With a technology that is extremely damaging to the entire planet for no reason…
Not all blockchains are based on PoW. If you actually read even a brief summary of the basics of crypto you’d know this since it’s mentioned nearly everywhere these days. It seems you are therefore either ignorant on what you speak, or are willfully misleading people to fit your own narrative.
>…come away with the opinion that it's junk tech that roasts the planet, both because it's true and because climate change is a very serious problem.
You’re stating opinions as facts and being far more intellectually dishonest and misleading than any crypto native I’ve seen on here.
> If the end result is that cryptocurrency discourse is effectively run out of HN…
You and you alone don’t get to decide or arbiter what HN is used for or who it is used by. This is gate keeping trash that erodes intellectual debate and discourse into an echo chamber of more curmudgeonly people patting each other’s curmudgeonly backs.
> Like it or not, HN is an important forum. People with a fair amount of influence come here.
HN is an important forum full of important people. On this we agree. My opinion, then, is we should probably be open to discussing new technologies, difficult topics, and unsavory ideas as these are the types of conversation from whence innovation springs. Nobody ever got smarter debating which JavaScript framework is the new hotness on the front page of HN.
> …similar to phrenology or eugenics…
Eugenics is worth discussing as it will once again become a cultural hotbed debate as we move into an era of designer genetics. I find it mostly amusing that you punctuate your point about quelling curiosity by dismissing away another topic that requires thick skin and intellectual rigor to properly discuss and even lump these in with phrenology. This is kind of like saying “discussions of meteorology, astronomy, and astrology should be banned.” One of these things is not like the other…
Based on this comment alone, I’d say you also probably like burning books.
You mean energy production?
Do you apply the same standards to threads about personal vehicles? Or for that matter, energy consuming/producing technology in general like, you know, computers?
Most people do not find useless tech to be interesting.
Edit: fixing babble
I am interested in this space, but I do share this criticism that so many of the things touted as evidence of it being useful are fundamentally circular. Take the first three things from the parent comment: Aave, Compound, Yearn. None of these make sense if there is no value in the cryptocurrencies they allow you to lend, borrow, and invest. But then they can't themselves be evidence that there is value. It's circular. Same thing with Gnosis Safe; it's only useful to have a multisig controlling crypto assets if those assets have value.
I think the current thought is that NFTs are what does / will bring inherent value or value connected to the rest of the world in some way onto the blockchain, and then everything else derives its value from there. This seems like a tenuous and somewhat shaky foundation to build so much hype atop, but it's at least a theory of the case that makes more sense to me than the circular "ethereum is valuable because of Uniswap and Aave".
> self-referential babble
Second, crypto boosters -- I am not one, but interested and not pessimistic -- would say that an economy or a monetary system is nothing but a closed, self-referential bubble that has the useful property of sometimes correlating to predictable real-world activity. It's an abstraction over the real world: not the real world itself, but a way to influence it. It it were the real world, you would presumably have a much easier time determining whether and how much inflation is actually rising. As it is, you have a debate over it today because numbers say one thing, and people experience another.
The crypto people are attempting to bootstrap just such another system, except one that doesn't rely on central banking. So I don't think self-referential is an effective critique then, because that's the intention.
Assuming you're talking about the smart contracts functionality here - what about something like decentralized escrow? Multisig wallets and hash time-locked contracts are a pretty direct analogue to how we handle escrow in the real world, but the counterparty risk is just move to the VM/chain/network.
Its not perfect, and many details need to get ironed out, but that particular use case has always struck me as pretty obvious.
Compare: human-readable contracts enforced by legal systems vs. complex programs written in an esoteric programming language running on world's most inefficient computer.
I fail to see how you view this as an "obvious case that makes sense"
- stablecoin
- high apr savings account by lending to defi leverage pool
- crypto.com visa card for real world offramp https://crypto.com/us/cards
I'm a founder and my cost of living is $40k/yr post-tax cashflow mediated by wells fargo checking + credit card. I think it just became possible to get wells fargo out of my life!
Compared to most users here, I live in the middle of nowhere. Most stores don't even accept credit cars or do so begrudgingly because cash payments allow them to pocket tax money. Even if this whole crypto-nonsense doesn't crash and burn in the end (which I consider highly unlikely, but what the hell do I know?), it will be ready to replace my bank in… let's say 50-60 years. Let's get extremely reliable internet connection to every shithole on the planet first, and then we'll see.
2. price "collapse" of 90% is actually not a collapse if it's up more than 10x in a small number of years
3. MEME-POWER is an incredible force, HODL may be enough to keep the perpetual motion machine moving. Markets are only as rational as humans!
4. the TIMING of collapse matters – covid/climate policy is perpetuating the bubbles and it seems governments might fracture before crypto fails, at which point where would you rather be, dollars or crypto?
5. the costs of inflation/bubbles is shouldered on the middle class and poor, so it actually is being paid for and may not actually be out of balance
6. We may be looking at a housing market generational situation. The answer is not to second guess the market, that's how you miss generational gains.
Where "not far" you mean "as far as it is from Mercury to Pluto", then yes, not that far.
Easy question to gauge distance: how does defi handle refunds and enforcement?
I think this approach would work for me right now! The only remaining issue is if I can get a mortgage – but I already have one. Everything else (like cars) I can purchase outright
"real world use case" is in the eye of the beholder.
My grandmother never wanted a telephone (landline) and never understood the "real world use case" however much people told her they couldn't live without it.
She was not stupid in any ways I can think of. She just lived in a way that made the device uninteresting.
In any case, you should take a look at the gaming space.
Lots of movement around unique items, characters, or more generally control of virtual property and managing them through a blockchain so as to allow use across gaming platforms.
But that's not a "real world use case" after all, it's just gaming (a tiny, $90B industry).
But anyway, wouldn’t unique items or virtual property just be an extension of the kind of loot box (and marketplace) mechanics that people seem to complain about a lot online?
Come again? Platforms as in different games? Then one would need the cooperation of the games publishers to make the items shareable. Platforms as in different devices? No different. Why does this need blockchain? A cenral authority works just fine. Is it to prevent scammers? Hah, I've read 1 too many "smart contract exploits" to know scammers will just concentrate on that.
Why this is better than central DB: Allows govt to outsource IT Public interest in the data will result in 3rd party clients being developed It makes that govt data more accesible for all parties - no gatekeeping
Use case examples All modern houses have a ton of compliance docs - window installers, insulation installers, HVAC, etc. Recording that data on the public blockchain provides a universal storage mechanism and API to that data. There is no reason for that data to be private / behind gatekeepers and a whole range of stakeholders - home builders, academics, environmentalist - want access.
Tracking highway per mile marker. Similar to the home building example - the govt collects a whole bunch of data (accidents, pollution run off and constituents, expenses). Many entities could use that data and relying on all govts worldwide to provide it seems cumbersome to unlikely.
Link: https://medium.com/avalancheavax/initial-litigation-offering...
Why? Any written contract can be reviewed and understood by a person. These contracts can be enforced by the use of the existing institutions.
Where as something something tokens offering:
- Contracts are written in an esotheric programming language that pretends to reflect a real-world contract
- These contracts are unenforceable
- And they still depend on some entity somewhere to enter correct info into the system.
All that can be done and is being done by hundreds of companies without the use of bullshit tech.
I don't know if this ILO thing is useful at all, but it doesn't have to be brand new to be useful. If it eliminates some inefficiencies in some part of the process, that's useful. If you could have eliminated those same inefficiencies using a database and a normal company running services on top of it, that's interesting, and the question is whether there is some competitive advantage to implementing it this way instead of that way.
Enough people think there is an advantage in implementing these things that require coordination using public blockchains to make me think there might be, but it is not obvious enough that there is an advantage to make me certain. But I don't think knee jerk dismissal is the right stance to take.
In reality, the market for money is extremely important for everyday life. Being able to trade off money now for more money later, and being able to do it in a variety of ways, is an essential ingredient modern exponential GDP growth and high quality of life to materialize.
IMO current DeFi products do this in a way that is already better than the traditional banking sector, and it gets better all the time. I suspect that in 20 years a majority of US people will use some kind of DeFi product instead of a savings account.
Gas fees can be hundreds of dollars to interact with a DAO (even simple contracts like Uniswap to get the right tokens is expensive.)
There are not banks hacked where people lose all of their money.
People lose passwords all the time. With banks, you can get access to your account back. With DAOs, if you lose your private key…RIP.
Coin prices are absurdly volatile. This is awful for currencies. The cryptokids point out all the time that 5% inflation means USD is a bad currency. Bitcoin dropped 20% in 24 hours. Imagine you need your savings right now. First you’d have to pay hundreds of dollars to access those funds and then you’d have 20% less than you expected. That’s garbage.
Those are things to start off with. Can you make a serious case that DAOs are better _right now_?
And if so, which _specific_ projects are better?
> Gas fees can be hundreds of dollars to interact with a DAO
It's not "hundreds of dollars" to withdraw tokens from a savings account. More like $50. That's still way too much, but I don't pull money out of my savings account often enough for it to matter. It will get better over time.
> There are not banks hacked where people lose all of their money.
Not in the US, but there are other countries that exist. None of the DeFi platforms I have ever used have been hacked, but I'm glad for the possibility! It gives me more options in terms of risk vs. reward.
> People lose passwords all the time.
Yep this one is bad, but there are ways to improve it (social key recovery etc) that people are working on. On the other hand, I've spent a ton of time on the phone with banks trying to get access to my own accounts every time I move. I've never had that problem with DeFi because they don't KYC.
> Coin prices are absurdly volatile.
Doesn't matter at all, I'm talking about stablecoins. I only really use fiat backed stablecoins, so there's almost no principle risk.
Also from this point I think it's pretty clear you don't understand how people use DeFi. Nobody is holding strait unleveraged BTC in a DeFi platform. You would just hold BTC directly, in which case the cost to withdraw would be ~$3 right now.
> Can you make a serious case that DAOs are better
For me they are infinitely more convenient. I've spent at least 10 hours this year on the phone with banks and financial institutions. I've spent 0 minutes trying to get access to my defi accounts. I use a trezor for cold storage.
The rates are better because I'm willing to tolerate more risk (and I think that smart contract and collateral risk for certain platforms is currently mispriced).
> which _specific_ projects are better
Compound, other savings platforms (I don't want to name them). Centralized exchange savings products are mostly made possible by DeFi, and these are also better products than traditional banks for people like me. Including Coinbase, Binance, even OKEx.
Have you ever heard of lending protocols? You can park dollar in a smart contracts and earn a couple of percent interest per year. AAVE and Compound are quite popular examples.
DAI is a decentralized stable coin trying to track the dollar value that’s been running for years. It is also implemented as a smart contract.
Then there are decentralized exchanges where you can swap different tokens on the Ethereum block chains. You can also park tokens in such money pools and also earn interest.
The biggest problem with Ethereum right now are the very high transaction fees that render these otherwise quite successful examples useless for people holding only small amounts of tokens. But this can be blamed on the ongoing crypto bubble.
I believe Bitpay and Square are some of the largest.
Edit: what I mean is the customer can pay in whatever, and you get the USD equivalent.
I used to be a fan of cryptocurrencies but I stopped when I realized how bad the consequences are at scale. All of them involve consuming real-world resources, so basically hurt our planet. How come nobody is smart enough to invent a cryptocoin that has resource consumption several orders of magnitude lower than the current ones?
You should read about Proof of Stake which does reduce resource consumption by several orders of magnitude compared to large PoW chains.
Proof of Stake blockchains aren’t the environmental concern that Proof of Work blockchains are.
I think the real world use case is to try to make money from zeroes and ones on a blockchain.
And I'm not being flippant. The problem with "code as law" is that it isn't established law and your investments can be vaporized in an instant with no recourse.
Ransomware, tax laundering and a relatively safe method for organized crime money transfers are excellent use cases (just not 'good' ones).
EDIT: This is genuine question. I want to understand if this is considered a real world use case or not.
There is a "real world use case" that most would agree with, just cynical. Borrowing and lending crypto is not a taxable event. You can have a capital gain on the blockchain and borrow stablecoins against it, indefinitely delaying taxation. At the same time, as of this moment you can wash trade crypto and tax harvest any new bottoms, making this tax favorable (a common assumption here is that crypto is an expected value 0 gambling game).
Example in the wild https://twitter.com/mcuban/status/1465002539603185668
In this way, it resembles high finance trades e.g. that Matt Levine of Money Stuff used to do to lower client taxes
I know people who get a loan on their stock portfolio. For that they need to apply for the loan at their bank. This takes time and could be denied. But, if you get it you have a nice lever to play with (basically re-invest in stocks).
The principle is exactly the same with DeFi, isn't it?
People have been borrowing and lending for centuries before blockchain.
Here’s the most recent (that I’m aware of) https://www.theverge.com/platform/amp/2021/12/2/22814849/bad...
They never learn their lesson
Were these all front end exploits too?
https://ndxfi.medium.com/indexed-attack-post-mortem-b006094f...
https://www.elliptic.co/resources/defi-risk-regulation-and-t...
https://arstechnica.com/information-technology/2021/12/hacke...
https://therecord.media/hackers-steal-29-million-from-crypto...
https://www.cnbc.com/2021/08/19/liquid-cryptocurrency-exchan...
https://www.dw.com/en/hackers-steal-600-million-in-record-br...
https://fortune.com/2021/06/24/bitcoin-ameer-raees-cajee-the...
But I at least like to know the general terms that are floating around, both in case one of them happens to change my mind on cryptocurrencies, and so that I know what to warn family members away from if they ask.
They power decentralized apps and defi. Without them then a blockchain doesn't have much utility aside from processing transactions.
Tether is a smart contract itself
However, Bitcoiners consider this an advantage as this makes it less vulnerable to exploits. And the Lightning Network is quite an exciting development.
I consider the competition between the two networks good as they are exploring different but nonetheless useful niches.
Mmmh, that's a little bit of a stretch.
They're building infrastructure (eg taproot) with a goal to support them in the future.
But doing ETH-like dapps on Bitcoin is nowhere near ready (or, if you listen to some Bitcoin folks, even desirable).