Ethereum smart contracts vs. Stellar smart contracts

Ethereum smart contracts vs. Stellar smart contracts is a binary I often have to answer in my consulting work and product design workshops. The answer, of course, is not always so straightforward. What are the pros and cons of each and when should you choose one over the other? A lot has to do with the level of decentralization you’d like to achieve and what tradeoffs you’re willing to accept.


TL;DR, Ethereum is more decentralized — but slower. Stellar is less decentralized — but faster.


So if you’re considering which blockchain protocol to use, carefully identify your target users’ wants and needs and build your solutions around those.


Smart contracts underpin many of the arguments for the utility of blockchain technology. These computer programs automatically execute specific actions once all the criteria are met.


Public blockchains add a layer of transparency to the type of data moving around. There are many public blockchains nowadays but not all are useful for the same things. At Espeo we primarily work with Ethereum and Stellar as guiding public blockchains. Of course, there are others on the market but the specific utility of these two are the main reasons for this choice. 


Ethereum is a global, open-source platform for decentralized applications on which you can write code called a smart contract that controls digital value and runs exactly as programmed. Ethereum is the most popular blockchain because of the apps you can write on top of it.


On the other hand, the Stellar blockchain is an open network for storing and moving money. As we can see these two blockchains represent different business values. Ethereum works best for programming smart contracts in business integrations while Stellar facilitates the transfer of funds in a blockchain ecosystem.


Smart contract origins

Legal scholar and cryptographer Nick Szabo invented the smart contract concept which he laid out in a 1996 paper. In it, he defined smart contracts as “a set of promises, specified in digital form, including protocols within which the parties perform on the other promises.”


A smart contract is a self-executing contract made possible by blockchains and enforced by cryptographic coding. 


First, we should know that Stellar blockchain doesn’t have a smart contract as a contract language or build in a virtual machine to execute code. A Stellar smart contract is a composition of transactions that are connected and executed using various constraints and is instead optimized for sending, storing and trading value.


Stellar smart contracts

The following are examples of constraints for Stellar smart contracts:

  • Multisignature —  a concept requiring signatures of multiple parties to sign transactions stemming from an account. 

  • Batching / Atomicity — the concept of including multiple operations in one transaction. Atomicity is the guarantee that given a series of operations if one operation fails they all operate if the transaction fails.

  • Sequence —  represented on the Stellar network through sequence number. Using a sequence of numbers in transaction manipulation, it can be guaranteed that specific transactions do not succeed if an alternative transaction is submitted.

  • Time bounds — are limitations on the time period over which a transaction is valid and can be used to represent time in a Stellar smart contract.


Each transaction on the Stellar blockchain is confirmed by a consensus algorithm. The Stellar Consensus Protocol is an evolution of a federated Byzantine agreement.” The FBA protocol has a determined membership list but SCP uses open membership.


Stellar takeaways

Transactions on the Stellar blockchain are faster and the fee for a transaction is cheaper than Ethereum. So, Stellar offers new possibilities for business models. IBM, for example, uses Stellar to facilitate cross-border payments. The project is called IBM Blockchain World Wire and seems to be a very promising project. In Espeo Blockchain we use the Stellar blockchain to create P2P payment applications.   


Ethereum smart contracts

The Ethereum blockchain offers nearly endless possibilities to write smart contracts. We can approach many more uses than another blockchain because we can control our wrote code.  To write smart contracts on Ethereum there are a few different languages: Solidity, which is like JavaScript and the most popular nowadays and Serpent like Python. 


Question is how and why it works? To understand it that we should know two important and related concepts with Ethereum blockchains like the Ethereum Virtual Machine and gas. 

  • The Ethereum Virtual Machine (EVM) is a place where smart contracts run in Ethereum. It is Turing Complete programing language or we can say that it is a distributed global computer where all smart contracts are executed.

  • Each transaction has a cost measured in gas and each gas unit consumed by a transaction must be paid for in Ether, based on a gas/Ether price which changes dynamically. We should know that in each transaction we have a gas limit parameter that is an upper bound on how much gas we can consume. This parameter is used as a safe-guard against programming errors that could deplete an account’s funds.


As we can see we have control over our smart contract. This is good and bad because we can do much more than Stellar blockchain but our code could have a bug and be hacked much more. As in another blockchain, each smart contract run on the Ethereum blockchain is confirmed by a consensus algorithm. 


Ethereum takeaways

Ethereum is currently a proof-of-work consensus model. In proof of work, miners lend their computing power and compete against each other to complete transactions on the network and get rewarded in cryptocurrency. unsurprisingly, this is very energy-intensive but this algorithm protects the network against hacking.


Real-world applications

There are many different industries and solutions for these industries. When we want to choose blockchain we should ask which blockchain helps us solve problems and grow my business. These questions we can put in public and private blockchain too.  


Etherum is the most popular blockchain that uses smart contracts. Etherum is the best choice where we need to set parameters for the smart contracts. The best applications for the Ethereum blockchain are decentralized finance and asset tokenization.


The second very important thing is the ability to create different ERC tokens based on Ethereum. Many of us can say that Etherum is slow and it’s true. Although, there are tricks to overcome this. However, we should pay attention that it’s beginning of this technology and Ethereum core developers are working to improve the protocol.


Ethereum has versatile applications in which it outperforms other blockchains. In the real estate industry, we can tokenize real estate, or art opening these investments up to a larger number of people. We can improve and automate this process of fractional ownership as well. Today we have platforms that use Ethereum smart contracts to change ownership of parts of the building.


You deposit fiat or crypto money and receive tokens that represent part of the building. It looks like a notary’s contract but is faster, automatic and considerably cheaper. Ethereum has an advantage over other blockchains because it has its own tokens such as ERC20, ERC721 among others.


Conversely, the Stellar blockchain is a quite different blockchain for the other applications. The Stellar blockchain doesn’t have smart contracts based on Turing machines. We have an API where we have some number of endpoints to use. 


Conclusion

Developers can’t write our own smart contracts as in Ethereum. It’s not wrong because our work could be faster when we use existing methods. The Stellar blockchain is better for industries where we want to transfer assets like cryptocurrency or tokens generated on the Stellar blockchain. A good example it’s peer-to-peer mobile payment application or payment gateway using Stellar’s cryptocurrency, Lumens. In Espeo Blockchain, we have started work on a peer-to-peer payment system based on Stellar which is the most appropriate solution for this use case. 


Three main things why: very low fee for transactions than other blockchains, very fast transactions and ability to create own token which we can use as our asset in finance ecosystem.


Related posts: