9 ms·
Can someone give me a good use case (even better if you're doing it yourself) for a smart contract? What is anyone doing with them that they find really handy?
by duxup 3y ago
Can someone give me a good use case (even better if you're doing it yourself) for a smart contract?
What is anyone doing with them that they find really handy?
I've never been able to understand how it gets used / why you would use smart contracts. I've googled and read... still don't grok it.
I've seen so many "benefits" listed, but none make sense to me as far as the process you go through and how it works out in the end. Often it's described as a magic thing that eliminates the use of "intermediaries" and so on. I suppose that is true but you only get to that by going through all the complexity of from making sure someone writes a good contract / getting folks from the outside to review and validate it and so on. I'm not sure that saved a lot in the end.
Much like a most things blockchain I find these ideas (not bad ones) and then the practical usage ... much less than ideal.
- freemanon 3y agoWell it was the same with the internet itself. It's prone to hacks, bugs, and outage, and yet today we all use it to manage our finances and make payments.
- namdnay 3y agoWell, for the internet you could say “it allows stores to show pages with their products, and people can choose what they want to order, give their address and pay it with credit card , all without leaving their home” That’s a pretty obvious killer feature of the internet
- junofan 3y agoWorth noting this wasn’t allowed on the early precursors to the internet. Also the credit card company and processor both take a fat cut and maybe deposit the money a few days later if they feel like it.
- DropInIn 3y agoAnd eth fees are tiny? And they'll get smaller as demand increases? Don't worry I already know the answer to both is "No". Ffs....
- jjordan 3y agoArguably the most popular use case is that smart contracts are used to create decentralized exchange services. See: Uniswap. They are also used extensively in the crypto sub-genre called DeFi, or decentralized finance. One of the most popular implementations is called Aave, which allows one to take loans out (i.e. give the contract Ether as collateral, receive an amount of USD stablecoin in return) on a given set of assets. Of course every NFT you ever heard of is essentially its own smart contract (specifically one that implements the ERC-721 standard of functions and public variables), though I'm not sure that qualifies as a 'good' use case. ;)
- latchkey 3y agoThis answer right here is, in my opinion, one of the most interesting use cases that is available today. Provide collateral and take out a loan against that collateral. It allows people to act as their own bank. No longer do you have to go to a bank, ask for permission and then get approved for a loan. Now, you can do that yourself, instantly, without any trouble at all. Amazing really. What are those loans used for today? Well, mostly it is about interest rate arbitrage and providing liquidity. As a super basic example, you can borrow funds at 2% and then lend them out again at 3% and make 1%. It is essentially risk free (assuming the contract doesn't have bugs/exploits). The larger picture will be to enable people to be their own Kiva's. Crypto often is pushed to 'bank the unbanked', but it is more than just holding money. It is enabling people to borrow against their existing holdings, effectively allowing anyone, globally, to put their savings to work for them, without having to rely on a centralized banking system to do so. This might not be interesting for USA people, but it is especially valuable in countries that don't have a stable banking system.
- DropInIn 3y agoWho is providing the finance and under what terms? How does rhat actually differ from banks or one of the many microfinance services predating crypto? Now, the real kicker, what is the effective cost when _all_ fees are included, because someone has to pay for it and when combining the interest of non-traditional lenders and such fees I highly doubt it'll be cheaper.
- mypastself 3y agoAt the bottom, it’s an address holding a program that can release funds to another address or a group of addresses (which may be wallets or other smart contracts) based on some predefined conditions. There’s technically no limit to what you can implement, but there’s no killer app yet, and it’s questionable if there ever will be. For me, it’s mostly an interesting piece of tech to learn about.
- hn_throwaway_99 3y agoWish I could upvote this more. I'm a reasonably intelligent person. My job requires me to learn complex technical details about a bunch of different domains - it may take me a while to grok it all, but I usually can once I do my research. The thing that is striking to me whenever smart contracts come up is how extremely rare it is to be just presented with a simple, understandable, real-world use case that is an improvement over existing alternatives. Instead, so often you get: 1. Long missives about how the technology is really cool, but that completely sidestep the original question: show me a simple example of what a smart contract is used for. 2. Lots of examples that are only relevant to crypto in the first place (i.e. just speculating on valuation movements in crypto). What I mean by this is that the purpose of finance (at least the intended purpose) should be to provide capital for real goods and services. Pretty much all of the smart contract examples I've seen are just, for example, triggers related to the prices of a bunch of different tokens. I would honestly be thrilled if someone could just give a simple example of someone actually using this stuff in the real world. OK, please commence all the "HN just always hates on crypto" non-responses... (this last sentence is sarcasm but also born out of frustration of getting straightforward answers in this domain).
- photonthug 3y agoEscrow is the simple thing. Suppose you want to buy a house or a car, and you show up with a bag of money and someone else shows up with a set of keys. How to proceed without the transaction requiring trust between people who don't know each other? If you physically get the car/house/keys, what guarantees that title was transferred as expected? Depending on the cash volume and the jurisdiction, there is basically no established mechanism for doing this peer-to-peer. If you're "lucky" then you see a whole industry of middle-men created around trying to solve /skim on this, which then increases the costs of transaction (say realtors or car dealerships). If you're unlucky, then there's simply no way to have a trust-free transaction, and you just weigh the risk and take it or leave it. This does seem solvable, right? Because there's only a few APIs (bank transfers, title queries) that are involved in a fully automatic escrow. Such escrow could be provided as a free service by the government, or it might be pay-per-use (and simply cost less than markup from dealerships/realtors).
- mteigers 3y agoI have no direct affiliation with this service (nor am I a user of it) but I recently learned about "Pool Together" which is a "lossless" lottery system. It's a daily lottery that happens automatically, you do not need to collect as it happens automatically, and you can withdraw all of your capital at any time. I thought that was a decently novel use case.
- duxup 3y agoThat sounds amusing ... albeit the lottery aspect makes me suspect shenanigans. Is anyone reading the contract to understand if it really is what it says it is? One of those issues is of course that people will need to find someone who can read the contract for them, and hope they get it right. Still, good example that is easy to get, seems like easy to code and work.
- DropInIn 3y agoSuch a "lottery" is effectively a trillion dollar rug pull in waiting....
- coding123 3y agoSounds really unnecessary. What is there not to trust in an actual lottery? Are the people that go on TV to show the results not worth the job they have? Why does the website have a starting sentence that includes: "a passion project I hold dear to my heart." What is it about lotteries or smart contracts that have people that saying "dear to my heart". The only thing "dear to my heart" is probably my wife and family. I don't know how something related to money could be. And I have a hard time trusting a person that has a passion project dear to their heart related to lossless lottery systems.
- hn_throwaway_99 3y agoFirst off, wanted to say thanks very much for posting this, primarily because I think it is an example that is straightforward and easy to understand. That said, I'm also thinking "if this is one of the best, straightforward examples people are talking about when referring to 'the value of smart contracts', then smart contracts are just nowhere near the important tech its boosters believe." (To be clear mteigers, not directing this at you, just saying this because what you've posted is probably the best example of a real-world use case I've seen). In summary, what PoolTogether (https://pooltogether.com/ https://pooltogether.com/) does is basically act like a normal savings account, except instead of you getting 4% interest a year or whatever, that interest is all pooled and then given out in big chunks at random - most people get nothing, but "winners" will get what is essentially everyone else's interest. Some notes: 1. I'm not clear what activity they're engaging in that actually generates interest (e.g. who they're lending to in order to generate a spread), but in fairness I didn't spend much going into the details. That said, if they really are generating income by lending, then I'm very curious how they can't suffer from some of the same negative edge-cases inherent in fractional reserve banking, like a run on the bank. If they are not generating real income from lending, I'm very suspect about how they can really be generating interest. Again, I didn't look much into this, so totally admit I could just not be understanding the details here. 2. I see absolutely no real benefit that comes from doing this as a smart contract vs. just doing this as any other kind of normal software (e.g. what core banking software provides), despite what their blurbs on the website say. So still just dumbfounded by the lack of real utility in any of these smart contract examples I've seen.
- csumtin 3y agoCorrespondent banking. So say a bank in the States needs to send money to one in Spain. They may not have a relationship, so they go through an intermediary bank. You can use a smart contract to eliminate the trust in the intermediary bank, so eliminating that counter party risk
- karpierz 3y agoHow exactly does the Spanish bank get the USD that the American bank sent without trusting a third party?
- brobinson 3y agoYou don't need to trust when you can verify. The source code for the intermediary bank (smart contract) would be available for everyone to read.
- karpierz 3y agoI'm not talking about code. The goal of the transaction is for the Spanish bank to have access to USD. In the example given, the Spanish bank would then have to take the crypto it got and trust an exchange to give it USD in exchange for the crypto. How do you get USD to the Spanish bank without trusting a third party?
- csumtin 3y agoUSD doesn't have smart contract abilities so yes you are correct about trusting a third party to exchange crypto to USD. You could use a stablecoin but that requires you to trust the stable coin backing.
- TimJRobinson 3y agoThere are many USD stablecoins they can use: https://www.coingecko.com/en/categories/stablecoins https://www.coingecko.com/en/categories/stablecoins. The top two are the most liquid but are also centralized, many of the others are fully decentralized.
- Uptrenda 3y agoI find posts like this honestly infuriating because its like you don't know the first thing about an entire, specialized field, yet because its something taking place in tech you feel like you're qualified to write about it. Ask the same question about chemistry, biology, electrical engineering, or any STEM subject, and here's the actual answer: it's beyond the scope of a comment on hacker news to spoon feed you an entire fucking field in a way that will make sense to you. You will have to read papers, and think about what works and doesn't, over years to understand what is going on. And to be ahead of the curve -- you'll also have to do your own experiments that 9/10 won't yield any interesting results. In the blockchain and 'crypto' industry we also have the problem that entry is easy while skilled execution is not. Consequently: many fuck-ups have happened. It's easy to point to them and say that 'this is the industry' but its really not. Those are a few bad eggs.
- jason_pomerleau 3y agoGenuine question from someone on the outside watching all of this: then who are these things for? Apparently not me, nor GP, nor my mum and dad. Are we waiting until the Smart People sort out all of these complex details to make this stuff accessible for regular people?
- Uptrenda 3y agoI'd say something like this: the average person isn't doing anything that complex with money. They can use cash for instant, real-time payments (with good counterfeit prevention), and can generally rely on their banks. But this is less than ideal because their assets can easily be seized, inflated, frozen, and their banks could fail. The blockchain could offer superior piece of mind or something of an insurance policy. Though the problem with that is most of the world runs on regular money so there would still need to be ways to buy/sell those assets. To talk about the more specialized use-cases: there are some truly novel things that can only be done with the blockchain. To give you a direct example -- 'provably fair' gambling enables someone to place bets and know for certain that the result will be fair. This is accomplished by having outcomes enforced for a network of computers instead of trusting some shady website to stay fair. It's basically fully transparent. I know there will be people saying that this grasping at straws but the list of use-cases is quite long. I don't have time to research and list all the interesting ones here. But if anyone is interested in the subject I promise you that learning more about it won't be a disappointment. It's just not easy to explain in short-form posts.
- cliftonk 3y agoTypically I like to read HN comments for insightful discourse focused on details of the topic at hand by relevant experts. It is a terrible failing of HN that this useless comment is promoted to the top. It is like if there were a detailed blog post about rusts type system and I was to comment “Why would anyone use rust when they could use X instead?” Please stop upvoting this comment.
- soulofmischief 3y agoGovernance of next-generation automated economies and societies. It's one thing to make a promise to someone. It's another to marry your business procedures directly to immutable code which guarantees to users, employees and partners that the business operates in the intended and described way. Most of these benefits require your company to be digital in nature, but many asset-based economic systems can benefit from it. For example, automatic, trustless guarantee of both quality of transport and payment for shipping goods. Sensors in a transport vehicle continually update a decentralized semi-private blockchain, proving that an item never left a refrigeration state, or was not tampered with. Automatic payment could be achieved by placing the item inside a locked stationary container at point of delivery and validating through this blockchain that all requirements were met. A system like this could go even further to make guarantees to the end customer, who could verify at point of sale that their food item remained fresh.
- RcouF1uZ4gsC 3y ago> For example, automatic, trustless guarantee of both quality of transport and payment for shipping goods. I am very, very skeptical your example would work purely with smart co tracts for this. I can think of a bunch of ways where real world interactions would cause all sorts of problems that would have to be sorted out by regular contract law.
- soulofmischief 3y agoMaybe, maybe not. Fedex and others are experimenting nonetheless, so we'll see how many problems it solves vs introduces. https://www.truckinginfo.com/10183205/blockchain-once-overhyped-is-finding-real-transportation-use-cases https://www.truckinginfo.com/10183205/blockchain-once-overhy... https://www.fedex.com/en-us/about/policy/technology-innovation/blockchain.html https://www.fedex.com/en-us/about/policy/technology-innovati... https://www.supplychain247.com/company/blockchain_in_trucking_alliance https://www.supplychain247.com/company/blockchain_in_truckin... A common misconception is that smart contract enthusiasts believe it replaces existing contract law. It doesn't, though in some cases it removes the need for relying on it with digital services. It is meant to enhance the letter of law by adding additional guarantees.
- javier123454321 3y agoWe did what I thought was an interesting use case. Giving artists an ability to manage royalties in perpetuity for sales of a digital artwork through cryptography. Here is the breakdown: https://medium.com/valorize-dao/how-we-are-developing-a-smart-contract-to-manage-royalties-for-artists-of-our-nft-a3427f865b16 https://medium.com/valorize-dao/how-we-are-developing-a-smar...
- theK 3y agoI am building an incentivized market to keep data available on the web(3) without having a centralized entity taking care of it. Without a smart contract running on a block chain this isn't possible. https://permanentum.io https://permanentum.io
- alexslobodnik 3y agoEthereum name service, more commonly known as ENS. In ethereum address appear like 0x233eb...042, ENS let's you associate a human readable name like nick.eth with that address. Works similar to DNS, turning IP addresses into something we humans recognize. What's the pro of using a smart contract? (DNS works without one). With a smart contract you can have immutable data store (assuming ethereum continues) that can give you ownership over your name, like nick.eth. What's the con? It's immutable which means people can own names they shouldn't with no mediation process possible. Like a lot of things in life the system is good as long the system works for you, but not everyone is lucky enough to exist in a system that works well enough. Crypto* is trying to make things better. edit: *some people are others are not
- hn_throwaway_99 3y agoI posted the sibling comment basically dumping on smart contracts, so I wanted to thank you very much for posting this - it helped me understand smart contracts better in my mind and helped crystallize places where they could be useful. I knew vaguely about ENS (primarily just by seeing .eth addresses), but your comment led me to dig in to how it works. I think the bit of "eureka" moment I had is that smart contracts are really only useful for shuffling around ownership of "pure data", and then it's up to everyone else to interpret what that data actually means. That is, for an eth name, it's really just storing an association of the name with another piece of data, and putting a mechanism in place for who gets to control that association (i.e. how bidding for a name works). It's then up to other people to decide how (or whether) they want to "interpret" that association. In my mind it's quite similar to NFTs. All NFTs really store is an association that says "this person 'owns' this other piece of data called X, and that other piece of data X actually refers to this shitty digital image of a bored ape." But, of course anyone else can copy the bits of that shitty digital image and do whatever they want with it - it's only if enough people agree that "yes, that NFT really does mean that shitty digital image" for it to be worth anything. It also helped me because with most contracts people think about how "things in the real world" need to be verified in order to determine contract performance (did the price of wheat go up, was the vacation rental as advertised), but smart contracts really are quite useless in those examples. But there are some examples where you're just storing pieces of data and you do not care about what happens "in the real world". Thus, I still feel smart contracts are often greatly oversold (and often misunderstood) by their boosters, but there are specific "data-mapping" use cases where they make sense. I also appreciate that you pointed out the downsides of not having a mediation process, which I think many crypto boosters think of as a feature but many people feel is a bug in the real world. Anyway, you really helped me think about this more clearly, and I appreciate it.
- anonymous-koala 3y agoI don't see any good answers here so I'll give it a try. Smart contracts can be used to build voting systems, multi-signature agreement systems, escrow systems, exchanges etc. But all of these rely on data being in the crypto world e.g. on blockchain. The most powerful emerging use case for smart contracts is verifying zero knowledge proofs. Using groth16 or PLONK you can compress any amount of information or computation into a constant size proof (constant in both size and verification complexity [1]). This leads to the question, what is the use case for zero knowledge proofs? TLS notarization: a user can prove they received data from a website by proving the signature in the TLS session. So e.g. i could prove how many twitter (sorry, X) followers i have by proving an element in the HTML that is signed by twitter, or prove that i have a dm with individual X (not the company, a variable meant to indicate some person). This can be extended to proving e.g. bank account balances using TLS signatures. The idea is such a TLS proof can be ingested on the blockchain so anything on the internet can be used as a logical condition for a smart contract. https://tlsnotary.org/ https://tlsnotary.org/ ^ a similar case exists for email data verification using RSA Private user data: companies can track information about users without knowing what information belongs to what user. The idea is, the user data is stored inside a ZK proof and the user manipulates the data in ZK, then provides a proof to the web application that they manipulated it in a way that follows the rules defined by the application. A simple example might be ZKFlix. Each time a user watches a movie they add an entry to their data indicating `moviedId: true`. The web application can store the user state without knowing which user watched which movie. Put more simply, each change to user data is attributed to an anonymous actor. Theoretically it should be possible to build websites with the same functionality of existing websites, but where the website is non-custodial of the user data (this isn't strictly blockchain related). This type of system allows users to make proofs about their application user data and submit them to the blockchain. ^ the more general case is building a state system that exists entirely in ZK and putting a state root on the blockchain. Then anything about the state system can proven onchain These are the examples I have off the top of my head (though i do work in this space). I think smart contracts by themselves lack functionality and resort to hacky things like permissioned oracles. Combined with ZK though smart contracts become a financial system that is trustlessly bound to the internet. The hard part is making the internet provable as sequences of polynomials. Hard agree that the current user experience sucks though. I'm of the opinion that in the future users won't directly interact with the blockchain the same way a user doesn't interact directly with e.g. postgreSQL. If to make an account on a website you had to write an SQL query inserting the row that would be a similarly bad experience to managing your own private key xd [1]: The scaling isn't strictly constant, but small enough to be considered for practical purposes constant
- x-complexity 3y agoFor me personally: When architected correctly (as with pretty much all software), it allows for a service to live (effectively) forever, independent from the creators of the service. Example: I create a smart contract where everyone can post an IPFS hash to it, with added functionality to be able to post on someone's behalf if they give a signature to do so. (This simple example is deliberately chosen to be a starting point. More complex functions & services can be derived from this starting point alone.) If I were to kick the bucket, or if I'm not capable of contributing to its development, the service is still accessible to everyone else. If someone else wants to keep developing the service, they can do so via the contacts defined endpoints. To me, the positives of this starting point outweigh the technical complexities involved with its development & maintenance. It varies wildly for others, but for me, this is the anchor point from which I can build something that can last long after me.
- kaycey2022 3y agoFrom my understanding a smart contract is like a web backend, with completely transparent business logic and data, so anyone can interact with it without any intermediary. If you can deploy your program (smart contract) on the ethereum blockchain or any of the L2 chains, then all the costs of interacting with it and maintaining its data layer are borne by the market participants. Because of these properties you can create entirely open market infrastructure that anyone can use, which means reduced compliance costs (measured in opportunity and not money) and regulations for the participants. On the flip side, the issue is that most people are stupid, don't know shit about what they are doing, and the tech itself is vulnerable to all sorts of race conditions because of flaws in Solidity language and the EVM itself which can enable hacks. I am personally very sympathetic to the crypto efforts and not as sympathetic with the skeptics, because I find the centralisation of the web by some American players to be more dangerous than some individuals losing their life savings playing on web3.