5 ms·
Imagine you and your friends are for some reason dissatisfied with the way you are able to deal with money among yourselves. For example, maybe you like to qui
by mbrock 9y ago
Imagine you and your friends are for some reason dissatisfied with the way you are able to deal with money among yourselves.
For example, maybe you like to quickly reimburse each other for dinner, but you won't or can't use Facebook Messenger payments, perhaps because some of you aren't on Facebook, or you're not in the US.
So you want to make your own little payments system. You might start with just setting up a simple server that tracks your debts, with a simple web app to log in and send funds. Suddenly it's much easier for you to pay each other!
Once that works, you realize it would be really neat to have group payments, where you can automatically split a dinner bill, for example. And then maybe you'll even want to kind of crowdfund your dinners, so that any of you can put up a request that says "please send me 5$ each until tomorrow at 4 and I'll order food." You can see this becoming more and more complex.
This is kind of the evolution of blockchain going from simple transactions towards arbitrary smart contracts.
A contract on Ethereum is basically just an address that's associated with a little script in a stack machine bytecode. When you send a message to such a contract, you're actually signing a transaction that says "I hereby perform the instructions of this contract with these given parameters."
For example, the bytecode of contract X might be:
VALUE 2 DIV DUP <address-1> SEND <address-2> SEND
(The SEND instruction doesn't actually exist; you'd use the CALL instruction, but it takes some parameters that would make the example less clear.)
So this contract, when transacted with, would split the ETH value sent to it in half and send to "address 1" and "address 2".
The neat thing about this blockchain thing, compared to a Messenger-style central server, is that you can federate the service in a P2P way, so several of the friends can run a node that verifies all the history, and nobody needs to be trusted with an admin password that can change history.
The neat thing about having those smart contracts on the blockchain instead of as proprietary code is that each participant can (in principle) look at the contract's definition and know for sure what it does, and the contract can't be changed arbitrarily.
- zdkl 9y agoThat's a lot of effort to spare yourself a conversation about convention within your friends and a small money pot. Smart contracts fit really well for generally managing securities, developping auto hedging portfolios.
- mbrock 9y agoThat's why I hope that smart contract systems will make this kind of thing much easier in the near future. That's also part of what I'm working on. It might be easy for a small group to manage with a convention and an informal money pot, but if you're a bigger network (an organization or even a network of organizations) then budgeting and tracking payments becomes more difficult.
- TeMPOraL 9y ago> That's a lot of effort to spare yourself a conversation about convention within your friends and a small money pot. Hey, that was an example meant to explain difficult concepts through terms most people will be familiar with. You can't judge it like this. Somewhat related, and maybe I'm revealing my stupidity here, but I wish someone explained securities to me in a simple way.
- zdkl 9y agoI'm stupid as well so don't take this as gospel. A security is a fictional asset used to represent higher level operations one can conduct on an underlying asset. Basically it's all the made up tradable assets. The specific definition varies depending on jurisdiction but if I remember correctly the SEC goes with something like any token that is used to transfer unrealised value between traders or across time. About your example, I understand that but I'm sorry to see that all examples we collectively come up with for smart contracts are even more constrained than hello worlds and in my humble opinion unfit for the "real purpose" of the EVM. The same line of reasoning applies to bitcoin: it's not a wallet to pay your coffee or receive your salary, but an alternative to banks/payment processors when you need it. Likewise in my opinion again, the EVM isn't made to replace informal contracts or legal/notarial/... affairs but to provide an alternative when the costs/benefits of contract law aren't fit for your use case.
- TeMPOraL 9y agoThanks. I wonder why it's called "security" (as in, safety from attacks). > I understand that but I'm sorry to see that all examples we collectively come up with for smart contracts are even more constrained than hello worlds and in my humble opinion unfit for the "real purpose" of the EVM. The same line of reasoning applies to bitcoin: it's not a wallet to pay your coffee or receive your salary, but an alternative to banks/payment processors when you need it. Fair enough, though I think that we need both, and preferably together. Those trivial examples are actually useful to people the very first time they try to understand the basics of cryptocurrencies and smart contracts. And after that, when someone gets the basic mechanics of the process, I think an example should follow with a description of actual use, and how the same mechanics facilitate it. > Likewise in my opinion again, the EVM isn't made to replace informal contracts or legal/notarial/... affairs but to provide an alternative when the costs/benefits of contract law aren't fit for your use case. I agree, I see it this way too. I cringe when I see people hopeful for replacing legal system with ETH, because that would be just plain dumb. But an alternative option to use when it fits better? I'm very much in favour.
- quadcore 9y agoI hereby perform the instructions of this contract with these given parameters How big can be the parameters? Megabytes is possible?
- canoebuilder 9y agoRecognizing it's merely an example, I think nonetheless it would be good to present examples that are actually compelling. Let's think about your example and what it entails. So you're going to a pizza party with your friends, and instead of saying to your buddy Mike who you're about to see in person and share some pizza with, "Hey Mike, here's 5 bucks, thanks!" Instead you fire up the ol' ethereum whizbang machine, and "pay" Mike. The payment then rattles around the ol' globally distributed whizbang machine, at the SPEED of Light! powered by electricity through countless microscopic electronic gating mechanisms before finally settling into the storage media of thousands of computers around the world, where it will stay, forever. That seems needlessly wasteful of resources and expensive. What it boils down to, is what is this good for? While some may have been, not everyone was confounded by the introduction of the web. Many could see obvious avenues of potential and development. Even back in the 60s or 70s people were envisioning computer network enabled home shopping. Not sure many were envisioning a global distributed turing complete whatchamacallit with ever expanding resource needs because of no garbage collection by design. So simply, what's the point? What do you do with it besides buy pizzas with your friends? How is it better than existing methods for doing whatever you envision doing with it? What if anything, does it enable that would otherwise be impossible?
- mbrock 9y agoYou could make a similarly incredulous argument that messenger apps are totally ridiculous because why would you use a 500 dollar handheld computer to write a message through the "internet" when you could just talk IRL? I mean, like, within three years you'll probably be having a virtual reality pizza party with your friends on the other side of the world. That's less wasteful of resources than flying, you know! And how will the money work? Maybe with a blockchain. Let's try to stretch the imagination even more! Imagine you are involved with an open source project. You want to be able to receive some donations, collectively. So you briefly consider setting up a PayPal account, then giggle. "Ha-ha! Why would I use PayPal when these smart contract blockchains technologies have been working well for many years?" So instead you go to one of the future's several competing smart contract platforms, and you click "Set up budgeted donation contract." It asks you to input the parameters for your donation contract. Maybe you end up configuring something like "Every week, this account's balance will be allocated as follows: 25% to GitHub; 50% split among these N core developers; 25% to the fund; and 25% to the EFF." Your fans and users can then verify the behavior of this donation contract and easily contribute to your project! Wow! So much cooler than PayPal!
- canada_dry 9y agoThanks! This is an easier to digest explanation. What about another use case that's also fairly mundane but is date/time triggered and has a slightly different result/outcome? Say someone wants to use ethereum to manage the sending of a bunch of birthday cards to friends. Is it possible for an ethereum script be set up to trigger an event on a specific day to send a pre-composed email along with some funds (e.g. bitcoin or ethereum).
- mbrock 9y agoThe Ethereum blockchain is reactive, it only performs any effects when someone makes a transaction. So you can't directly do something like a timer. So, for example, with crowdfund contracts that have an expiration time, you would typically just make it so that after the expiration time, if the crowdfund didn't succeed, then everyone can reclaim their funds. They aren't refunded automatically; you need some user action to trigger anything. It would be possible to have a single "refundEveryone" method which would send all the funds to everyone when anyone called it. But if there were thousands of participants, this function would be expensive to call, and possibly even too expensive for the network's limits. The standard solution to this limitation is that you just have to incentivize people to call your contract at the right time. So you can for example make it so that whoever is the first to call the contract after the deadline gets a reward. Then you publish that and hope someone will do it. (A simpler solution is to just run a cronjob on your own computer...)