12 ms·
Stellar Smart Contracts
- onion-soup 8y agoGreat to see smart contract technology unfolding before our eyes.
- Nursie 8y agoIs it? Really? As far as I'm aware the oracle problem still exists, the problems of having to get data onto the blockchain from external, trusted sources. In real-world contracts the problems don't arise over the simple execution of contract, they arise when intent is muddied or missed by words, when terms are unfair, overly onerous or legally unenforceable. Given this, there are very, very few situations in which smart contracts appear to be a good idea, particularly as you talk about anything more than trivial amounts of money. The world just isn't that black and white.
- vntok 8y agoIt is, yes. Most transactions that occur daily across the whole world involve trivial amounts of money. If I want to sell you a 300€ dishwasher, for example, I can either require cash, ask for a check/bank transfer and pray it doesnt bounce, or involve a 3rd party whom i trust in which case I will have to forego a % fee for their escrow service, maybe 30€. With a smart contract, I can now be sure the buyer's funds exist and are locked before we meet. Then we shake hands, we load the dishwasher in their car and we both release the funds before parting way. I just saved myself a 10% fee and the buyer wasn't forced to get cash from an atm.
- Nursie 8y ago> ask for a check/bank transfer and pray it doesnt bounce Why would a bank transfer bounce? These are free and effectively instant in most places I know of now. > I just saved myself a 10% fee You probably had to pay network fees though. Once again, the blockchain-positive argument seems to stem from outdated ideas about traditional banking. --edit-- I'm going to reply here to the comment below then I shall bow out of this discussion because HN has me rate limited. > Bank transfers are reversible. Good, this is a form of buyer protection. Much like credit-card chargebacks. We have literally thousands of years of history of sellers ripping off buyers to show us what a great idea this is. > Network fees will be infinitesimal compared to the fees a human wants to extract. There are existing, non-blockchain ones with a flat fee of under £3 in the UK I could find with a quick search. Network fees have gone over this on various cryptocurrencies at various times.
- vntok 8y ago1. Bank transfers are reversible. In Europe, you can void a bank transfer up to _several_ days after it has occurred by complaining to your bank. If the bank agrees with you (fraudulent transfer, identity theft, etc), they can ask the receiver's bank to transfer the funds back to you. In France, you have 13 months by law to contest bank transactions after they have taken place. 2. Network fees will be infinitesimal compared to the fees a human wants to extract.
- the-dude 8y ago1. Bank transfers are not generally reversible, only if another party has taken something from your account ( in Dutch "automatische incasso" ). If you did a transfer yourself it is not reversible.
- hannasanarion 8y ago1. this is obviously a good thing. Thieves, fraudsters, and scammers exist. The ability for a trusted third party to roll back history is a feature. 2. How do you know this? Typical POS Credit card processing fees are 2-2.5%. Paypal is 3%. Bitcoin transaction fees can be as high as $50! Unless your typical transaction is 4 digit dollar amounts, credit card processing is cheaper.
- Klathmon 8y ago>Bitcoin transaction fees can be as high as $50! 1. This isn't bitcoin 2. They were that high once, and have not been again 3. Point 2 really doesn't hold since they will be that high again if it ever gains mass appeal, however: 4. there are solutions to even that problem that are being tested and rolled out now called Lightning Network. You can think it's all snakeoil or a scam or whatever, but building a little strawman to make it sound like it's pointless isn't helping anyone. There are plenty of things about bitcoin and cryptocurrencies in general that are still unsolved problems, but harping on the fees is silly at this point because it's the one that people are actively trying to solve in just about all cryptocurrencies, and I honestly believe that they have it figured out, and the road forward is just one of adoption and hardening. Stellar uses a system that is pretty much designed to have low fees from the start, and Lightning Network is a pretty damn good way of scaling a blockchain system off the blockchain for the vast majority of transactions making fees a fraction of what they are even now. For example, a single transaction in Stellar right now costs about $0.000002 USD. And that fee is expected to not change significantly, and unlike bitcoin is not variable but is fairly fixed, and will not go up with more activity.
- unmole 8y ago> funds exist and are locked before we meet What does locking funds entail?
- vntok 8y agoThe funds are essentially escrowed: no individual party can recoup them unless both agree to move them.
- unmole 8y agoIn the hypothetical dishwasher example, what is the buyer's incentive to lock up funds before even physically inspecting the item? What is my recourse if a spiteful seller refuses to agree to releasing my funds if I decide not to go through with the purchase? I'm not being facetious. I'm trying to understand why one would need to use an escrow service for something like this.
- vntok 8y agoBuyer and seller enter a smart contract where the buyer's funds are locked for two days, then freely recoverable by the buyer only after the contract expires. That proves to the seller that the funds exist at no risk to the buyer. A day before the contract expires, buyer and seller meet up to inspect the goods. Upon inspection, seller hands over the goods and buyer validates the release order in front of him before departing, thus completing the contract before its expiration. Infinitesimal cost, infinitesimal risk.
- djb_hackernews 8y ago> and we both release the funds before parting way. Doesn't that require you to trust that they release the funds? Do smart contracts have a way to dispute an outcome?
- dboreham 8y ago>Do smart contracts have a way to dispute an outcome? Yes, but you have to write code to implement dispute resolution, which in turn implies you have to devise a form of "proof" to be presented to the contract. This can be tricky (or impossible).
- crassblaster 8y ago>Most transactions that occur daily across the whole world involve trivial amounts of money. Derivatives contracts dwarf this market. Not aiming high enough lads. https://www.investopedia.com/ask/answers/052715/how-big-derivatives-market.asp https://www.investopedia.com/ask/answers/052715/how-big-deri...
- decentralised 8y agoYes it is, really. The oracle problem is not a problem. The data quality is not a concern of the blockchain protocol, only what happens to it once it enters the state trie. Cases where the external data that must be "truthful" can be done trustlessly with prediction markets for instance or Token Curated Registries among other cryptoeconomic primitives. For cases where the data feed needs an extra layer of validation there are options around using TLS notary, secure enclaves, etc. In the majority of use cases where the app / smart-contract users are responsible for the data they enter and that's good enough.
- Nursie 8y ago> The oracle problem is not a problem Yes, it really is, where human motivations to pollute input data exist at all it's a huge problem. All of the above require external, trusted systems, or fuzzy, imprecise arguments based around the honest, enlightened economic self-interest of actors who, throughout history, have shown themselves to unenlightened, dishonest and not to act in economically rational ways.
- decentralised 8y agoIt really isn't a problem. You have to take the use case of the smart-contract / app and see what is the incentive to pollute input data. Then you can use mechanism design to motivates users to input high quality data and have trustless curated list of the best data sources. Just in case you are not familiar with cryptoeconomics and game theory, here's an example of mechanism design I used at an interview I gave a few days ago: > Imagine you and your sister both want the last piece of cheesecake left, so you agree to split it in half but can't agree on who should do the cut because both of you are cheaters and would take the bigger slice for yourselves. One way of solving this is to have your sister take the knife but you get to pick your half first, since you would both be motivated to find the perfect balance and would stand to lose if either tries to cheat.
- jonnydubowsky 8y agoThanks for this clear example. With a combination of Token Curated Registries and a blend of bonded attestations (a la FOAM Point of Interest recording) and reputation bonds (a la Colony), you end up with economic incentives spread out across validators and other stakeholders where there is enough of a penalty for cheating to prevent it. The key is setting the bonds correctly for the use case. This is why a multipurpose smart contract ecosystem such as Stellar wins out in my book. Token Curated Registries can be used to iteratively experiment with getting the game theory and Token economics right before there's tons of money at stake.
- chaosbolt 8y agoWell have you checked Chainlink (they've been working with SWIFT and possibly Microsoft)? they've been working on a decentralized oracle for a year now, most of 4chan's /biz think this is the next Bitcoin/Ethereum, and I learned not to underestimate them, they called many right shots and anonymity helps create a kind of natural selection for ideas. They've been talking about it non stop for 1 year now, and the CEO has spoken in the San Francisco Blockchain Week and they presented 5 nodes on their test network I think.
- Nursie 8y agoNo thanks. A recommendation from 4-chan and a PoC and a talk at a blockchain hype-conference? Think I'll steer clear.
- leifg 8y ago> As a reminder, smart contracts are created using code. Code can contain bugs or may not perform as intended. Be sure to analyze and agree upon all possible edge cases when coming up with the conditions and outcomes of the smart contract. Predicting all possible edge cases of a piece of software has been proven to be very hard in the past (there have been software bugs that literally killed people). Why would I ever agree to let software ALONE enforce a contract? And if there is a human process to override the outcome of the contract, what advantage does it have over a "dumb contract". I just find the whole idea of computers enforcing law very unsettling.
- Leace 8y agoComputers are not enforcing law, I think this is just a misunderstanding on how blockchain systems work. They rely on consensus of majority of nodes, that are operated by humans. So in effect software written by small team of people is running on nodes operated by people. Ultimately the entire system is controlled by people, as DAO "hack" clearly shows.
- pavlov 8y agoIt's a misunderstanding that's actively promoted by blockchain enthusiasts. A lot of people still believe that inerrable smart contracts are possible and desirable. Hundreds of millions of ICO money has been collected by blockchain projects that basically promise to do away with software bugs by using [academic language X | proof verification system Y | magic beans].
- Illniyar 8y agoI would imagine you would use it when a human is unable to enforce a contract - for instance when there is no other party who is capable of enforcing it or who the parties agree should enforce it (because it would be too costly or for lack of trust, for instance). Perhaps this occurs when dealing with individuals who are in different countries and the matter is too small? or perhaps while engaging in illegal activities?
- vntok 8y agoSmart contracts allow you to completely shortcut intermediaries and their fees in the case where everything goes right or can be checked objectively by an algorithm (ex price of a commodity on a particular platform at a particular time). With a multisig escrow account, if you and your counterpart both agree to transfer the funds, or both agree to unlock the funds, there is essentially no fee to give away to anyone else. If something goes wrong and you don't agree anymore, well then you can involve authorities from the real world.
- mrleiter 8y agoFrom a legal perspective, this is very interesting. The concept of escrow has existed for centuries I suppose. It needs three parties, A (origin), B (escrow) and C (destination). An escrow is only needed, because A and C don't trust themselves enough. Trust is a basic necessity in any contract and providing trust is a extremely valuable service. In (Austrian) civil law, there is something called "acquisition in good faith", which allows a third person under certain circumstances to lawfully acquire full and unrestrained ownership of a good from someone who does not have the rights to transfer full and unrestrained ownership of said good. Example: A wants to sell a laptop to C, but doesn't trust him until he has fully paid the price. They agree to use an escrow agent B. A gives B the laptop and C gives B the money/price. Now what happens if B doesn't acts in bad faith and decides to sell the laptop to the third party T? Well, if T isn't colluding or doesn't have to suspect that B is acting in bad faith, he (under certain conditions, that are most likely met in this case) can acquire full and unrestrained lawful ownership of that laptop. A is only left with claims on account of unjust enrichment against B, but has zero chance of getting his laptop back if T refuses to give it back. In that case it may not be problematic, because A only wanted the money, although he now has to take B to court and B maybe insolvent and so forth. The problem is more poignant if the laptop wasn't a laptop, but something very unique that has no equivalent monetary worth. And here smart contracts help: they make it impossible to transfer certain goods before certain conditions have been met. The ensure trust. That's why I believe this technology is very valuable. tl;dr: smart contracts are very valuable, because the ensure trust.
- buboard 8y agoThe escrow used to be a trusted third party though. Blockchain moves the "quantity of trust previously assigned to the escrow agent" to the two parties. If one party disputes for some reason the algorithm this can't be settled automatically. With a trusted human escrow agent, an abnormal situation would probably end with him sharing part of the blame , which help resolve the conflict in a way that is not fair, but surely blame-able. There is nobody to blame with a machine though.
- midhir 8y agoOne thing I've found impenetrable about Stellar is the use of the XDR data format. I've never encountered this before and it's been a painful step in starting to build on their platform. Are their any simple, introductory texts on it? A lot of stuff is from Stellar themselves. I'm sure there are good reasons for using it, the rest of the platform looks simple to understand and well designed.
- ismail 8y agoXDR is a highly efficient format, primarily used in telecoms We have a developer who has developed decoders in C. Ping me if you need details. See: https://www.tmforum.org/resources/standard/ipdrxdr-encoding-formatipdr-xdr_encoding_format/ https://www.tmforum.org/resources/standard/ipdrxdr-encoding-...
- jillesvangurp 8y agoIt's a simple binary format similar to e.g. protocol buffers. You write an idl and then generate code for different languages. The reason they went for this is that is compact. This kind of matters because this stuff is actually stored in stellar in large quantities. It's a pretty old ietf standard actually. I recently had a discussion on this on their slack channel making the point that the choice for this was a bit unfortunate given that this is a relatively obscure format with not a lot of developer ecosystem around it. Because of this, the stellar guys are actually maintaining their own code generation tool for this because there's nothing else out there apparently. It's called xdrgen. It generates code for a few languages. If you want to understand xdr, that's a good place to start. You can find the idl in stellar core. I actually have an open bug for the java code generation with them, it generates broken code currently.
- twic 8y agoAny idea why they picked XDR rather than something that is more widely used in the present day, like Thrift? That is efficient on the wire, and pretty widely supported: https://thrift.apache.org/docs/Languages https://thrift.apache.org/docs/Languages
- koalala 8y agoStellar isn't decentralized. Just like Ripple, it uses Federated Byzantine Agreement, which means that nodes use a list of other nodes they trust. The fact that this scheme has nothing to do with the concept of a decentralized cryptocurrency, aside from the hype train, doesn't appear to have percolated into the collective mainstream or even geek consciousness yet.
- nindwen 8y ago> Stellar isn't decentralized. Just like Ripple, it uses Federated Byzantine Agreement, which means that nodes use a list of other nodes they trust. The fact that this scheme has nothing to do with the concept of a decentralized cryptocurrency There is no centralized authority, which means that the protocol in decentralized. It's just not decentralized in exactly the same way as something like Bitcoin. Some might call that a good thing.
- sneak 8y agoAs long as centralized authorities are subject to government coercion (and all are and always will be), this remains a bad thing, because it leaves strangers in whatever government the authority sits within with veto power over your ability to spend your money. Fuck that.
- decentralised 8y agoThere's only one development team behind the protocol and only one client implementation (afaik), which means that pressuring only two or three people is enough to guarantee that a backdoor is implemented or some form of transaction censorship happens. edit: implementation / implemented
- simias 8y agoThat's moving the goalpost pretty far. In this context the discussion is whether the protocol is decentralized. Whether the development is or isn't decentralized is also potentially an issue but it's a completely different discussion. Even if bitcoin had only one development team and only one implementation the protocol would still be decentralized.
- fiatjaf 8y agoStellar is a waste because it's a great idea with a super cool protocol but with a useless shitcoin (XLM) all mixed up in the system. I'm waiting for someone to rewrite Stellar to not have to use that shitcoin (if you need it for antispam, use Bitcoin Lightning donations, whatever), and also use it for other things, like federated DNS or a federated Wikipedia.
- apo 8y agoBoth of the examples (2-Party Multisignature Escrow Account with Time Lock & Recovery, and Joint-Entity Crowdfunding) have been possible with Bitcoin for some time.
- jillesvangurp 8y agoI recently started moving our token from Ethereum to stellar for the simple reason that I came to the conclusion that Ethereum is too far from being production ready to be of use in an application that has actual users that generate any kind of sizable amount of transactions. Ethereum is cute until you have use cases and uses that require it to actually process transactions. The Ethereum ecosystem is a big mess right now. All the proper solutions for this are years out from being production ready and widely used. I'm talking about sharding, proof of stake, etc. It's going to take several hard ethereum forks to get there. I think Vitalik is thinking 2020/2021 type time frames currently for this. I would not be surprised if that shifts some more. This stuff is hard. Until then, smart contracts on ethereum are only useful for very limited volumes of transaction that, so far, have been mostly about ICOs for shit coins. Essentially all of the transaction volume on Ethereum is trading in these coins. So, unless you are doing an ICO to raise funding, Ethereum has no practical value whatsoever. And given the scams happening there, it is not a great place for that either. Some people use side chains to work around this, i.e. a centrally run private blockchain. There are several proof of stake based platforms with smart contracts in the works (e.g. hashgraph, IOTA). Mostly that stuff is really immature (or not ready at all) and lacking the broad user base that bitcoin and ethereum have. Bitcoin is nice but useless for custom tokens. There are not a lot of options here that are usable now, scalable, and reasonably widely used (critical if you are going to lock up millions $ in value in it). Stellar may not be perfect but it works right now and it scales and it is reasonably widely used. They have built a few things into stellar that largely remove the need for centralized things like exchanges or convoluted smart contracts that need auditing. This is why it is gaining a lot of traction lately. Specifically: - any stellar account can issue tokens - any stellar account that trusts (this is stored in stellar) those tokens can receive those tokens - any account can create offers to buy/sell any tokens (that they trust) on stellar - when offers are matched by a counter offers, the trade happens. There are no websites where you need to go to get your token listed, no middlemen to bribe/deal with, no transaction fees (beyond the 1/10^5th of an XLM), no smart contracts to write. This stuff works out of the box. You can be up and running in minutes if you know what you need to do. If you want to issue a token on stellar the process is as follows: - create an issuing account with a minimal XLM balance - create distribution account - make your distribution account trust your FOO coin issued by the issuing account - pay some FOO from the issuing account to the distribution account. This creates the token. Paying it back to the issuing account destroys it. - write a stellar.toml file with some meta data and put it on your domain foo.com in the .well-known directory. This tells your users and exchanges what your coin is, who issued it, etc. - set foo.com as the home domain on the issuing account - fiddle with the issuing account options to further control things (multi sig, preventing more tokens from being issued, etc.) Done. They have lots of other stuff built in that is highly useful like federated accounts, a compliance protocol for people to pre-clear transactions, etc. If you start reading the documentation, it becomes very clear that this was developed by people who deeply understand the needs of those that develop complex financial products. To trade tokens, you simply create offers and counter offers on stellar. This works right away. The recently launched Stellarx.com is just a pretty UI around the built in functionality. To get listed on stellarx, you need some positive evidence of trading happening with your token. I think this currently means evidence of a (small) trading volume and a minimum number of accounts that hold your token. Other than that there are no bribes, listing fees, etc. I imagine that over time the requirements for this will change and there will be competing websites getting involved as well. People making the point that stellar is a centralized system are of course somewhat right. However, it is a system that can be used right now and you can easily scale it to meaningful numbers of transactions. The shared database of transactions that stellar produces can be validated by anyone and if you run a full node, that's exactly what it does. So, it's not as black and white as this being 'controlled' by a single entity. In practice the companies that are active on stellar end up running their own nodes and validators. Many people do.
- danielvf 8y agoIf I'm reading the docs right, the Stellar smart contracts are extremely different from Ethereum smart contracts - in fact, it almost feels like a stretch to call them the same name. Like "animals" vs "plants". Ethereum smart contract are actual virtual machines. They are tiny computers that run whatever bytecode you want. You could calculate pi to a million decimal places in a smart contract, if you had the money for gas. Stellar smart contracts, on the other hand, are simpler. A transaction can only choose from 13 operations (Buy, make offer, change trust, etc). On top of the operations, you can add some restrictions to the transaction - Stellar has support for built-in multi-sig, built-in start and end time limits, and built in transaction grouping. By combining these restrictions, grouping transactions, presigning this, and handing out that, you can make something that's smarter than a single person doing a single transaction. As an Ethereum blockchain developer, using Stellar smart contract feels very limiting, and outside the simple cases, very convoluted.
- pollen23 8y agoI don't think there's anything in the definition of smart contracts that necessarily has it defined to be what they are in Ethereum. They are very different, that's for sure. Assets are first class objects though, so 95% of what Ethereum smart contracts do is built into the platform already.
- yifanl 8y agoHow smart should a contract really be though? It seems like a feature rather than a bug that there are limits.
- DennisP 8y agoThe word "contract" is a bit misleading. On Ethereum these scripts are used for all sorts of things, including the on-chain parts of second-layer scaling solutions.
- michaelscott 8y agoThe Stellar smart contracts seem to function like versions of Bitcoin Script transaction types with more features. For me this seems like a more appropriate direction for transaction abilities in comparison to Ethereum's approach, which has more capability but also massive room for implementation error.
- platz 8y agoIOHK has Smart Contracts too (Cardano) https://iohk.io/blog/cardano-smart-contracts-testnet-iele-launches/ https://iohk.io/blog/cardano-smart-contracts-testnet-iele-la...