194 points · by tosh · 8y ago · 127 comments
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.
(Put differently, Ethereum is a distributed computer, not a payment rail; Stellar is a payment rail, not a distributed computer).
If you want to implement a gambling site in a jurisdiction where that is illegal, Stellar won't help you, and Ethereum might. However if you're an existing business that is incorporated in the US, then you are probably fine with asking customers to trust you; this is what all companies currently do, under perjury of prosecution.
Another key benefit to Stellar is that if you just want a token / ICO, then this is built into the protocol; Stellar has the concept of an Asset, which you can issue with a couple of API calls. This replaces the need for implementing and testing your own ERC20, which is a major headache, particularly for existing non-crypto oriented enterprises.
There are obviously some open questions on exactly which use-cases Stellar would be useful for, but an example would be in-app purchase tokens like Kin; there's no reason to implement that as an ERC20 and incur the risk involved with the EVM when you're just moving tokens around.
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.
Note that the cryptocurrency people use the word "decentralized" differently from the rest of the world. They use it specifically to mean that the mechanism for determining consensus is perfectly distributed among an unknown number of arbitrary nodes.
Stellar consensus is decentralized in the conventional sense. Federation is a form of decentralization.
>This is why Stellar probably doesn't count as a real "blockchain." It's also why Stellar is potentially a lot more useful than blockchain.
It's always the same catch 22 though: if you're willing to do away with one of the attributes of blockchains/cryptocurrencis then you have a rather standard distributed ledger that any half competent engineer could come up with. It's not particularly novel or revolutionary.
Actually I'd even go further and posit than hardly anybody would be talking about Stellar or Ripple if they didn't use buzzwords "smart contract" and "blockchain". This is hype feeding speculation feeding hype feeding speculation...
Mining fulfils two roles:
- identity management: To identify who is a trustworthy block producer in an anonymous and trustless network, mining introduces a cost to the block generation process and we use a game theory assumption that it serves as a barrier for attackers. This doesn't mean there aren't validation checks performed by other nodes in the network and the consensus forming rules themselves of course.
- consensus formation: In a distributed network, nodes are bound to disagree on which is the canonical chain out of two or more competing forks. The most common algorithm calculates the accumulated computational effort of each chain of blocks and picks the "heaviest" one, ie the one with the most work done on it. This has the nice side effect of ensuring economic finality for the transactions in those blocks.
Now, regarding decentralisation you state that "the cryptocurrency people" use it wrong, but the definition you gave is incorrect. As a cryptocurrency person, Vitalik Buterin described decentralisation here: https://medium.com/@VitalikButerin/the-meaning-of-decentrali...
DPoS consensus used by Bitshares/STEEM & EOS seems to the most advanced among the models and they also have the highest TPS
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.
edit: implementation / implemented
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.
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.
A multisig contract is an utterly trivial program. It is easy to prove correct.
Presumably, in both cases the solution is the same -- law enforcement and a lawsuit.
The goal isn't some perfectly perfect decentralized system, the goal is something that doesn't have the monstrous overhead of something like, e.g., real estate deals today.
The cost of enforcing and collecting on a smart contract is much cheaper. Depending on the dollar amount and use case I can see the advantage.
It seems like reviewing complex software code to make sure it’s well understood and no edge cases exist is a costly endeavor.
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?
The blockchain cannot enforce properly where external, real-world events are involved, and the hard part of contract law is not figuring out when to transfer money. It's figuring out when things aren't going as intended, it's figuring out when conditions might be unlawful, or when they just shouldn't be applicable in a given situation.
"Code as law" is very wide of the mark.
2. Parties can meet up and resolve the contract themselves (semi-automated enforcement that saves escrow fees).
Introducing trust issues with that exchange and what it decides to report to the smart contract that day. And that's the very simplest of circumstances, one data point from one source.
> 2. Parties can meet up and resolve the contract themselves (semi-automated enforcement that saves escrow fees).
So resort to non-smart way of resolving the issue, only the dynamic has likely already been changed as an automated system may have transferred funds already.
2. You can meet up and resolve ANY contract yourselves. That doesn't save escrow fees.
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].
If you could get insured for software agreements using off the shelf open source software that already worked for lots of other people why not go for it? How is that worse than custom agreement and settlement via chains of private 3rd parties with opaque fee structures.
This is what formal verification is for. But seemingly the current Smart Contract ecosystem doesn't care...
You are correct, it would be madness to let software alone manage a legal contract, which Hart showed was impossible to free of residuals. A smart contract can be seen as an abstraction from the legal contract underpinning it in order to self-execute where residuals do not arise.
The devil in the details resides of course in the specific contract implementations.
That said, nobody actually cares for doing anything useful with blockchain in 2018. The verbiage is just a smokescreen for good old pump-and-dump speculation.
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.
We went for stellar because we saw some traction there, kind of liked the notion of being in an ecosystem with a bit more serious players, and we liked what it did functionally.
That means it's much easier to get your token listed on an exchange if it's ERC20, and there are dozens of wallets, with combined millions of installations, that users can use to hold it.
It also means numerous decentralized exchanges (e.g. 0x, Kyber) and other value-adding applications that are compatible with it, like the smart-contract based loaning Dapps that can use ERC20 tokens as collateral (e.g. the Dharma protocol) and relatively soon, second layer solutions for low-cost instantaneous transactions, like Raiden, Liquidity Network, Celer Network etc.
I just don't see why anyone would want to move from Ethereum, which has seen its market share in the token market grow steadily over the last two years, to something that's barely used like Stellar.
Is liquidity secondary to transaction throughput for the use-case of your token? If so, couldn't you use a traditional MySQL server, or a permissioned sidechain, or even a more centralized ledger like Stellar, for the high-throughput uses of the token, and use Ethereum for trading it? Going the dual-blockchain route is what Kik ended up doing with its token, Kin, based on the reasoning that having its token convertible to the ERC20 standard gave it access to a much larger pool of liquidity.
We're actually building a business based on our customers paying us cash for services we deliver to them. Not even future tense; we have been doing that for some time and we have actual paying customers. We want to pay our users to help us deliver value to our customers using our utility token. So, they earn tokens for stuff they do. They can then trade on stellar. A pump and dump would alienate both our customers and user base. This makes it easy for us to let our international customer base and international user base help each other without getting bogged down in admin work, invoices, payroll, etc. You'd be surprised how hard this stuff is to do in the traditional financial ecosystem (we tried).
The volume at which we do these things requires a side chain in any case: it's not technically feasible to run this on a platform that has global throughput of only 4-5 transactions per second (on a good day), high and variable transaction cost, and high degrees of uncertainty around transactions actually clearing in a few minutes (or worse). IMHO Ethereum is years away from being of practical use for anything other than acting as an investment vehicle for speculators. It only makes sense for very low volume and relatively high value transactions.
We picked stellar as our side chain and then concluded we don't need another chain on top of it. It does what we need it to do and we get trading for free through stellarx. Transactions are close enough to free that we don't care about the cost.
I'll look at Ethereum again after miners go away, proof of stake has happened, and Sharding is the norm.
Still, I think allowing your token to be traded more widely through ERC20 compatibility may have benefits that are hard to foresee right now. It's a truism that liquidity is beneficial. In any case it's probably not urgent given the embryonic stage of tokenomics, and quite possible not worth the additional engineering costs of adding another blockchain to the architecture.
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.
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.
I do wonder why XDR sort of failed to get used and why people went ahead and created protocol bufs and thrift as alternatives.
https://tools.ietf.org/html/rfc4506.html
The backstory to XDR is that it fell out of Sun's development of NFS. Sun engineers realised that rather than defining a protocol for NFS from scratch, they could define a generic remote procedure call mechanism (SunRPC, which became ONC RPC), and then define NFS as an application protocol on top of that. An RPC mechanism needs a serialisation format, and XDR is that format.
I get the impression that this was part of a project build a whole new world of IDL-specified RPC-based protocols that would replace the janky, ad-hoc, mostly-textual protocol suite that existed at the time - telnet, rlogin, FTP, SMTP, etc.DCE and CORBA were rival attempts at around the same time. It was an interesting time.
Of course, what actually happened was HTTP. gRPC/HTTP2 is this idea finally coming back into fashion.
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-...
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.
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.
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.
Doesn't that require you to trust that they release the funds? Do smart contracts have a way to dispute an outcome?
Derivatives contracts dwarf this market. Not aiming high enough lads.
https://www.investopedia.com/ask/answers/052715/how-big-deri...
What does locking funds entail?
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.
A recommendation from 4-chan and a PoC and a talk at a blockchain hype-conference? Think I'll steer clear.
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.
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.
https://iohk.io/blog/cardano-smart-contracts-testnet-iele-la...
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.