The Ethereum ERC-20 Token Specification

The Ethereum Request For Comment ERC are defined technical protocols from an EIP (Ethereum Improvement Proposal) request to the Ethereum development community. Once the EIP has been approved, it becomes an ERC, and can be implemented on the blockchain. The ERC-20 token was a specification that allowed projects to use the Ethereum blockchain as a source for funding. It became very significant when ICOs (Initial Coin Offering) became popular between 2015 and 2017. That was until financial and trading compliance issues affected the continuation of ICOs due to lack of regulatory clarity. Certain projects will be under scrutiny to participating in ICO if they have not passed the statutes of limitation for the issuance of an unregistered “security”. This falls under the SEC (Securities and Exchange Commission) for most jurisdictions and have since discouraged new projects from issuing an ICO.

Since many projects are already using this as a standard on the Ethereum blockchain, the number of ERC-20 token contracts has grown. By mid-2017, there were around 5,500 ERC-20 smart contracts on the Ethereum network. It grew past 40,000 in 2018 and are further increasing. ERC-20 is not just a technical specification for creating tokens, but it also provides a guideline for how to interact with other wallets, smart contracts and digital marketplaces within the Ethereum ecosystem.

The ERC-20 became a standard on the Ethereum platform not only for funding, but for the issuance of tokens. Several cryptocurrency projects started out as ICO with tokens (e.g. EOS, Tron, OmiseGo). These projects used the Ethereum blockchain to fund their own coins as issued tokens which can later be exchanged for the native cryptocurrency asset once the main network is running. The ERC-20 tokens were temporarily locked into smart contracts that hold a certain amount of Ether. Once the projects were able to build their blockchain, the ERC-20 tokens from the smart contract could be exchanged for the native asset for that blockchain.

As a standard, ERC-20 provides uniformity of technical and protocol standard. This allows developers to follow a procedure, much like how developers create API for their application to communicate with other applications. This reduces complexity of understanding each type of token implementation. A tremendous benefit it brings to the Ethereum blockchain is enhanced liquidity, since Ether or ETH is required to purchase the tokens. That can affect the price of ETH in terms of market cap.

The structure of an ERC-20 token contains 6 functions, 2 events, and 3 token information functions. These functions are invoked and can be be called within a smart contract. From the ERC-20 specification, the following are the 6 functions:

1. totalSupply(): Total supply of Token.

2. balanceOf(address _owner): The balance in the _owner address.

3. Transfer(address _to, uint256 _value): Sends a token of _value to address_to, triggering the Transfer event.

4. transferFrom(address _from, address _to, uint256 _value): Sends a pass from the address_from _value to address_to, triggering the Transfer event.

5. Approve (address _spender, uint256 _value): Approve _spender to extract a certain amount of money.

6. Allowance(address _owner, address _spender): Returns the amount that _spender extracted from _owner.

Decentralized Apps or DApps also support ERC-20. These apps run on top of the Ethereum blockchain. The DApp can be used to query information or even to execute a smart contract. Developers can use the functions when dealing with digital tokens created on the Ethereum blockchain.

The following are the 2 events that are triggered by the functions:

1. Transfer(address indexed _from, address indexed _to, uint256 _value): Triggered when the token is transferred.

2. Approval(address indexed _owner, addressindexed _spender, uint256 _value): Triggered when the approve method is successfully called.

The token also needs to be set with any of these 3 types of token information:

1. Name: Name of the issued Token.

2. Symbol: The name of the Token issued. For example, EtherCent token or ECT on https://rinkeby.etherscan.io/token/0x8caca3dbb57ecb058a82209effde5bf647459771


3. Decimals: Set how many digits this token can reach after the small digits. Generally, the set value is 18, which means that it can reach 18 digits after the decimal point.

The following is an example ERC-20 token created on the Rinkeby test network.

Since Ether (ETH) was released prior to the ERC-20 standard, it does not actually comply with the specification. As a result, this led to the creation of Wrapped Ether (WETH). This is an ERC-20 token that represents Ether at a 1:1 ratio (1 WETH = 1 ETH) which can be exchanged for other ERC-20 tokens.

Since the popularity of ICOs have waned in 2020, ERC-20 tokens are not as common. They are still in use mainly by projects that have not yet released their own native tokens or by new projects that are testing token development (usually on a test network). By keeping their ERC-20 tokens locked with ETH, they are providing a sort of promise to their holders that they can convert it for more value in the future. The converted tokens can then be used within those blockchain projects as a medium of exchange or store of value.

The Cardano Principles For Scalability, Interoperability and Sustainability

Cardano is a unique cryptocurrency project that is based on sound principles rooted in science and engineering. Its application goes beyond financial systems, but implements a blockchain that covers a wider variety of applications. While it is available as a coin on digital exchanges, it does not yet have an actual use case (as of this posting). It is a development in progress that aims to nail the foundations for a well designed blockchain.

We can consider Cardano a Third Generation Blockchain. The First Generation uses Bitcoin’s Proof-of-Work (PoW) consensus mechanism and the UTXO model. Ethereum forms the basis for the Second Generation, which implements Turing complete Smart Contracts or EDCC (Executable Distributed Code Contracts). The Third Generation, which include other cryptocurrency like EOS and Tron, were based on Ethereum but innovate on consensus mechanisms. Like other Third Gen blockchains, it was also issued using an ICO that raised $62 Million.

Cardano, like Ethereum, uses a smart contract based system. The token or digital asset used on the network is called Ada. Ada provides balances to users with the Daedalus digital wallet. Cardano is also a platform for technological innovation and development. It will provide an operating system layer for DApp (Decentralized Applications) that run on the Cardano network. These DApp provide an interface to smart contracts that execute code to transfer value (e.g. payments, transfers, change of ownership, etc.). Cardano will facilitate these transactions and record it on its own blockchain for immutability and transparency purposes.

Cardano has 3 main features in its blockchain.

  1. Scalability – The network must be able to scale to meet the demands for high volume transaction processing. The developers address the issue of scaling by adopting a different consensus protocol mechanism that is based on Proof-of-Stake (PoS). Scalable systems are faster and more efficient, which is what a blockchain needs in order to handle production level processing of transactions. The network architecture for Cardano proposes using RINA (Recursive Internetwork Architecture).
  2. Interoperability – Many blockchains cannot directly interoperate with one another. There are solutions now that allow for “atomic swaps”, which essentially provides a way for two blockchains to transfer value between each other. Prior to that, digital exchanges were the only way to go. That creates an intermediary which is something a blockchain using direct P2P transfers can remove. With a third party, the cost of transactions increases and it can be tampered, censored or rejected.
  3. Sustainability – Many critics have called Bitcoin inefficient and unsustainable in the long run due to the way it consumes resources. A sustainable system is always more ideal in terms of efficiency and reliability. Sustainable systems have a way to last thus ensuring some degree of surviving into the future. Many blockchain projects lack this feature and have to end for a variety of reasons.

PHILOSOPHY

The following are Cardano’s philosophical principles taken from their website.

  • Separation of accounting and computation into different layers
  • Implementation of core components in highly modular functional code
  • Small groups of academics and developers competing with peer-reviewed research
  • Heavy use of interdisciplinary teams including early use of InfoSec experts
  • Fast iteration between white papers, implementation and new research required to correct issues discovered during review
  • Building in the ability to upgrade post-deployed systems without destroying the network
  • Development of a decentralized funding mechanism for future work
  • A long-term view on improving the design of cryptocurrencies so they can work on mobile devices with a reasonable and secure user experience
  • Bringing stakeholders closer to the operations and maintenance of their cryptocurrency
  • Acknowledging the need to account for multiple assets in the same ledger
  • Abstracting transactions to include optional metadata in order to better conform to the needs of legacy systems
  • Learning from the nearly 1,000 altcoins by embracing features that make sense
  • Adopt a standards-driven process inspired by the Internet Engineering Task Force using a dedicated foundation to lock down the final protocol design
  • Explore the social elements of commerce
  • Find a healthy middle ground for regulators to interact with commerce without compromising some core principles inherited from Bitcoin

OUROBOROS

Cardano’s consensus algorithm uses PoS and is called Ouroboros. This determines how participating computers called nodes come to a consensus on the network. Instead of miners like in PoW consensus algorithms (used by Bitcoin), PoS requires staking funds to qualify or participate as a validator node. These “stakeholders” must contribute to secure and process blocks of transactions on the network and in return they will be incentivized in Ada. If a “stakeholder” is dishonest or attempts to attack the network, they can lose the funds they staked so there is a consequence. This aims to make “stakeholders” good faith actors rather than become bad actors. Once “stakeholders” validate a block it is added to the main network’s blockchain.

What makes Cardano different from other PoS-based networks is according to their own website:

“For a blockchain to be secure, the means of selecting a stakeholder to make a block must be truly random. An innovation of Ouroboros to produce the randomness for the leader election process is to do this by way of a secure, multiparty implementation of a coin-flipping protocol.”

DEVELOPMENT COMMUNITY

Cardano also fosters a development community since it is an open source project. There are no barriers to entry for those who want to contribute, but is mostly on a voluntary basis. Developers are rewarded in Ada for their efforts. Cardano’s code is available for others to use in order to develop applications for the platform.

At the moment, Cardano is being managed by the IOHK (Input Output Hong Kong). They will be a part of the project until 2020 according to their contract.

FUNCTIONAL PROGRAMMING

The main programming language used in Cardano is Haskell which is functional, strong and static typed. One of the reasons it was used is due to its reliability in mission critical systems. They provide a solid and secure foundation for back end systems that handle massive workloads. This means the code and logic is stable enough to be able to scale and provide reliability with little room for failures.

In functional programming if there is a function f(x) that we want to use to calculate a function g(x) to get the results of yet another function h(x). Rather than solving in sequence, it can be simplified to a single function:

h(g(f(x)))

This provides a mathematically simpler way of computing. These form the foundations for Cardano Smart Contracts. It aids in Formal Verification to prove how a program acts and what its results will be. This gives Cardano a “High Assurance Code” property.

THE PROJECT ROAD MAP

Cardano follows a road map for its development. It is divided into 5 phases called eras: Byron, Shelley, Goguen, Basho and Voltaire. It is now in the Voltaire era in 2020, which will decide the digital governance used on the network.

For more on the road map, click here.

THOUGHTS

Like any cryptocurrency project, I don’t suggest buying their token just because the project looks good on paper. This is how Cardano is like. While it is based on a sound foundation, it has not yet been applied to solving real world problems. It offers a theoretical solution that is yet to be proven. If it does deliver on its goals, Cardano’s prices may not really go up either, since it depends on the asset’s liquidity and volume. The project looks promising and that can spur certain expectations.

Note: This is not financial advice. DYOR always to verify facts.

The Different Types Of Cryptocurrency Assets

Not all cryptocurrency are the same. They have different purposes, from utility tokens that provide a service to tokens that transfer value. Tokenizing a certain industry (e.g. cannabis, music, entertainment) is also possible using digital transformations with the use of a cryptocurrency with a blockchain or distributed ledger. Although they were based on the foundations of decentralization, some are more decentralized than others. It is because of the problems of scalability. In order to become more scalable, many assets have become more centralized in order to handle more transaction volumes.

Platform Cryptographic Assets

Ethereum, NEO and EOS are examples of application development platforms. Developers can use these platforms like an operating system to build applications called DApps (Distributed Applications). They are based on the concept of gas as unit of cost for computation. The logic is encapsulated in smart contracts, which contain conditions for executing code that can perform transactions. Gas costs, measured in units called gwei, are smaller denominations of the main token like ether that are spent on processing the transaction (much like a transaction fee). Many proponents do not classify these assets as securities, but a platform token needed for operations on the network.

Payment Cryptographic Assets

Bitcoin is the classic example of a P2P digital currency or payment cryptographic asset. This asset class is used as a medium of exchange for payments on goods and services. The use of these asset tokens provide a fast and efficient way to transfer value for cross-border payments and direct payment transfers without requiring a third party like banks. This circumvents jurisdiction regulations, so there are plenty of legal implications regarding these assets. There are many of them based on the original Bitcoin architecture. Although Bitcoin’s token BTC was meant for payments, it is fast becoming a store of value.

Side Chains

These complement the main network of a blockchain. This enables BTC and other payment assets and other ledger assets to be transferred between multiple blockchains. These implement an off-chain solution and are primarily used for the purpose of scaling the network. It removes the burdens of transaction processing from the main network. However, settlements are still made on the main network to record the state of the transaction. Side chains merely facilitate the transfer of value while the main network records it. The Lightning Network is an example of this.

Application Token

There are many ways cryptocurrency can be applied to real world business and financial solutions. It has also found its way to certain industries with interesting applications. Stablecoins are an example with the Tether project. This allows pegging fiat to a cryptocurrency asset for the purpose of trading in a volatile market. These allows traders to store the value of their fiat currency without losing from the speculative cryptocurrency market. Golem and Veritaseum are other examples of how tokens can be used for computing distribution and capital market connections. It is related to protocols, because applications run mostly on top of a protocol built for a platform.

Protocol Token

Protocols refers to rules of a particular ecosystem. It can be in the finance or energy market. These tokens were designed with incentivization as a purpose. This allows more value to enter blockchain based cryptocurrency. Protocols provide a supporting layer for applications built to run on platforms. They are mutually beneficial to each other. For example the Ethereum protocol can be used to support smart contract development running DApps. In order to run the DApp it will use a protocol token like ether. The DApp itself can generate its own value using an application token as an incentive.

Ethereum’s Istanbul Updates

The second largest cryptocurrency project after Bitcoin, Ethereum, will be releasing an upgrade to its blockchain. It is a hard fork codenamed Istanbul, is set for release this December 2019 and aims to bring a series of improvements and updated features. Ethereum is better known as a decentralized and distributed platform for application development using smart contracts. It uses a native token called ether, which is the unit of cost for gas. Gas is the cost of computation to perform a task on the Ethereum blockchain’s network. This cost is associated with the compute resources that forms a part of the blockchain’s consensus mechanism that verifies transactions and validates blocks.

Istanbul is the successor upgrade to Constantinople, which was released earlier in 2019. According to the Ethereum blog:

“If you use an exchange (such as Coinbase, Kraken, or Binance), a web wallet service (such as Metamask, MyCrypto, or MyEtherWallet), a mobile wallet service (such as Coinbase Wallet, Status.im, or Trust Wallet), or a hardware wallet (such as Ledger, Trezor, or KeepKey) you do not need to do anything unless you are informed to take additional steps by your exchange or wallet service.”

The upgrades in Istanbul are detailed in EIP (Ethereum Improvement Proposals). More information is provided in EIP-1679.

This list is a summary of the upgrade features to expect from Istanbul:

  • Ongoing work on post-quantum cryptography: both hash-based as well as based on post-quantum-secure ‘structured’ mathematical objects, eg. elliptic curve isogenies, lattices…
  • Anti-collusion infrastructure: ongoing work and refinement of https://ethresear.ch/t/minimal-anti-collusion-infrastructure/5413, including adding privacy against the operator, adding multi-party computation in a maximally practical way, etc…
  • Homomorphic encryption and multi-party computation: ongoing improvements are still required for practicality
  • Decentralized governance mechanisms: DAOs are cool, but current DAOs are still very primitive; we can do better
  • Fully formalizing responses to PoS 51% attacks: ongoing work and refinement of https://ethresear.ch/t/responding-to-51-attacks-in-casper-ffg/6363
  • More sources of public goods funding: the ideal is to charge for congestible resources inside of systems that have network effects (eg. transaction fees), but doing so in decentralized systems requires public legitimacy; hence this is a social problem along with the technical one of finding possible source…

“In general, base-layer problems are slowly but surely decreasing, but application-layer problems are only just getting started.”

The upgrade is expected to take place (unless any new issues come up) at block number 9,069,000, which is expected on  Saturday, December 7, 2019

The Benefits Of The Blockchain To The Cannabis Industry

The cannabis industry can stand to benefit from the features of blockchain technology. This may have some people scratching their heads “How is smoking weed going on a blockchain?” It is not about the activity itself but the business of cannabis supply and transactions. When it comes to verifying the supply chain, the blockchain can provide a service to cannabis dealers that they are getting their supply from legal and authorized sources. This can help reduce discrepancies like fraud while increasing the efficiency of delivery and production.

The legalization of marijuana for medicinal or recreational use in states like California, Colorado and Nevada have led to the rise in retail outlets that sell cannabis derived products. It is no longer just dispensaries that can distribute marijuana legally, but licensed outlets as well. To obtain licenses there are basic legal requirements that must be met and these records could benefit from a DLT (Distributed Ledger Technology). That is not exactly a blockchain, unless it is a system that also issues a digital coin or token. This will allow transactions to be audited from a DLT that incentivizes nodes or computers that participate in consensus to verify transactions and validate blocks in the blockchain.

States where marijuana is legal. (As of June 2019, Source Business Insider)

The idea is unconventional but there are already some businesses in the cannabis industry that are looking into the blockchain. The main benefit the blockchain can provide besides verifying licenses is verifying the supply chain. Things can be obscure when dealing with the supply of marijuana. In the US, most of the supply of marijuana comes from illegal sources that are smuggled into the country. This involves activity which evades law enforcement and keeps a black market thriving. Often times the supply chain is affected by fraud, theft and even unauthorized sources. It can also be tampered with by corrupt businesses to make more money, which is essentially cheating. The solution to stopping this is not up to the blockchain, but it can help verify where the sources are coming from in order to confirm their authenticity.

Marijuana is not just about recreational use. It also has medical benefits which is another market segment that the cannabis industry can tap into. If the supply comes from verified sources, like legal cannabis farms, it helps the industry. At the same time it can help government regulators monitor and audit the supply knowing that there is an immutable and transparent record of its origin and sale from legal businesses. Growers, distributors, retailers and marketers of cannabis products are verified at every step of the “seed-to-shelf” process by a blockchain solution.

The process begins with the growers. These are the businesses that grow the marijuana plants. The growers must meet certain requirements for compliance and are listed in a DLT for retailers who make the purchases at bulk before distribution using what are called smart contracts. The smart contract is a programmable code that states the conditions and logic of the transactions which can execute autonomously. The retailers themselves are held accountable for the sale, and there will be a record of their transaction. The retailers can then sell the cannabis which marketers can promote. We have seen products like brownies, cookies and even beer derived from cannabis. This also creates an industry for paraphernalia, publications and lifestyle products that are centered around cannabis. Those who do the marketing will know who to promote based on verified sources confirmed on the blockchain. This would remove ambiguity as to the legality of the business.

Involving cryptocurrency is essential in a blockchain, but for the cannabis industry while it may be a solution for the producers, perhaps not for the customers. The issue here is that identity is not hidden but pseudonymous in nature since transactions can still be traced back to someone. Some private citizens who use marijuana may not feel comfortable about this. A cannabis coin that is used as a token for purchasing marijuana (medical or recreational) sets up more auditability for regulators to find who and for what reason marijuana is being used. This token is fungible in nature just like fiat cash so it doesn’t have to be tied to any particular identity. It can also be spent in direct peer-to-peer transactions that can be used to exchange items and services other than marijuana products. The transaction will still be recorded on a digital ledger as a digital proof.

With greater visibility due to transparency and higher efficiency due to traceability, businesses in the cannabis industry can benefit from the blockchain. At the moment there are various projects that are exploring this implementation. Startup TruTrace has partnered with Deloitte, the professional services giant. They are working on building a tracking system using a blockchain for “seed-to-sale” of cannabis. Other ways blockchains can help the cannabis industry besides tracking the supply chain includes documenting public information regarding authentic marijuana strains (types of cannabis), verify the amounts of cannabis in edible products sold in grocery or specialty stores with certified labels and also certification of cannabis products as approved by the FDA. Worst case without certified products are fake or dangerous products that could affect the health of customers. There are more issues that one can use blockchains to explore, but a verification system is one way to expand and legitimize the industry.

Facebook Libra Is Realizing The Difficulty Of Regulatory Compliance

Facebook’s Libra is not looking good. Paypal, Mastercard, Visa and even E-Bay have pulled out of the Libra Association. This comes after the hurdles Facebook needs to overcome in order to meet regulatory compliance. This tells us just how difficult it is to build blockchain-based solutions that offer cryptocurrency as payments. It seems easy on paper to draft a proposal to gather some of the world’s leading companies to form a system for digital and cryptographically secure payments.

The following have been some of the criticisms thrown at Facebook from members of the US Senate (Senators Sherrod Schatz and Brian Brown) in a letter sent to CEOs of Visa, Mastercard and Stripe.

“We are concerned because key questions remain unanswered about the risks the project poses to consumers, regulated financial institutions, and the global financial system. We urge you to carefully consider how your companies will manage these risks before proceeding.”

The senators continue with this warning:

“Facebook is currently struggling to tackle massive issues, such as privacy violations, disinformation, election interference, discrimination, and fraud, and it has not demonstrated an ability to bring those failures under control. You should be concerned that any weaknesses in Facebook’s risk management systems will become weaknesses in your systems that you may not be able to effectively mitigate.

All this seems to have influenced the decisions of Libra Association members from dropping out of the project. Facebook is not exactly trustworthy when it comes to data privacy and security after revelations of their involvement with Cambridge Analytica and selling user data to third party without full consent. This makes the situation even more difficult with so much opposition from within the US government.

Libra aims to serve the unbanked and provide a fast and reliable way to make electronic payments using Facebook’s ecosystem. This is actually a major undertaking because of its potential to open up the cryptocurrency market to mass adoption. What is at stake here are Facebook’s 2+ billion users along with its social media platform Instagram and messaging application WhatsApp. Those who joined the Libra Association were viewing this as a major business opportunity to tap the market which this creates with Facebook’s users. Users would use the Libra token which they can access from the Calibra digital wallet to make payments, using WhatsApp.

The opposition seems to stem from the impact this would have not just on the US economic and financial system, but the world as well. This is because other countries also do not have a favorable look on Libra. In essence, Facebook would become a bank that would not be regulated by jurisdiction like the US SEC if it were allowed to operate. That can also threaten major banks around the world who could lose their customers to Facebook. With the ease of payments and money transfers, Facebook could definitely facilitate the unbanked all over the world. All they will need is their smartphone or computer to open Facebook and they have access to their digital money.

That would be unfair to other financial institutions, who are regulated and follow jurisdiction compliance. Why should Libra have no regulation when it is doing the same type of business as banks and financial service companies. What Facebook probably didn’t realize is the reason cryptocurrency are better off decentralized without any central authority. Bitcoin has been around for more than 10 years now because it has no owner or actual structural organization. It is truly decentralized in its governance. Despite being associated with Satoshi Nakamoto, no one can come after him because he remains anonymous. Perhaps Facebook is too late in realizing this is how you build a cryptocurrency.

The cryptocurrency community is also not that favorable of Libra, though some are open minded to the idea. Those who look in favor like the idea because it could open up the cryptosphere to more people. Libra would be the on-ramp to other cryptocurrency so it is a gateway so to speak. The more die hard cryptocurrency supporters don’t even consider Libra as a true cryptocurrency running on a real blockchain. It is basically just another form of electronic cash pegged to fiat that uses a digital ledger technology (DLT) that is highly centralized. The purpose of a true blockchain with a cryptocurrency is to be a trustless and permissionless decentralized system.

The odds seem stacked up against Facebook and their Libra Association. The good thing about this is that Facebook is realizing the potential of cryptocurrency and blockchain technology. They must meet regulatory compliance in order to proceed. The Libra Association is still intact, but they will need Facebook to meet compliance in order to get approval. The stakes are high, and there is big money to be made behind this. What is clear here is that the US SEC is making it clear that in order to play you have to follow the rules. It is now up to Facebook if they can meet those requirements.

Proof-of-Stake Consensus Mechanism

The power of cryptocurrency is not just security and decentralization. It is also due to what is called the consensus mechanism, which allows participants called nodes in a decentralized system to come to an agreement to validate the truth on a blockchain. The most popular is the consensus used in Bitcoin, called PoW (Proof-of-Work) which requires mining to create coins on the network. Although it has been tried, tested and proven true, it has issues with scalability and sustainability. Although mining is reliable, it can be energy intensive to participant nodes because it requires plenty of computing resources (hash rate) to solve cryptographic puzzles to add a block to the blockchain. That translates to larger electric bills and thus will not be ideal for payment systems that require mass volume transactions that need to be processed daily 24/7/365. It is also slow because in a blockchain, the data is sent to all nodes rather than just one server processing the transactions. It had its limitations called out by developers, thus leading to other consensus mechanisms that used more efficient algorithms that also increase the transaction velocity on the network.

This is why a new type of consensus mechanism was developed called PoS (Proof-of-Stake).

What is PoS?

This is not the same as Point-of-Sale, that is a totally different system for payments. Proof-of-Stake is a consensus mechanism algorithm that requires no mining to validate transactions and create blocks. Instead it requires to stake a certain amount of funds to become validators on the network. These funds are a % of the total coins that exist on the network.

Let f = fund staked as %, Ts = total supply of coins, Ta = total amount staked

f = (Ta / Ts) x 100

PoS and variations of it are being used in cryptocurrency like EOS, Tron, Tezos and soon it will be implemented on the Ethereum network.

When you are mining for blocks using PoW, like in Bitcoin, you must compete with other nodes called miners in order to validate blocks. This is done by trying to solve what is called the nonce which is a value (based on a difficulty target) that contains a hash of numbers. The value is either less than or equal to the nonce, and must be discovered by miners within an average time of 10 minutes. The miner who is able to compute the nonce first becomes the block validator who creates the blocks and in return receives Bitcoins as a reward.

On PoS, there is no need to compete with other nodes to solve a cryptographic puzzle. Instead, there are a set number of nodes called stakers who will help validate transactions. In some systems, like in a delegated PoS network, token holders can vote for block validators (called producers in EOS) who have staked a large investment into capital resources (e.g. data center, servers, etc.). The code than provides a time when block validators will create blocks and in return they will receive their reward in the cryptocurrency’s tokens.

If we have two staking nodes called f1 and f2:

If f1 = (Ta / Ts) x 100 > f2 = (Ta / Ts) x 100

This means f1 will be the block validator based on what was staked or weight of their % of coins.

Here is one example of PoS. According to Ethereum founder Vitalik Buterin from his blog:

The simplest formula for this (PoS) is:

SHA256(prevhash + address + timestamp) <= 2^256 * balance / diff

prevhash is the hash of the previous block
address is the address of the stake-miner
timestamp is the current Unix time in seconds
balance is the account balance of the stack-miner 
diff is an adjustable global difficulty parameter

“If a given account satisfies this equation at any particular second, it may produce a valid block, giving that account some block reward.”

The idea behind PoS is to encourage honest participation among trustless participants using game theory. You cannot know for sure who is acting on good faith or who is the bad actor. Thus, the idea of putting your own funds as a stake to being a validator is what shows your willingness to help in the network. Otherwise, that participant will lose their staked funds if they become dishonest or try to attack the network. The consensus among all nodes can deny the participant’s block if they attempt to cheat. They either lose their stake or get rejected from the network and even blacklisted. It all comes down to the protocols of the digital governance on the network, something that is a feature of PoS systems.

Another thing to note is that PoS is also based on the weight or amount a node has put at stake. Therefore, the more funds you stake the better your chances are for becoming a block validator. The validators can be chosen by random selection or voted by the token holders as mentioned earlier. This process is much faster to resolve than the 10 minute block propagation time in Bitcoin’s PoW because it requires no mining to solve for the nonce. It can actually be more instantaneous since the selected block validator can process the transactions and create the block which then updates all nodes on the blockchain. Much faster than having all nodes try to validate the block at the same time by discovering a nonce. This allows for faster transactions speeds that are more suitable for micropayments and retail transactions i.e. buying a cup of coffee with cryptocurrency.

This consensus mechanism is also more energy efficient. Producing a block on the network doesn’t require expending a lot of electricity like in Bitcoin. This saves not just costs, but also time. This has been the main argument for PoS among its proponents.

Despite its more refined algorithm, there are also issues with PoS. The following will discuss some of the well known issues.

Stake Inequality

If you are to look at the algorithm, it favors wealth. Critics argue that in a PoS system, those with more at stake or resources available will surely always come out as the validators. This is not exactly fair, and can lead to a sort of network oligarchy which can control the blockchain. If this is the case, what have PoS developers done about such issue?

To make sure that things are fair, code was written to randomize block validator selection that is still based on the amount at stake. This means that anyone who is staking is likely to get selected based on how much they have staked. When the load of transactions is even greater to process, a node that has staked more will likely become the validator because their stake can prove that they have the resources available to create the block. Now the argument against this is that it still shows that it will be favorable only to those with higher incomes. They can even collude to become block validators based on their stakes and collect all the fees from transactions. This creates a barrier to entry that limits decentralization. This then can lead to centralization, which is what blockchains are not supposed to be.

Centralized Validators

Centralization is indeed counter to the ideology of a blockchain. In order to prevent only a few validators from ever gaining control of the network, different methods have been developed.

Here are some of those methods:

  • Randomized Selection – This will ensure that validators who have validated before will not be the only validators. Instead the algorithm will randomly select a new validator each time. A validator who has validated before will get their chance again in the future. Some networks will actually allow for x number of validators only, while others can allow for unlimited numbers of potential validators.
  • Elections – Other cryptocurrency use digital elections or delegated PoS (e.g. EOS and Tron) to determine who the block validators will be. In EOS they are called Block Producers, while in Tron they are Super Representatives. The network allows all token holders with voting rights to ‘freeze’ funds for candidates to become validators. In EOS 21 are elected while in Tron it is 27. This appears to be a smaller number of nodes, but the logic behind this is that although it is less decentralized, it helps to scale up processing for faster transaction processing. The network can then call for a new round of elections to select new validators to make sure that it is not too centralized.
  • Time Allotment – In this scheme, anyone who has staked joins a queue to become a block validator. It will be a fixed amount, and so the system is not based on who has staked the most. The node will then wait for their turn to become a block validator. The problem with this type of scheme is if anyone can validate, how can we be sure they have the resources to do so? What if they are using only a low end PC or just their smartphone? Will that be enough compute power to create blocks? In this case, such a system can work for nanopayments or even non-compute intensive micropayments that use smaller block sizes. All the node needs to do is add the block after the consensus has determined it is valid. In return the node receives their fees.
  • Validation By Delegation – In Tezos this is the PoS scheme, called Liquid PoS. In this system, a validator can delegate their validation rights to other validators on the network. This is done using a process called baking. The node called a baker has block producing rights based on their stake. This model is more or less a way of sharing the rewards. This is because by process of validation by delegation, the baker can delegate production to another baker without transferring their ownership of stake. Instead they keep the stake and get rewards which they then share with the delegated baker. This works well if the baker has a good reputation and integrity on the network.

Network Attacks

The problem with centralization is that a rogue node can accumulate a majority of the cryptocurrency’s tokens. If they were to gain 51% of the coins and stake them on the network, that can lead to attacks. Now the question is, does that even make sense? It definitely requires a lot of investing into the cryptocurrency to have a majority hold on its coins. This is also called the 51% Attack and it can also be possible of PoW systems.

f = (Ta / Ts) x 100 = 51

In a post made on the Qtum blog:

“In PoS, after a rollback, the attacker address can be blacklisted and those coins simply ‘deleted’. This would make the remaining coins in the system go up in value and the attacker would have to repurchase the coins in an effort to relaunch the attack. This is especially risky for them if they were shorting the coins, as they no longer have access to them and have to pay back the lender.”

In this case it would make things more expensive to attack the network so it discourages bad actors. As of this writing (September 2019), there has never been a successful attack on a PoS blockchain that demonstrates this example.

Nothing At Stake

The Nothing At Stake theory is a problem that arises on the blockchain due to its distributed nature. This type of attack can delay and complicate transactions on the network. Staking is a process that adds value to the network. What is being staked is actually the % of coins that a user has of the total supply. It is thus in their best interest to make sure that the network is secured, otherwise they will lose their value. This incentivizes the node that stakes to behave honestly or else risk devaluing their network.

This problem can occur when there is a fork or series of forks on the network. A fork is another chain that forms from the main network during a contentious moment in which the network becomes split. One network supports one block while the other half refuses to go along with it. This also occurs when there are simultaneously two block validators trying to produce a block for the network. During a fork, a node can put their stake on both chains because they have nothing to lose from it. This type of behavior is not exactly approved by consensus.

The node can get away with it though. This is because the node will get their reward no matter which chain wins. This can lead to what is called a double spend. The node that has put a stake on both chains loses nothing because they will get their reward from the chain that wins. Now imagine if all nodes followed this lead. It makes two chains exist at once, which means there is really no main network. The node has nothing at stake because they don’t incur any costs to doing this.

This makes the network less secure and prone to more discrepancies. One of the chains can overtake the other, and any bad transaction on one chain is considered good on the other chain. Thus, a node has nothing to lose since the eventual chain that wins will reverse any bad transactions they had on the failed chain. The node collects fees no matter which chain they are on, and this can lead to many inconsistencies on the blockchain.

To address this issue, developers have come up with mechanisms that prevent or discourage this. To explain in simple terms, when the network detects a node attempting a nothing at stake attack, they will be reprimanded. The consequence is that the node will lose their stake, which is something to lose. This encourages honesty among the nodes because of the penalty of malicious intent to the network.

Critical Factors

A great feature of PoS is to allow more participation among token holders and involve the community when it comes to consensus. However a cryptocurrency chooses to implement their PoS protocols, the thing to remember is that this is an alternative option to PoW. The benefits are clear, but there are also issues that need to be addressed. Some have tried to implement a hybrid PoS and PoW system to reap the benefits of both consensus mechanisms. Overall, these systems will eventually mature and develop over time, so there is plenty to observe once they have been in production.

Stablecoins – Stability In A Sea Of Volatility

The cryptocurrency market is highly volatile. That is the main risk involved due to the speculative nature for cryptocurrency. Price changes can suddenly shift in a matter of seconds. A typical phenomenon observed in the market is called “pump and dump”, and involves a large injection of capital followed by a large outflow of it as well. This is an example of market manipulation, often carried out by investors called “whales”, who have large funds that can influence the market.

Since there is little regulation and lack of clarity in this space, it is really hard to control how money moves in and out of the market. Price valuation depends on the market cap that is the total capital of the cryptocurrency asset. The idea here for most investors is a future return of value, which is typical of a security. However, cryptocurrency are meant to be a form of payment or medium of exchange which has utility. It is supposed to be a currency like the US Dollar or the Euro, but speculators are treating it as a valuable asset. In other words, most cryptocurrency especially Bitcoin, are being treated as a store of value. Investors are “HODling” or holding on to them with the expectation of higher values in the future.

The problem with holding is the price volatility of cryptocurrency assets. The market shifts and swings, with 100% gains getting wiped out in seconds. Those who continue to hold are using a long term strategy but traders who go short will often lose more money than they expect. There is actually a solution to avoid the price volatility in the market for traders. Enter stablecoins, a cryptocurrency that is pegged to the value of fiat currency.

The best and oldest example of a stablecoin is Tether. The token is named USDT and is pegged to fiat currency like the US Dollar, Euro and Japanese Yen. This provides price stability for traders who want to keep their funds in the cryptocurrency market without the volatility of price swings. It makes sense to keep USDT as a trading pair with the top cryptocurrency in the market. Traders who hold USDT, don’t have to undergo any conversion at exchanges from fiat to cryptocurrency any longer. This will cost traders more money because of the associated fees with exchanging between fiat and cryptocurrency. With USDT, traders can conveniently hold their cryptocurrency assets without being affected by price swings since the USDT token is always pegged one to one to the US Dollar, etc. Since USDT has existing trading pairs with many cryptocurrency it is much simpler to trade on digital exchanges.

The complexity of moving large amounts of money from a bank to a digital exchange and vice versa, is in itself a hassle. Not to mention the scrutiny and the fees involved. Traders who have to convert fiat from their bank back to cryptocurrency to trade on exchanges are also incurring a loss because they could miss the moment to trade because of the process involved. A trader will be able to trade faster by just holding a stablecoin like USDT which they can convert and pump back into the market with an order book on digital exchanges.

According to Wikipedia, a stablecoin is:

“… designed to minimize the volatility of the price of the stablecoin, relative to some “stable” asset or basket of assets.”

The basket of assets can include precious metals or even other types of cryptocurrency. In the case of Tether, 1 US Dollar is supposed to back each USDT token issued. Maintaining that price point requires auditable proofs, which stablecoins must be able to provide to regulators.

Stablecoins even have a practical business application not just for traders, but for businessmen and financiers. Moving money across borders with cryptocurrency is actually faster and much simpler than using a bank of money transfer service. It does however, circumvent jurisdiction laws and that is the issue with transactions like this. There have also been criticisms that stablecoins may not actually have the fiat reserves to back their cryptocurrency. This has been the controversy with Tether. It is more a lack of transparency in their financial information that has regulators investigating.

Another issue that seems to beg scrutiny are how centralized stablecoins are under their respective companies. Most all stablecoins – Tether, Paxos, Gemini, TrueUSD – were developed by a company. Though they use a blockchain-based digital ledger technology, their governance and business process is not truly decentralized. They still make money from fees, but what if the government or a certain jurisdiction shuts down the company for non-compliance to regulations? What happens to the stablecoin holders? Digital exchanges can choose to blacklist the stablecoin token, and this would be disastrous for holders who have plenty of them to exchange. Stablecoins may also lead to an increase in the supply of money leading to inflation that is pegged to a national currency. That is another possible problem that stablecoins could introduce or exacerbate.

There are hurdles and many regulatory clarity questions regarding stablecoins. They can eventually lead to greater adoption with further cooperation with jurisdictions and regulators. Even Facebook and Walmart are planning to release their own cryptocurrency that uses a stablecoin. This can impact the mainstream since those are two of the world’s biggest companies. The potential is there, so it is just a matter of how they will be regulated and how companies who issue them will be able to comply. Stablecoins are beneficial to the cryptocurrency market as a whole. Whenever USDT trading volumes are high, it usually correlates to more trading activity of cryptocurrency assets like Bitcoin. Digital exchanges like Huobi and Binance reported 40-80% of transactions use USDT. It is also originating from China, where traders are using stablecoins like USDT to avoid banking restrictions (From article “Why Tether Volume Is At All-Time High” on Coindesk).

A Cointelegraph article “Stablecoins to Play Key Role in Crypto Adoption, Says New Report” states that stablecoins will have a key role in cryptocurrency adoption. This is optimistic news for stablecoins as they aim to address market volatility in cryptocurrency and hyperinflation with fiat currency. Countries with a high inflation rate can adopt stablecoins to stabilize their funds as a sort of safe haven, though this has not yet been seen on a proven scale. There are plenty of new projects being mentioned now that have the use for stablecoins. It could possibly draw the attention of institutional investors. The stability it can bring to a volatile market is what makes it an attractive solution for trading and perhaps even investing.

Facebook, Ready To Become A Global Bank?

What advantage do social media giants have to offering financial services?

A large user base. Facebook is set to provide electronic payment services using their own digital currency called the Libra coin. This story was huge when it first came out because of the hype around it as a cryptocurrency that would compete against Bitcoin and Ethereum. Perhaps that is not quite correct. The Libra coin is being offered as a token that provides ways for users on Facebook’s platform to make payments to each other. The tokens are provided with the Calibra wallet and a network validates transactions via a group known as the Libra Association.

Facebook’s cryptocurrency is not using an actual blockchain, but more a digital ledger. While it also uses cryptography to secure transactions and make them immutable and provide transparency, the set number of validators on the network make it more permissioned and centralized than a public blockchain. That is counter to the ideology behind cryptocurrency which are supposed to be permissionless and decentralized. Facebook will not be the sole validator on the network though, that is because it will be the duty of the Libra Association.

The Libra token is also not exactly going to be a competitor against Bitcoin. Libra’s value will not be based on market speculation or demand, but will be pegged to fiat currency. It is not exactly the type of digital asset to acquire as a store of value, unless the purpose of the token changes. Otherwise it is just like another version of an electronic payment system that is already quite common. Pegging it into fiat removes the volatility that is typical of cryptocurrency. No matter how many Libra coins you have, its value will remain the same as the amount of fiat you exchanged it for. The use of the Libra token for payments is to provide easier ways to pay with less friction and for accountability purposes.

The list of Libra alliance members is what is impressive. The idea that Facebook was able to unite companies like PayPal, Uber, Lyft, Visa and Mastercard gives the notion that this must really be on to something. That is because it has such huge potential, it has already attracted scrutiny from mainstream finance and regulators. However, it is not exactly a good thing because rather than approve it, critics want to either stop the whole thing from happening or regulate it with the full extent of the law.

What we have to realize is that Facebook has over 2+ billion users. The impact such undertaking has can influence people’s lives. That means that billions of users will be able to use Facebook to not only make payments, but as an on ramp to trading cryptocurrency as well. That can be good news for Bitcoin and Ethereum holders. Rather than compete, it can foster cryptocurrency growth. Facebook wants to reach out to the greater part of the population that is unbanked. Now that is a significantly large proportion of the world’s population. With more people having access to the Internet through their smartphones (4G technology), the impact this can have is really huge.

For regulators, the concern is Facebook’s reputation. Since the data privacy issues and Facebook’s appearance before the Senate, why would anyone trust Facebook? Other concerns include whether Facebook will censor those on their platform from using Libra. The overall power that Facebook will have in this field makes it hard for anyone else to compete against because of how large the user base is. Facebook is an ecosystem that includes Instagram, WhatsApp and Messenger. It will become so easy and convenient to use these apps to make payments, it is a great business plan.

For banks the biggest concern here is Facebook as a competitor. Libra coins can be bought using the Libra Association’s payment processors. It does not require banks, and this raises more scrutiny. Does this mean “Facebook will become their own bank?”, because they can very well do that. If people and businesses can start taking out loans from the Facebook, that will disrupt the banking industry. The amount of fiat reserves that Facebook and their Libra Association will hold from selling the coins will be held as not for profit. However, they can use the funds to continue to develop the Libra ecosystem and it will still benefit the members of the alliance and Facebook. Despite being not for profit, they still make money from accrued interest and the amount of money is huge. This is actually from a second token called the Libra Investment Token, and this is the financial reward for members of the Libra Association. Just like any cryptocurrency, there is an incentivized reward system for those who participate in its consensus.

Without further regulatory clarity and the amount of requirements, Facebook will have a mountain to climb until they get Libra to the public. Since the Libra Association has registered in Switzerland, they will also need to meet compliance with the authorities there. In the US, it will have to meet both federal and then state regulation before it can be approved. Other countries like China, may have a conflict of interest with Libra and may not ever see its use there.

What Libra coin can also provide is an on-ramp to on-board more people to an electronic payment system. Depending on how you look at it, the system can also be a gateway to cryptocurrency. Thus it will not directly compete with cryptocurrency like Bitcoin, but can actually make it easier for people to buy them. This is because Libra can be listed on digital exchanges where they have a pairing to other cryptocurrency. While Libra can be used for payments, they can also be traded for other cryptocurrency on digital exchanges.

A global bank will have plenty of power, but also require more responsibility. Facebook has already violated trust among its users by selling their data to third party. There are now also issues with privacy after Facebook admitted that it listens in to conversations in order to improve the service. Will consumers also be comfortable knowing that all their transactions are tracked on digital ledger that is controlled by a sort of oligarchy i.e. The Libra Association. The problem is that there is so much lack of transparency, users would not have been aware of what is happening. The Libra Association claims they will move to a more permissionless and decentralized system by moving to the PoS (Proof-of-State) consensus. They also want to guarantee that there is transparency and immutability like in any other blockchain. Libra may be good for users in general, but earning trust is the issue. Whether or not Facebook is up to the task remains to be seen.

Litecoin Halving – Do Less Rewards Mean More Value To Miners?

The Litecoin blockchain halving was succesful at the block height of 1,680,000 at 10:16 UTC (Monday August 5, 2019). The halving reduces the Litecoin reward in half, from 25 LTC to 12.5 LTC per block mined. There was no immediate dramatic rise in the price of LTC, but it showed plenty of optimism in the market. Litecoin, like Bitcoin, has a limited supply which caps at 84 million LTC. The halving is an event that occurs on the Litecoin network every 840,000 blocks or approximately every 4 years. As the name implies, it is a 50% reduction of the miner’s rewards for every block they validate on the network. This is part of the Litecoin consensus mechanism called PoW (Proof-of-Work) which is also used in the Bitcoin blockchain.

The halving creates digital scarcity, and to some analysts this means the digital asset becomes more valuable. Whether it is due to the lower supply of LTC or the hype surrounding the event, prices have not increased at the levels some may have expected. Perhaps this is due to the halving being priced in with investors already having accumulated the digital asset ahead of time. If these transactions were done over the counter style, then it will not really affect the market prices on digital exchanges. Some analysts believe there should be more to expect in terms of the utility of the token rather than just anticipate the digital scarcity will increase prices. Perhaps the law of supply and demand doesn’t exactly equate to expectations in a volatile cryptocurrency market.

LTC is used mainly in making direct P2P online electronic payments. It functions like any other cryptocurrency, where the transactions are made transparent and immutable, allowing for greater accountability. In terms of speed, it isn’t any faster than traditional payment systems like VISA or Mastercard. However, LTC can instantly transfer value across any border because of its P2P feature. The transactions also have lower fees than money transfer agents or bank charges. When you don’t have intermediaries in the payment network, you can pretty much transfer value easily in a frictionless manner. All that is needed is an exchange that supports LTC that converts the cryptocurrency to fiat.

The problem is that regulatory clarity has not fully accepted cryptocurrency like LTC. Although it is being used by some people to make payments or transfer value, it is not happening on a large scale yet. Not all exchanges are available in all countries that support a fiat to LTC pairing. If any exchange has a Litecoin pairing then it would be easier to transact. This would be like how using the USD becomes viable because of currency exchanges that support it. Therefore it makes it accessible to everyone and it is the legal medium for exchange. LTC on the other hand is not readily available to be used to purchase items, unless the business supports it. So far there are very few establishments that will accept LTC as a payment for let us say a cup of coffee or breakfast sandwich. How easy it is to use fiat to pay for those items.

There is more concern among the mining community though. Since block rewards have been cut in half, operations will be affected due to decrease in profitability among miners. It would be fine if the price of LTC greatly increases, but if not then the miners will have to absorb net losses. The issue here is related to the electricity costs to cover producing LTC from mining blocks. What this can result to is an exit among miners who cannot absorb the costs, while established miners will continue mining and making profit. The bigger mining pools can survive because they have the resources to do so. The hash rate of the overall network could also decrease, making the difficulty target easier and block mining just as profitable for the miners who remain in the game. 

Let’s look at how blocks are mined on Litecoin’s blockchain. The block production time, on average, is 1 block every 2.5 minutes, which is 576 blocks are produced every 24 hours. Due to the halving, each block mined now rewards miners 12.5 LTC. That means that every day or every 24 hour period 7,200 LTC is created. This will go on for the next 840,000 blocks which will be the next halving. With a total supply cap of 84 million LTC, the halving leads to less and less rewards for miners. The incentive here is to produce blocks, but with less rewards there may be less miners providing hash power to the network. The idea is that demand will exceed supply, so miners will still be incentivized to validate and mine blocks so the value of LTC will increase. The point here is that the lower amount of LTC is not going to stop miners if the price of LTC increases due to the demand. Fees should also be reasonable enough that people will use LTC to make payments. So far it seems current fees are low enough in terms of LTC/KB with 3 priority levels (the highest level costing more than the rest). This is what the Litecoin team refers to as “near-zero cost payments” i.e. cheap fees.

The only thing that has not been determined is whether LTC will continue. The LTC is only valuable if it is being used, but if it is just speculation fueling the prices then there is really no utility behind it. The developments in Litecoin need to catch up to the demand which is what is creating it in the first place. There has been encouraging news about new ways to bring privacy to transactions on the Litecoin blockchain. Developers will need to make sure that the value of LTC doesn’t rely on pure hype and speculation alone. Instead it must demonstrate that the technology is capable of providing the features of a decentralized instant electronic payment system for the world.