TOTAL trade ideas
Analysis on TOTAl in daily timeframe Today, I would like to share my opinion on TOTAL.
As you may have seen in my previous analysis a few weeks ago , TOTAL reached the origin of it's move, which I indicated in the grey box below.Now , after closing above consolidation zone,I anticipate that it will continue to move higher toward the next level shown on the chart.
TOTAL 1 - TAMarket Sentiment: Market sentiment has been negatively impacted by regulatory uncertainties, economic concerns, and the overall risk-off sentiment in the global financial markets. These external factors are influencing cryptocurrency investors' decisions and adding to the bearish sentiment.
Chart looks similar to 2019Mid 2019 we had the all time high for the year, then in October China announced positivity about blockchain, 30% + up, then from December till February again 30% + before a crash, overblown by covid fear.
Then 2020 post halving alt season, BTC season then blown off top. By Dia
Forward Test of the Universal Trend Algorithm on TOTALThis chart shows the Universal Trend Algorithm and the live signals we have received since forward testing. This chart shows the forward-tested results on the index of the crypto market.
The Universal Trend Algorithm is a swing trading algorithm designed to capture medium-term trends for investment portfolios and swing traders, signals can last from weeks to months. Hence the backtesting parameters are 100% of the equity as position size, as this system is more of an investment strategy, not a scalping strategy.
Backtesting started in 2020
MARKETS week ahead: October 2 – 8Last week in the news
“Higher for longer” continued to shape investors sentiment, ending September in losses. During the last trading week of the month, equity markets both in the EU and the US continued with correction, while US Treasury yields continued to be elevated, reaching higher levels from the 2008 financial crisis. The S&P 500 finished the month some 4.7% lower. The crypto market gained some 2.4% on a weekly basis, but still with fragile strength to sustain higher grounds.
Although the general sentiment on financial markets is pretty negative during the last period, the investors are continuing to closely monitor inflation developments, anticipating the next Fed`s move. During the previous week, the Fed`s favorite inflation indicator was published, posting the core personal consumption expenditures price index to 0.1% in August, lower from market expectation of 0.2%. At the same time, core PCE on a yearly basis was down to 3.9% in August from 4.3% posted for July. This was a small positive sign for market participants that inflation is indeed slowing down and that measures imposed by the Fed in the previous period are giving the results. Based on the latest report, markets are currently giving only 15% probability for a potential rate increase at November`s FOMC meeting.
In line with the US inflation gauges, inflation in the Euro Area also seems to slow down. As per published data, the inflation in the EU fell to the level of 4.3% on a yearly basis in September, although the markets were expecting to see the figure of 4.5%. Although core inflation reached 4.5% y/y, it was still a significant drop from 5.3% posted for August. August inflation figures are at its lowest levels since October 2021. Based on the latest ECB projections it could be expected for inflation to fall down to 3.2% next year, and finally reach targeted 2% in 2025. The ECB is also following Fed`s rhetoric of “higher for longer” interest rates.
JPMorgan Chase decided to block their crypto-related operations in the U.K. over concerns on the “rise in frauds” related to the crypto assets. Coinbase CEO, Brian Armstrong criticized such action of JPMorgan and other banks which took the same course in the UK when it comes to their crypto related businesses, strongly disagreeing with a decision to de-platform the whole crypto industry. Instead, he is noting that regulators should be the ones to make a decision on what is allowed and what is not on the market, and not banks.
Ripple announced that the company is discontinuing its initial intention to purchase a chartered trust company Fortress Trust, based in Nevada. As announced at the company, Ripple will continue to be an investor in this company. Although there has not been officially noted the reason for such a decision, the market speculates that it might be due to the recent theft occurred at Fortress Trust, totalling around $15 million, due to “unnamed third-party vendor, that had fallen victim to a phishing attack”, as Coindesk reported.
Crypto market cap
Markets are continuing to digest the “higher for longer” rhetoric from FED during its September`s monetary meeting. Investors continue to be focused on inflation figures in a hope that the Fed will skip further rate hikes for this year. As per current CME questionnaire, market has lowered expectations for another rate hike at November's FOMC meeting, but still, surprises by Fed officials are possible, especially after Fed Chair Powell`s announcement that there will be yet another rate hike till the end of this year. After that, the US interest rates will continue to be elevated through the course of the next year. But even with these elevated interest rates, the Fed is not expecting to reach its 2% inflation target until year 2025. It seems that monetary authorities are ready to accept generally changed global economic circumstances where increased inflation becomes a part of the economic reality. Although US equities and Treasuries lost in value during the previous week, the crypto market gained from investors' slowly emerging appetite for riskier assets in anticipation of higher returns for this year. Total crypto market capitalization has increased by 2.3% during the week, adding total $24B to its market cap. Daily trading volumes were modestly increased to $56B on a daily basis, from FWB:33B traded a week before. Total crypto market capitalization increase since the beginning of this year reached a level of 40%, where it has added a total $302B to the market cap.
It was a generally positive week for crypto coins, where the majority of them gained in value. BTC and ETH were major coins with highest participation in total crypto market cap increase during the previous week. BTC gained $8.8B on a weekly basis or 1.70%. The winner of the week was ETH, with a gain of $10.8B or 5.65% increase within a single week. BNB could also be mentioned as a significant gainer in nominal terms, as this coin managed to add $0.85B to its total value, which represents a 2.6% increase for this coin. There have been several coins with solid gains in relative terms, like Maker with a surge in value of 18.4%, LINK was up by 15.8%, Bitcoin Cash was up by 13.3%, OMG Network gained 12.7% w/w. There have been only a few losers during the week, with relatively smaller drop in price like NEO, with a drop in value of almost 2%, Stellar was down by 1% while Polkadot lost 1.75% on a weekly basis. There has been modest movements in circulating coins for several currencies, where Polkadot lost 3.8% of its coins in circulation while Filecoin added 0.4% new coins.
Crypto futures market
The crypto futures market was holding a positive sentiment during the previous week. Both BTC and ETH futures were traded at higher grounds from the end of the previous week. BTC short term futures were traded some 1.5% higher from the week before, and in line with developments on the spot market. Futures maturing in December this year ended the week at price $27.290 or 0.7% higher, while December 2024 managed to return to the levels above $30K as of the end of the previous week.
ETH short term futures were traded around 4.6% higher on a weekly basis, but still lower from the spot market. December this year ended the week at a price $1.691 or 4.9% higher from the end of the previous week. At the same time, longer term futures prices were increased by more than 4%, with December 2024 ending the week at price $1.791. Regardless of the developments on the spot market, investors are still holding precaution when ETH future prices are in question.
TOTAL - Bull run starts October?To get more clues on what BTC is doing, I analyzed the TOTAL (Total Crypto Market Cap).
I use Elliott, trendlines, and fibonacci. I keep getting the same results on many analysis, of the bull run starting in October.
I label my waves 1 A W and 2 B and Y. Why is that? There is a real possibility, that crypto does a huge pump for months, then another bear market hits. So I keep these corrective labels to remind me. This idea lines up with the fact that the US Treasury yield curves inverted 11 months ago. If you are not aware, in past history, recessions hit anywhere from immediate to 17 months after a yield curve inversion.
MARKETS week ahead: Sept 25 - Oct 1Last week in the news
Soft landing, hard landing or no-landing is the pending question among market participants after the FOMC meeting held on Wednesday. Markets are never happy with uncertainty, which brought some increased volatility on US markets. After Fed Chair Powell's speech, Treasury yields reached their highest levels since 2007, equity markets sharply fell, while Bitcoin followed the drop on the stronger US dollar.
The FOMC meeting was held on Wednesday where the Fed left rates unchanged, still, leaving some space for another rate hike till the end of this year. Fed Chair Powell delivered an after-meeting speech where he pointed toward the higher-for-longer interest rate levels. One of the important notes from this meeting is expectations from the Fed to cut rates during the next year. Gross domestic product was sharply revised to the level of 2.1% for this year, but is expected to fall during the next year. Markets immediately priced the new Fed`s standing of higher-for-longer rates, where Treasury yields were significantly elevated and the US stock markets fell sharply during the Chair Powell's speech.
Another topic that spotted investors interest during the previous week was Japanese yen weakening against the US dollar. As per analysis from JPMorgan experts, a further yen weakening might influence the Government of Japan to increase interest rates, which could further spark the repatriation of Japan's capital kept in the foreign markets. As per analysts, such an event might further increase volatilities across the US markets. The Bank of Japan is still holding short term interest rates at a negative territory, at level of -0.1%, while 10Y Government bond continues to yield around zero.
JPMorgan analysts commented on Ethereum in their latest research report published on Thursday. As per their opinion, Ethereum`s Shanghai upgrade, which was implemented in April, did not provide expected results. The activity on this network modestly dropped during the last few months, while they presented the result of a 12% decrease in daily transactions since the Shanghai upgrade was implemented. At the same time, several other analysts are noting that there is a general drop in activity on the crypto market, hence, it does not mean that the drop in activity on Ethereum network is necessarily a consequence of the Shanghai upgrade.
Binance Holdings and its CEO, Changpeng Zhao have filed a request to the US court to officially dismiss a lawsuit made by the US Security and Exchange Commission. The basis for such a claim is that the SEC overstepped its authority through this lawsuit, considering that there is still no clear guidelines on how crypto companies should comply with the law in the US while the SEC should not impose any further guidelines retroactively, as they are trying to do in the case of Binance Exchange.
Crypto market cap
The pivotal event of the previous week was certainly the FOMC meeting. Fed officials changed rhetoric a bit, as well as projections for the next two years. Although they left the interest rate unchanged at this meeting, still, based on their projections, there is still room for rates to be increased until the end of this year. The Fed`s pivotal point should be expected somewhere during the next year, when they will start slowly with interest rate decrease. Expectations on the growth of the US economy for this year are revised up to the level of 2.1%, with a decrease in the year ahead. Also, the unemployment rate is expected to reach its highest level around 4.1% during the next year. The economists are quite divided on such projections, noting that the latest Fed`s revised projections would certainly need another revision in the coming period. Anyway, markets did not perceive well what they have heard from Fed Chair Powell, and the downturn on the markets began even during this speech. Bitcoin also followed mainstream`s markets path to the downside, amid stronger US dollar, but overall, the crypto market remained relatively flat. Total crypto market capitalization remained at almost the same level, losing some $2B in value, which represents around 0.2% of its total market cap. Daily trading volumes were again decreased, to the daily levels around $ 33B, from $ 43B traded the week before. Total crypto market capitalization increase since the beginning of this year remained flat at level of 37%, where it has added total $278B to the market cap.
Another mixed week on the crypto market. Total market capitalization remained flat week on week, however, there has been some reallocation of funds between coins. Bitcoin had a relatively volatile week, but managed to end it relatively flat, adding 0.11% to its market cap. At the same time, ETH lost $5.5B in value, decreasing its cap by 2.8% w/w. Altcoins with significant increase in value during the week were LINK, with an increase of 13.29% in value followed by Algorand, with an increase of 5.4%. XRP, Theta, ZCash and Solana ended the previous week more than 2% higher from the week before. On the losing side were Miota, with a drop in value of 4.65%, Bitcoin Cash was down by 2.9%, Stellar lost 3.3%, while ADA dropped by 2%. As for coins in circulation, the situation was a bit calmer from the week before, where Polkadot increased its circulating coins by 4.8% w/w, Stellar`s coins were up by 0.6%, while Solana increased coins in circulation by 0.3% same as Filecoin.
Crypto futures market
The crypto futures market was generally following developments on the spot market during the previous week. Bitcoin short term futures ended the week in a modest green territory, where December 2023 futures were traded 0.67% higher compared to the week before, and ended the week at level $27.095. At the same time, longer term futures were traded some 0.40% lower on a weekly basis. December 2024 ended the week at level $29.640 or 0.45% lower on a weekly basis.
ETH futures did not have a good week, as all maturities dropped between 2% and 3% compared to the week before. Short term ETH futures were traded some 2% lower, with December 2023 ending the week at level of $1.612 or even 3.13% lower from the end of the previous week. December 2024. was closed at price $1.712, some 2.93% lower on a weekly basis. ETH`s future prices continue to be negatively perceived by the markets.
Total (Crypto Market Cap) 1W until end of 2023Price is expected to move sideways until mid October between 1T and 1.115T
Starting mid October scenario is splitting into two: Optimistic and Realistic. End of October will show which scenario takes place.
Optimistic scenario includes prolonged sideways movement until start of November and consequent steady growth until the end of 2023.
Realistic scenario implies breakdown below 1T bottoming no lower than 922B and ranging there until February with possible false breakout on the edge of 2023 and 2024. Steady growth is expected no earlier than mid February 2024.
In my humble opinion, I tend to err to Realistic scenario and it is more aligned with my view of Others.
The Path of HOLDERS" 🌟🚀Hello, fellow crypto enthusiasts! I'm CryptoMojo, the name you can trust when it comes to trading views. As the captain of one of the most vibrant and rapidly growing crypto communities, I invite you to join me for the latest updates and expert long and short calls across a wide range of exchanges. I've got your trading needs covered with setups for the short-, mid-, and long-term. Let's dive into the charts together!
I've dedicated my time and effort to crafting this chart, but remember, what you see here is crypto insight, not financial advice. 🚀💰 #CryptoMojo #CryptoTrading
HODLers, Prepare to Conquer! 🌟
While the Bitcoin rollercoaster may seem to have reached its lowest point, the thrilling journey through the crypto wilderness is far from over. Right now, we're venturing deep into the captivating Accumulation phase, a realm that demands not only Patience but also Courage as our guiding stars. 🌲💫
Now, let's turn our attention to the tantalizing world of #Altcoins, where on the majestic canvas of higher timeframe charts, they're poised for nothing short of a spectacular breakthrough. As we gaze ahead into Q4, all signs point to a bullish adventure for these altcoin gems. 🚀📈
In this bustling and often clamorous crypto realm, here's your compass: Accumulate your treasures with the shrewdness of a seasoned collector and hold them with the unyielding resolve of a true champion. Tune out the distractions, and cling unswervingly to your long-term vision. 🚀💎
In the grand tapestry of the crypto cosmos, rest assured, your steadfast Patience will soon be showered with the rewards you've envisioned. Keep the faith, for the best is yet to come!" 🌌💰 #CryptoHODL #LongTermGains
This chart is likely to help you make better trade decisions if it does consider upvoting it.
I would also love to know your charts and views in the comment section.
Thank you
MEGA MACRO TOTAL CRYPTOWhat I've done here is used the bars pattern to find a "reasonable" low in total market cap. and by reasonable, I mean made up. I like the resulting parallel trend line, however the gap at the bottom concerns me. Markets just may need to see a complete dump before a bull market can happen again.
Who knows.
Crypto - Key Breakout LevelSorry about the mic fuzz at the beginning.
Leave your questions & thoughts in the comments.
To sum up:
Bulls to regain control until the start-mid November at 30k levels
Bears to very quickly take over at those levels
This aligns with analysts' timing predictions of a heavy recession start.
Considering DXY likely not being stationary, 30k is a rough estimation
This aligns with analysts' timing predictions of a heavy recession start in end of 2023 or early 2024.
Should we trust on math? 11T$ TargetWhen we checked the last cycles our fib target was always 3.6 Fib level, now we see that we will see something like 11T$, it looks huge, impossible.
So in this scenario, there will be mass adaptation, and full media cover with blockchain and web3, especially Meta, De-Fi and Rwa will be strong pushers.
You know people, who never buy red, they lie themselves like they do on social media, they don't wanna buy red stuff only green because it makes you better, buying is an addiction to greed, you must buy green and you are super greedy at that time!
So there will be millions of people who lost their purchasing power, and missed a lot of opportunities in past with low-interest rates, new use hype is expected to be a billion in this bull-run! Right now 1.4 billion people are using iPhone, such a massive adoption when you remember the first days of the iPhone, we were still using Nokia or what?
The banking system is stupid right now, why do we have % commission for one single transaction even If you buy milk on the market, why do we give them for sending money or holding our assets there so what if CBDC came to our real life?
One way or another world doesn't realize something recession and crashes won't happen when everybody expects, it happens when you thought bad days are over, probably 2025-2026 will have these hidden signals when everyone was superb happy.
So I am waiting for a big step for printing money, adaption and huge crash like dot.com bubble and that cycle will bring us next bull-run but people will lose a lot of money, we could lose money too we know that but greedy people never things that, only one thing we should be careful that we shouldn't be super greedy in 2025.
Have a nice day guys, I hope to comment this post next year with superb expectation for the future, please comment below.
Total index📌📊Total
✅On September 1, in the analysis of the Total index, we mentioned that if the market reaches the level of 1.116, we expect a very good downtrend, which happened from the level 1.09 and penetrated the last support level of the index, that is, 991.
❗️Which returned with strength,
In general, when a supply or demand area is broken which this breakout is fake, like what happened now in the total chart, the market reaches the highest level and the origin of the previous movement, which is the level of 1.116.
✅On the other hand, the area ahead, i.e. the level of 1.06, may cause the index to reverse.
❗️In general, the trend of price movement in the direction of a fake breakout has happened.
✅Therefore, the total index in the future will be either from the same level ahead or from a higher level, i.e. 1.116 or downward.
#total
How To Use Total Market Cap ✨We can use Total Market Cap to analyse when it's best to go bullish or bearish on the crypto market. A growing market cap can indicate investors' interest and their positive evaluation of the current market state = bullish whereas a stagnant market cap would indicate that investors are taking their money away from the crypto market = bearish.
By analyzing the Total Crypto Market Cap weekly chart, we can see 5 clear waves to the downside, which means we are either in motive wave 1 or in wave A of a zigzag pattern.
For both cases, we are expecting an ABC correction opposite to the recent 5 waves. we have already completed subwave A and finishing now subwave B, expecting subwave C higher.
In a zigzag pattern ( 5-3-5) we have:
Wave A= 5 waves
Wave B = 3 waves
Wave C = 5 waves
Therefore, our mission for the long term is to catch the impulsive waves of wave C after wave B. But for now will be focusing on catching subwave C of wave B.
We will be using this chart as a guide for the other cryptocurrencies charts.
Stay tuned for more Crypto analysis!
Blockchain Architecture Blockchain Architecture
Around how to realize decentralized trust, a blockchain can be divided into five layers from a technical point of view, which are the data layer, network layer, consensus layer, contract layer, and application layer, as shown in Figure 1. The data layer defines the blockchain’s underlying data structure, storage structure, and ledger pattern as the theoretical basis and outlines a theoretical model of decentralized trust. The theoretical model of blockchain decentralized trust in the network layer is realized by utilizing the distributed P2P network. In the consensus layer, the consensus algorithm organizes and coordinates the behaviors of nodes in the decentralized system to drive the continuous operation of the blockchain. In the contract layer, smart contracts are introduced as the extension of the blockchain so that the blockchain can handle more complex transactions. At the application layer, providing blockchain APIs makes it easy for developers to build Dapps and offer decentralized solutions to problems from various industries.
Mathematics 11 00101 g001 550Figure 1. Blockchain architecture.
3.1. Data Layer
Due to the lack of authoritative central node coordination and management, the decentralized system has problems such as easy data tampering, untraceable node behavior, and difficulty in rapidly authenticating transactions, leading to the data not being trusted. As the theoretical basis of blockchain, the data layer needs to solve the appealing problem to ensure that the data are credible to achieve decentralized trust. From the perspective of the logical structure of data, the blockchain is a chain composed of a connected block, and each block stores the transaction information. The blocks are connected by hash pointers and are chained in chronological order of their generation. According to the characteristics of the hash function, any slight modification to the block data will create a huge change in the hash value of the block, leading to the block not being chained. Based on that, security ensures that the data on the block is not tampered with, and thus the credibility of the data on the chain. The data layer constructs the decentralized trust model of blockchain from three aspects: data structure, storage structure, and ledger pattern.
3.2. Network Layer
The network layer is the key to implementing a decentralized system at the physical level. Decentralization means that the blockchain nodes are peer-to-peer at the physical level and that each node can communicate with each other without passing through the central node. Therefore, the network structure of the blockchain adopts the decentralized P2P structure. As shown in Figure 2, compared to a centralized network structure, a P2P network can ensure peer-to-peer communication between nodes, and nodes can join or exit the system quickly.
Mathematics 11 00101 g002 550Figure 2. P2P network vs. centralized network.
The P2P network is a distributed application architecture. The P2P networks were initially designed to facilitate the distribution of large files over unreliable networks. In a P2P network, multiple computers are connected in a peer-to-peer position, and the entire network does not require centralized coordination by a central processing node. In P2P networks, each peer can act as both requestor and responder of network services. Research on p2p network technology has recently focused on improving system performance and security. In system performance: Abudaqa et al. summarized, evaluated, compared, and classified the techniques used to improve the performance of P2P file-sharing systems based on network coding; Milojicic et al. provided a general analysis of the design and implementation issues of P2P systems in the context of practical cases. In security: Alharbi et al. explored the security weaknesses and threats in P2P networks and proposed that the fundamental problem of P2P networks is the trusting of peers and the problem of secure traffic routing. Risson et al. discussed the metrics affecting the robustness of P2P systems.
3.3. Consensus Layer
The consensus layer implements the consensus algorithm, which organizes and coordinates the decentralized system, allowing the blockchain to operate securely and stably. A blockchain is a distributed system where nodes communicate and coordinate with each other only through messaging because no central node is involved. In a distributed system, nodes agreeing on an event is also called a consensus, and a consensus algorithm is used to ensure data consistency among nodes in the system. Due to unavoidable problems such as network latency, node failure downtime, and bandwidth limitation, distributed systems are subject to the FLP impossibility principle and CAP theory. The FLP impossibility principle means that in a system containing multiple deterministic processes, as long as one process may fail, no protocol can guarantee a finite time for all processes to agree. CAP theory points out that it is impossible for any distributed system to satisfy consistency, availability, and partitioning of fault tolerance at the same time , as shown in Figure 3. Therefore, according to CAP theory and the FLP impossibility principle, certain aspects must be traded off when designing consensus algorithms for blockchains.
Mathematics 11 00101 g003 550Figure 3. CAP theory.
Blockchain can be regarded as a distributed public ledger. The essence of consensus is to decide the bookkeeping right, i.e., to solve the problem of who can produce the blocks and package the transactions into the blocks. According to the different mechanisms to reach consensus, blockchain consensus algorithms can be divided into proof-based and voting-based.
3.4. Contract Layer
The contract layer implements smart contracts, a set of digitally set commitments that are unmodifiable once deployed and executed immediately once triggered. Smart contracts, as an extension of the blockchain, enable the blockchain to have the ability to handle logically complex transactions.
3.5. Application Layer
The application layer provides API interfaces for users to easily build Dapps using blockchain services and applies blockchains to various practical scenarios. With the development of blockchain technology, various Dapps have emerged to bring decentralized trust solutions to the problems of traditional industries.
4. Blockchain Basic Principle
4.1. Data Structure
A blockchain has a chain structure in terms of blocks to achieve data immutability. The data structure of different blockchain platforms differs in specific details but is the same overall. Take Bitcoin as an example. The block in Bitcoin is divided into the block header and the block body. The block header contains the version number, random number, hash of the previous block, Merkle tree root hash, timestamp, current workload proof difficulty, etc. The block body contains all the transactions packed into the block, and the Merkle tree comprises these transactions. To support smart contracts, Ethernet adds a system state to the block header for storing account balances, contract storage, contract code, and account random numbers.
A block contains a block header, timestamp, proof-of-workload random number, hash of the previous block, packed transactions, Merkle tree, etc. . The block’s verification signature and proof-of-work use cryptographic algorithms such as elliptic curve encryption and SHA-256. The data-layer structure differs slightly from blockchain platform to blockchain platform because of the different functions they focus on. Take the Bitcoin system as an example, and the data-layer structure is shown in Figure 4:
Mathematics 11 00101 g004 550Figure 4. Blockchain data-layer structure.
To reduce the bandwidth consumption caused by block synchronization, each block in the Bitcoin system can be divided into two parts: the block header and the block body, which stores all the transaction records in the current block. Bitcoin nodes are divided into full nodes and light nodes. Bitcoin light nodes only need to synchronize the block header for block synchronization. The transaction records in the Bitcoin system are similar to the transaction records in the physical system. Each transaction record includes information such as the input and output addresses of the transaction information and the number of transfers. Based on this transaction information, a corresponding form of Merkle-tree structure can be generated from the bottom up. The hash value of the root node of the Merkle tree is stored in the header of the block, and at the time of each block generation, the bookkeeper of the block adds a timestamp to the block, which is used to mark the generation time of the block. As the timestamp is enhanced, the block is extended to form a chain of blocks with a time dimension, allowing data information to be traced back in time. In addition, the block header contains the hash value of the previous block header, the version number, the random number of the proof of work, and the target hash value, among other information. Finally, the all information in the header of this block is hashed, and the resulting hash value exists in the header of the next block, which, in terms of logical structure, makes each block linked together in the form of a chain.
4.1.1. Hash Function
Hashing converts data of any length into a number within a fixed range. The conversion method is called a hash function, which calculates the value obtained after the original value is called a hash value. Take MD5, a widely used hash function, as an example. The MD5 algorithm is also called the MD5 message digest algorithm, which can generate a 128-bit hash value to ensure the integrity and consistency of information transmission. The MD5 algorithm is universal, stable, and fast; and it is widely used in the encryption and protection of ordinary data.
Hash functions are the basis of crucial blockchain technologies such as hash lists, digital signatures, and Merkle trees. The calculation of the hash function is unidirectional. It is easy to calculate the hash value of the given data, but it is difficult to deduce the original data given the hash value. The generated hash value may be the same for different data, and this phenomenon is called a hash collision. Due to the one-way nature of the hash function, people who want to generate hash collisions can only continuously try random numbers through brute force. Therefore, the process of finding suitable random numbers to create hash collisions is often used as “proof of work” by the blockchain.
4.1.2. Hash List
In order to ensure that the block data cannot be tampered with, the hash value of the previous block is retained in other blocks except the Genesis block, and the blocks are connected with the hash value to form a hash list. A hash list is a one-way chain table in which hash pointers connect nodes. Any small change in the block data will cause a huge change in the hash value, so it is impossible to tamper with the data in the hash list.
In addition to a chained structure, some scholars have proposed a blockchain with a non-chain structure for dealing with different scenarios. Qi et al. proposed a cascade structure of blockchain to solve the performance problem of blockchains, which can accelerate the generation of blocks, expand the capacity of blocks, reduce the risk of bifurcation, and increase the security. Ribero et al. proposed a cryptocurrency called DagCoin based on DAG structure, the first blockchain-based on DAG. DagCoin has no fixed blocks; each transaction has its own proof of work. The system can achieve a speed comparable to Bitcoin. Despite the emergence of blockchains with non-traditional chain structures, such as DAG and cascade structures, mainstream blockchains are still dominated by chain structures.
4.1.3. Timestamps
To make transactions traceable, Bitcoin adds timestamps to blocks and calculates the block’s hash value by using the timestamp as the information in the block together. The timestamp is the total number of seconds from 00:00:00 GMT on 1 January 1970 to the present, and the timestamp proves that the transaction in the block must have existed at that time.
The current development of timestamps mainly revolves around improving timestamp accuracy and reducing errors. Zhang et al. proposed an accurate blockchain-based timestamping scheme which solves the problem of the inaccuracy of file timestamps caused by blocks due to the existence of time errors in timestamps. Ma et al. proposed an optimized blockchain timestamping mechanism that reduces the range of timestamps in blocks to an average of 10 min by serving external trust timestamps to the blockchain consensus.
4.1.4. Merkle Tree
Blockchain stores all the transaction records of history, and the data volume of historical transaction data will become larger and larger as time goes by. It is unrealistic to verify the existence of a certain transaction by traversing all the historical transactions. To enable fast transaction verification, all transactions in the block are stored as a Merkle tree.
A Merkle tree is a tree that connects parent and child nodes with a hash pointer. Bitcoin uses the simplest binomial Merkle tree to quickly verify whether a transaction exists in a block. The structure of a binary Merkle tree is shown in Figure 5. Each leaf node in the tree corresponds to a SHA256 hash of one transaction data within the block. The value of the parent node is obtained by concatenating the values of the two child nodes and then performing a hash operation. Hashing between nodes is performed repeatedly until the root hash value is reached, when the transaction Merkle root is generated. The Merkle root is used to detect any tampering with the transaction data in the block, so as to ensure the integrity of the transaction data in the block.
Mathematics 11 00101 g005 550Figure 5. Merkle tree.
4.1.5. Digital Signature
Bitcoin is a chain of digital signatures designed to prevent transactions from being forged or denied. A digital signature is an unforgeable string of numbers that can be generated only by the sender of the message. It proves the validity of the sender of the message. Digital signatures are often used to verify the integrity of documents or messages and are an effective way to make transactions non-repudiation and unforgeable. In the process of Bitcoin transactions, the owner of a Bitcoin transfers the coin to the next owner by digitally signing it with the hash of the previous transaction and the next owner’s public key and adding it to the end of the coin. The recipient can verify these signatures to validate the ownership of the coin.
Digital signatures are based on asymmetric encryption, first proposed by Rivest et al. . Asymmetric encryption has two keys, which are used in the encryption and decryption processes. The commonly used asymmetric encryption algorithms in blockchain are RSA, SHA256, ECC, etc. As a decentralized distributed system, blockchain needs to adopt a compatible encryption algorithm because the system configuration of each node is different. RSA algorithm is an international standard algorithm that is widely used and compatible and can be applied to different systems. RSA is the first algorithm that can be used for encryption and digital signature, and it is also considered one of the best public key schemes. Although RSA has the characteristics of strong compatibility and high security, RSA has the problems of long key and time-consuming cryptographic computation. Compared to RSA, ECC has the advantages of small key length, high-security performance, and small time consumption for the whole digital signature. Compared with RSA, ECC can use a shorter key to achieve comparable or higher security than RSA.
4.2. Storage Structure
During blockchain transaction execution, transaction data need to be packaged into blocks, and data writing is in high demand. In the process of blockchain transaction validation, it is necessary to quickly locate the block where the transaction is in and perform transaction validation. Based on the above functional requirements, blockchain often uses a combination of file systems and databases to store block data. The file system can facilitate the system to append data in the form of logs, and the database stores the index information of the file where the block is located, which can quickly find the location of the relevant transaction block and assist the system in query. Block data and block “undo” data are stored in the file system, and block “undo” data are the data for rolling back the blockchain when the system generates a chain fork. The database stores the state and index data of the blockchain, which are usually stored in key–value pairs for quick querying.
4.3. Ledger Pattern
A blockchain is a decentralized transaction ledger, and the ledger records the history of all transactions. There are two main types of mainstream ledger patterns: transaction-based and account-based.
4.3.1. Transaction-Based Ledger
The transaction-based ledger is used for digital currency transactions and is the ledger model used by Bitcoin. In Bitcoin, an “Unspent Transaction Output” (UTXO) is used instead of a centralized institution to clear transactions. In this transaction-based model, the user’s assets are not explicitly recorded directly in the system but instead extrapolated from the information in UTXO. In order to know how many bitcoins a user has in total assets, we need to calculate how many coins that user has in total in all accounts in UTXO. The transaction-based ledger can record each transaction, trace the origin of each fund, and protect user privacy.
4.3.2. Account-Based Ledger
The account-based ledger is suitable for blockchain platforms that support smart contracts, such as Ethereum and Hyperledger Fabric. The account-based ledger model is similar to a bank account, where the account balance information is recorded explicitly by the system, and the transaction balance and business status data can be easily checked. Take Ethereum as an example. Ethereum accounts are divided into external accounts and contract accounts. External accounts are controlled by public–private key pairs; the user locally generates a public-private key pair. The private key controls the account also called a normal account. The user creates a contract that returns an address, and the contract can be invoked as long as the address of the contract is known. The account-based ledger gives participants a more stable identity and better support of smart contracts.
5. Consensus Mechanisms
In the decentralized scenario, without the participation of the central node, a fair operation mechanism, i.e., a consensus mechanism, must be established among the nodes of the blockchain to enable each node’s unified and coordinated operation. Blockchain establishes a “trustworthy” network among nodes through the consensus mechanism so that each node can reach an agreement and achieve data consistency in the ledger of each node in the blockchain, which drives the continuous operation of the blockchain. The consensus mechanism of blockchain mainly solves the problem of who will construct the block and who will package the transactions into the block . The consensus mechanism is the core of blockchain technology, which determines the security, scalability, and distributed nature of blockchain system. The problem of consensus originates from the “biliteracy problem”, and later the “Byzantine general problem” was proposed. The biliteracy problem refers to how to achieve reliable communication over unreliable channels. The Byzantine problem refers to the problem of how to make a distributed system agree in the presence of malicious behavior (e.g., message tampering or forgery), and the nodes that can both fail and behave badly are called “Byzantine nodes”. Consensus algorithms can be divided into classical distributed system consensus algorithms and blockchain consensus algorithms, depending on the time. Classical distributed consensus algorithms include Paxos, Raft, and Kafka. According to the different mechanisms used to reach consensus, blockchain consensus algorithms can be divided into proof-based and voting-based. The proof-based consensus algorithms require “some competition” among nodes to decide the bookkeeping rights, such as proof-of-work (PoW) and proof-of-stake (PoS). Proof-based consensus algorithms do not require the strict identity of participants, and nodes are free to join and exit, so proof-based consensus algorithms are commonly used in public chains. The voting-based consensus algorithm is initiated by a node to reach consensus by having the whole network nodes vote on whether to agree to the proposal, such as practical Byzantine fault tolerance (PBFT) . The voting-based consensus algorithms require a high identity of participating voting nodes and control the joining and exiting of nodes by the access mechanism, so voting-type consensus algorithms are commonly used in consortium chains.
The consensus algorithm is the core of blockchain technology and a research hotspot of blockchains. The current research on consensus algorithms mainly focuses on two aspects: performance optimization and application. In performance optimization: Wu et al. proposed a hybrid consensus algorithm for blockchains that combines the advantages of PoS and PBFT algorithms. It reduces the number of consensus nodes to a fixed value through verifiable pseudo-random ordering and witnesses transactions between nodes. The improved hybrid consensus algorithm has excellent scalability, high throughput, and low latency, which is superior to the previous single algorithm. In applications: Biswas et al. proposed a proof-of-block-transaction (PoBT) consensus algorithm. The algorithm allows the verification of transactions and the reduction of computation time for blocks, improving the performance of the system in terms of security, computation, memory, and bandwidth. Fu et al. proposed a framework for evaluating consensus algorithms to provide guidance for the selection of consensus algorithms in sundry blockchain application scenarios.
5.1. Pow
5.1.1. Overview
The proof of work (PoW) algorithm is one of the most widely used consensus algorithms in blockchain systems, and the Bitcoin system uses the PoW consensus algorithm. The PoW algorithm was first used for spam detection , and the core idea is to include in the email proof that a certain job has been completed (hence the name “proof of work”). Usually, the calculation of such proofs takes a few seconds, so this does not cause any difficulties for casual users. However, for spammers, this can take weeks to send millions of spam emails. Email recipients can easily verify if an email is a spam by proof of workload.
In the blockchain using the PoW consensus algorithm, nodes need to constantly search for a specific random number, which is usually required to be calculated by a hash function (e.g., SHA-256) to obtain a hash value starting with several zero bits. It can be verified that the average work required to compute the random number is an exponent of the number of required zero bits. Due to the one-way computation and irreversible nature of the hash function, the random number found by the node is easily verified. In the Bitcoin system, the first node to find a specific random number is given bookkeeping rights and 50 coins as a reward. Hence, the process of finding random numbers is also called: “mining”.
5.1.2. Advantages and Disadvantages
The Bitcoin system has been running smoothly since its launch in 2009 without any major failures, which is a testament to the effectiveness and security of PoW. In the PoW consensus, a node needs to control 51% of the computing power of the whole network to launch an attack. In the absence of a centralized node, the probability of a successful node attack is very low. Therefore, PoW consensus can effectively guarantee the security of the blockchain system. However, in PoW consensus, nodes constantly performing hashing operations will consume a large number of power resources, and blockchain chain systems using PoW consensus generally have serious energy consumption problems. In addition, the throughput of transactions in PoW consensus is very low. E.g., Bitcoin processes about seven transactions per second due to the limitation of block-out time and block size. This low transaction throughput makes it difficult to meet other application scenarios.
5.1.3. Improved Algorithms
PoEWAL (proof of elapsed work and luck) : The PoEWAL consensus reduced the energy cost of the consensus by adding a time limit to the PoW. The mechanism emphasizes consensus by solving problems partially rather than completely within a fixed time frame. By adjusting the size of a given time period, the resource consumption of block mining can be effectively reduced, and devices with low computing power can also participate in mining. However, the essence of the consensus is still to obtain more consecutive zero hash values through continuous hashing operations. There is a problem similar to PoW where nodes with high arithmetic power have a higher probability of successful mining.
The trust-based PoW mechanism : It can effectively solve the problem of high energy consumption in PoW consensus while ensuring the security of the blockchain network. By introducing the attribute of the node credit value, the higher the credit value, the lower the difficulty of node mining. Using a malicious behavior detection mechanism, the behavior of nodes is divided into positive and negative aspects, and positive behavior helps to increase the credit value of nodes. In contrast, negative behavior decreases the credit value of nodes. The positive aspect is expressed as the number of valid transactions calculated and verified by the node in the consensus process. In contrast, the negative aspect is determined by the node’s malicious behavior time and penalty coefficient, where the malicious behavior is divided into two types. One is the node’s lazy inaction in the consensus process. The other is the node’s double spending attack in the transaction. The system dynamically adjusts the penalty factor according to the actual malicious behavior of the node, but it will bring on an additional computational overhead for malicious behavior monitoring.
5.2. Pos/Dpos
5.2.1. Overview
The Proof-of-Stake (PoS) algorithm is designed to solve the problem of wasting a lot of resources by using PoW mining. Unlike PoW, which determines the bookkeeping right through the arithmetic power of nodes, PoS differentiates the bookkeeping right through the “equity” of nodes owning coins. The core idea of PoS is that in a decentralized network, the node with the largest equity will have a greater incentive to maintain the network. In terms of implementation, PoS introduces the coin age to dynamically adjust the mining level of nodes with different equity. The older the node, the lower the difficulty of mining it. Based on the appealing advantages of PoS, the PoS algorithm was first adopted in the blockchain platform peercoin, and Ethereum’s consensus mechanism was transitioned from PoW to PoS on 15 September 2022.
Although PoS solves the energy consumption problem of PoW, the performance is still not improved. In response to the performance problems of PoS, Dan proposed the delegated proof-of-stake (DPoS) algorithm . The topology of DPoS is shown in Figure 6. DPoS reduces the pressure on the network by reducing the number of participating consensus nodes and adding an election mechanism to PoS. As a variant of PoS, DPoS is similar to PoS in that the number of representative members is limited and elected by all, and the elected representatives participate in the consensus.
Mathematics 11 00101 g006 550Figure 6. DPoS topology.
5.2.2. Advantages and Disadvantages
PoS consensus can significantly provide the transaction throughput of the system and reduce the energy loss in the consensus process. However, PoS consensus has disadvantages such as poor fairness and ease of generating the Matthew effect. The use of coin age will make it easier for the node with more tokens to gain bookkeeping rights, shifting the power gradually to that node, decentralizing the degree of decentralization, and making fairness worse.
5.2.3. Improved Algorithms
e-PoS : In response to the possibility that PoS can lead to centralization and unfairness in blockchain systems, Saadd et al. improved PoS and proposed modular e-PoS. Compared with PoS, e-PoS can resist the power concentration of the network.
Ouroboros : Kiayias et al. proposed the first proof-of-stake-based consensus protocol with strict security guarantees. Ouroboros also employed a new incentive mechanism to incentivize “proof-of-stake” protocols, where honest behavior is an approximate Nash equilibrium.
5.3. Pbft
5.3.1. Overview
Practical Byzantine fault tolerance (PBFT) can tolerate Byzantine faults. The PBFT algorithm was proposed by Miguel Castro and Barbara Liskov in 1999. It improves the efficiency of the Byzantine algorithm and reduces the complexity from exponential to polynomial, making Byzantine fault tolerance practical. The PBFT algorithm can achieve 2f + 1 fault tolerance; f is the number of Byzantine nodes that can be tolerated; and 2f + 1 can ensure that the correct nodes in it send more information than malicious nodes. Therefore, the minimum number of nodes required by PBFT is 3f + 1 (the maximum number of fault-tolerant nodes is (n − 1)/3).
The PBFT algorithm is divided into five stages: request, preparation, preparation, confirmation, and reply. The process is shown in Figure 7. In the request stage, the client initiates a transaction request to the master node. In the pre-preparation phase, the master node verifies the message signature after receiving the request from the client. After the message signature verification is passed, it broadcasts the pre-preparing message to all the network’s nodes. In the preparation phase, the replica node verifies the message after receiving the pre-preparing information broadcast by the master node. If the verification is passed, the node broadcasts the prepare message to other nodes. In the confirmation phase, after receiving the correct prepare message from 2f other nodes, the node will enter the prepared state and send a commit message to other nodes. In the reply phase, after the node receives the commit message, it verifies the message, passes the verification, and waits for the commit message sent by 2f + 1 different nodes. After receiving the message, it will send a reply message to the client.
Mathematics 11 00101 g007 550Figure 7. PBFT consensus process.
5.3.2. Advantages and Disadvantages
The PBFT algorithm can realize Byzantine fault tolerance with polynomial complexity and reach a consensus in the presence of malicious nodes in the network so that the Byzantine fault tolerance algorithm can be applied in practical systems. However, the PBFT algorithm has problems such as high communication complexity, a fixed number of nodes, poor scalability and dynamics, and only being suitable for private chains or consortium chains. In terms of network resource consumption, the frequent broadcasting of messages by the system will also lead to high bandwidth consumption. When the number of participating nodes increases, network congestion will likely occur, resulting in system performance degradation. Regarding the number of participating nodes, the number of nodes in the PBFT algorithm remains unchanged, the nodes cannot enter and exit at will, and the number of nodes is fixed.
5.3.3. Improved Algorithms
Hot-Stuff : This algorithm was proposed by Abra et al. It improves the efficiency of the distributed consistency algorithm by making improvements to PBFT. The Hot-Stuff algorithm uses a parallel pipeline processing proposal, which is equivalent to combining the preparation and commitment phases in PBFT into one phase. In addition, Hot-Stuff uses linear view change (LVC), which reduces the communication complexity in view change.
RPBFT : In response to the problems of arbitrary master node selection, a high communication overhead, poor dynamics, and low efficiency in the PBFT algorithm, Li proposed the practical Byzantine fault-tolerant consensus algorithm (RPBFT) based on role management. The RPBFT algorithm divides nodes into three roles, manager, candidate, and normal nodes; and realizes the transition between roles through a reward mechanism and election mechanism. Each role has specific responsibilities, so the nodes do not need to restart the system during joining and exiting. Meanwhile, using a synchronous verification mechanism instead of the traditional view replacement protocol increases the node efficiency.
5.4. Discussion
The consensus mechanism is the core part of a blockchain. The traditional distributed consensus mechanism (PBFT) is not well adapted to the unique open environment of the blockchain, and the network connection is replicated between nodes. Therefore, traditional distributed consensus blockchain systems often employ various networking assumptions. However, reality often differs from our assumptions. Consensus mechanisms explicitly designed for blockchains (such as PoW, although its original purpose is not this, are still regarded as representatives of blockchain consensus mechanisms) often do not need to make various assumptions about the network and nodes. Thus, openness and decentralization tend to be stronger. In different application scenarios, the two have their advantages and disadvantages, and blockchain designers must choose.
6. Smart Contracts
Smart contracts are the core of blockchain 2.0 , represented by Ethereum smart contracts. They allow a blockchain to handle complex transactions not just limited to cryptocurrency ones. The concept of smart contracts was proposed before the emergence of blockchain, almost simultaneously with the emergence of the modern Internet. However, limited by the technological development at that time, smart contracts were not widely used until the emergence of blockchains.
Smart contracts are digitally established contractual terms that are self-verifying, self-executing, and do not require a third party. Compared to traditional contracts, smart contracts are more efficient, less costly, more secure, and free from “repudiation”. Smart contracts are designed to perform safely and efficiently without a trusted third party, which aligns with the “decentralized trust” of blockchain. The smart contract in a blockchain is essentially a piece of code that runs continuously, cannot be modified once deployed, and is executed automatically when a predefined condition is triggered. A blockchain enables reliable information exchange, value transfer, and asset management through smart contracts.
6.1. Development
Smart contracts were first proposed by American computer scientist Nick Szabo in 1995 . In 2009, the Bitcoin platform went online, supporting the use of Bitcoin scripts to manage transactions with the prototype of smart contracts. Bitcoin also represented the first generation of blockchain technology. In 2014, Ethereum introduced smart contracts and supported the creation of smart contracts in the Turing-complete programming language. In 2016, Kosba et al. proposed Hawk, a smart contract development framework that protects user privacy. In 2018, Kalra et al. proposed ZEUS, a smart contract security analysis framework. The framework provides an order of magnitude improvement in security analysis time compared to previous techniques. In 2020, Zheng et al. classified smart contract applications by comparing and analyzing typical smart contract platforms.
In summary, smart contracts are evolving towards easier development, higher security, and widespread application. Additionally, with the rise in blockchain technology, smart contracts will also receive more attention from scholars while developing rapidly.
6.2. Contract Languages
Smart contracts are deployed to blockchains, which requires the contracts to be strongly typed, as blockchains have valuable storage space. In addition, smart contracts should be easy to read and not misleading. Therefore, traditional programming languages such as C/C++ and Java do not write smart contracts very well. Programming languages for smart contracts have been born to meet the development needs of smart contracts.
6.2.1. Solidity
Solidity is a new language developed specifically for Ethereum smart contracts. It has a syntax similar to JavaScript and runs on EVM. Solidity is a statically typed programming language that supports inheritance, libraries, and user-defined types. It can be used to create voting, crowdfunding, blind auctions, and multi-signatures. It can be used to create a variety of contracts, such as voting, crowdfunding, blind auction, and multi-signature wallet. On Ethernet, solidity contracts are compiled into bytecode, written to blocks through special transactions, and eventually executed by other transactions driven by the Ethernet VM. Solidity is one of the most widely used contract languages today, but at the same time, solidity has seen many security vulnerabilities and corresponding attacks.
6.2.2. Vyper
To solve solidity’s security vulnerabilities, Vyper provides a smart contract language focusing on simplicity, suitability, and security , a contract-oriented Python programming language targeting EVM . Vyper has a very clean and easy-to-understand syntax, so it is almost impossible for developers to write misleading programs.
6.2.3. Daml
The DAML language is a domain-specific language specifically designed to encode shared business logic for simple, secure, and efficient applications. DAML is used for developing and deploying distributed applications in blockchain environments and is one of the best programming languages for smart contracts. Developers can use DAML to write applications quickly and concisely as an open-source programming language.
6.3. Platform Comparison
6.3.1. Bitcoin
In the Bitcoin network, users can write Bitcoin scripts to manage transactions. Bitcoin scripts are used to implement bitcoin transaction validation by checking a transaction’s lock script and unlock script. Bitcoin scripts are stack-based, non-stateful, non-Turing-complete scripting languages with no complex statements such as select and loop statements, and therefore, they have limited functionality. Bitcoin scripting reduces the complexity of the system while meeting the requirements of transaction needs. However, it also brings disadvantages, such as low flexibility and limited usage.
To allow Bitcoin to adapt to different systems, Bitcoin scripts are designed to be stateless so that a script can be executed similarly on any system. Suppose a script is validated on one system. In that case, it ensures that every other system in the Bitcoin network can also validate the script, meaning that a valid transaction is valid for everyone. A Bitcoin script is a sequence of actions for a transaction that describes what happens to the next person who wants to spend the bitcoins being transferred and will gain access to them, divided into locking scripts and transaction scripts. Bitcoin scripts have the makings of a smart contract.
6.3.2. Ethereum
For the first time in a blockchain system, Ethereum introduced smart contracts that support Turing completeness . Ethereum uses Solidity to write smart contracts. Solidity is a contract-oriented, high-level programming language created to implement smart contracts. In Ethereum, smart contracts deploy bytecode to the Ethereum network through transactions. Ethereum successful deployment generates a new smart contract account, executed by an Ethereum Virtual Machine (EVM). When deploying a smart contract, the contract code is first compiled into EVM bytecode by the SOLC smart contract compiler, and then a single transaction is used to create the smart contract. Ethereum smart contracts are Turing-complete, so in theory, users can write programs that do anything with them. It is easy to create contracts for voting, crowdfunding, closed auctions, multi-signature wallets, etc., using solidity, and they can meet most smart contract development needs.
6.3.3. Hyperledger Fabric
Hyperledger Fabric is a platform for distributed ledger solutions based on a modular architecture that is highly confidential, resilient, flexible, and scalable. Its main purpose is to support the pluggability of different components to the complexity and complexity of the economic ecosystem. Hyperledger Fabric typically deploys smart contracts in the form of chain code. In Hyperledger Fabric, the chain code is the business bearer and is primarily responsible for the specific business logic, i.e., encapsulating transaction definitions and processing logic into interfaces. Each chain code runs in a protected container (Docker), isolated from the running of background nodes. Hyperledger Fabric supports writing smart contracts in multiple languages, such as golang, java, and node.js, which greatly reduces the development threshold for smart contracts.
6.3.4. Eos
The Enterprise Operation System (EOS), a commercially distributed application blockchain operating system, is a new blockchain system developed by Block.one which aims to decentralize everything. As a new blockchain architecture , EOS provides a platform for smart contract development. It distributes storage designed to address scalability issues common in blockchain systems such as Ethereum and Bitcoin. EOS provides a decentralized application development environment with high transaction throughput through dPoS consensus and BFT consensus. Unlike Ether, which uses a virtual machine to execute smart contracts, EOS uses WebAssembly3, a portable, small, fast-loading, and web-compatible format, so users can write smart contracts in various languages as long as they can be compiled into WebAssembly3 (e.g., C++).
6.3.5. Avalanche
Avalanche is a new generation of public chain projects, and the main network was launched in September 2020. Avalanche is not a blockchain but a collection of blockchains composed of multiple subnets. The subnet has a special subnet consisting of three blockchains, the Primary Network. The three chains are the exchange chain (X-chain), platform chain (P-chain), and contract chain (C-chain). Each of the three chains has its functions, and they can be converted across chains, making it more convenient for users to take advantage of assets. The X-chain is responsible for the establishment and transferal of assets, and most users use this chain when transferring assets or trading assets. The P-chain is responsible for storing the data, information, and verification work on the chain. The C-chain is responsible for the functions of smart contracts. This chain is compatible with EVM, so it can be applied to most smart contracts. Thanks to its unique structure compared with traditional blockchain platforms, Avalanche has higher performance—it can achieve more than 4500tps—and is more scalable and secure.
6.4. Example
The following is an example of a money transfer contract to show the complete workflow of smart contract development, deployment, and execution. Suppose A wants to transfer money to B through a smart contract. The contract workflow is shown in Figure 8. First is development, where the business process of transferring money from A to B is written as smart-contract source code, and the source code is compiled into bytecode by a compiler. Next is deployment, where the compiled bytecode is deployed to the blockchain network via a single transaction. After consensus in the P2P network, the contract address is returned for contract invocation. Finally, when the deployed smart contract triggers an execution condition or is invoked to execute the contract transaction (e.g., deducting a specified amount from A’s account and adding a specified amount to B’s wallet), the result of the execution will be written to the block.
Mathematics 11 00101 g008 550Figure 8. Smart contract workflow.
In the process of transferring funds from A to B, the whole process is open and transparent without the intervention of a third party, and the results of the transaction execution are written to the blockchain and cannot be tampered with.
6.5. Discussion
The execution of smart contracts does not require the participation of a third party and can respond to user requests at any time, ensuring the fairness and efficiency of transactions. Before the contract is deployed, all the terms and execution processes have been formulated and executed under the computer’s absolute control, so there is no possibility of errors in the entire process. Once the contract is deployed, all content cannot be modified. If one party breaks the contract, it will be punished accordingly. Using smart contracts can save transaction fees charged by banks and service fees of intermediaries. In addition to the advantages mentioned above, smart contracts still have the following problems: security issues, as it is difficult for anyone to guarantee the complete correctness of the code, and errors cannot be modified; interface problems, as each blockchain has different forms of storage for digital assets; the issue of how to call smart contracts across blockchains to realize asset transfers remains to be researched.
7. Applications
From blockchain 1.0 to blockchain 3.0, blockchain technology has been flourishing. Blockchain technology has also been applied from the earliest cryptocurrency to a wider range of fields, such as cryptocurrency, healthcare, IoT, Security AI, and NFT. . The decentralized, open, and transparent characteristics of blockchain can also bring decentralized solution ideas to existing problems in some fields.
7.1. Cryptocurrency
Cryptocurrencies have been around since the 1990s but were not used and developed for various reasons until the emergence of Bitcoin made them widely known. Electronic cash (Ecash) emerged in 1990, changing the way traditional money works and allowing it to be traded digitally and anonymously over the Internet. In 1997, Back proposed the hashcash algorithm mechanism , which calculates a token through the CPU cost function and can be used as a proof of workload. In 1998, Dai proposed the electronic cryptocurrency system B-money, a distributed system that uses cryptography to control the currency for transactions, and first adopted the idea of decentralization to design cryptocurrency. In 2008, influenced by the global financial crisis, the international community began exploring innovative finance. Satoshi Nakamoto proposed Bitcoin in this context, which also marked the birth of Blockchain 1.0 technology. Satoshi Nakamoto combined a distributed system using cryptography from Ecash and B-money and a proof-of-work mechanism from Back and Finney to solve the trust and Byzantine problems. Bitcoin is a P2P form of digital currency. Unlike traditional currencies, Bitcoin does not have a central currency issuer, and the P2P network nodes work together to keep the system running. Bitcoin is also the most successfully used cryptocurrency to date.
Cryptocurrency is by far the most successful and well-known application of blockchain. Cryptocurrencies, represented by Bitcoin, were once synonymous with blockchain. It is foreseeable that even in the future when blockchains are widely used, cryptocurrencies will remain among of the most important blockchain applications.
7.2. Energy
Current energy trading methods are still dominated by traditional centralized trading, which suffers from inefficient trading, opaque trading information, and long settlement times; and distrustful and opaque energy markets have potential security and privacy issues. In addition, intermittent energy sources and microgrids are an important part of the energy supply, and the increasing amount of renewables in the energy system requires new market approaches to pricing and decentralized generation .
Compared to centralized generation and single -arket pricing strategies, using a decentralized blockchain to control generation and energy trading can better incentivize generation organizations, improve generation efficiency, and facilitate energy trading. Kang et al. proposed a localized P2P power trading system (PETCON) for local power trading among plug-in hybrid electric vehicles (PHEVs) based on consortium chain technology. In PETCON, electricity trading among PHEVs is resolved through an iterative double-auction mechanism that maximizes social welfare while protecting PHEVs’ privacy. Su et al. proposed a smart-contract-based energy blockchain system that enables secure charging services for electric vehicles by executing smart contracts. The experimental results show that the scheme has higher efficiency compared to other conventional schemes.
Blockchain technology will be applied more to decentralized energy management and energy trading in the future, and decentralized energy management systems can supplement the current centralized energy management system.
7.3. Healthcare
The current information systems of most medical institutions are centralized and stored independently, which makes it difficult to efficiently interconnect data among medical institutions and inconvenient for patients to seek medical treatment across institutions. Centralized information systems are also vulnerable to hacking and data leakage, compromising patients’ privacy.
Blockchain’s tamper-proof and verification features can ensure that patients’ private information is not leaked . Azaria et al. have built a decentralized record management system (MedRec) to handle electronic medical data using blockchain technology. The system provides a comprehensive, immutable patient log and is easily accessible. Using PoW incentives enables patients to participate as “miners” in maintaining the system’s security while allowing patients and providers to choose the release of metadata to facilitate medical research. healthbank, a Swiss global digital health startup, offers users a secure blockchain-based data management platform , where users can store and manage their health information data, and the sovereignty of the data is in the hands of the user. In addition, healthbank can act as a data trading platform where users can save data for medical research, and where users can receive specific financial compensation for the data they provide. hirtan et al. implemented a medical data-sharing system using Hyperledger Fabric, which can share important information about medical analytics among hospitals, medical clinics, and research institutions based on patient-defined access policies. The system uses a combination of public and private chains to protect user privacy. The private chain stores the user’s accurate ID information, and the public chain stores patient health information labeled with temporary IDs.
In summary, the use of blockchain to build a decentralized medical data management platform enables the sharing of medical data to facilitate medical research while ensuring the privacy and security of the data.
7.4. Internet of Things
IoT devices are found in various scenarios, such as cities, buildings, and homes. IoT combines various information sensing devices with networks to form a huge network to achieve interconnection of people, machines, and things at any time and place, allowing traditional devices to become intelligent and autonomous . However, the IoT still has issues such as security and privacy that hinder its widespread use.
A blockchain can establish decentralized trust in a distributed environment , which helps to overcome the security issues and privacy problems of IoT. Alphand et al. combined an object-based IoT security architecture and an ACE authorization framework. Their solution uses a blockchain to replace a single ACE authorization server. It enables smart contracts, handles authorization requests, and uses a self-healing key distribution scheme to achieve efficient management of the IoT. Li et al. proposed a multilayer, secure IoT network model based on blockchain technology, providing a wide-area network solution for the IoT. The model reduces the difficulty of blockchain deployment by dividing the IoT into a multi-layered decentralized network while ensuring the high security and trustworthiness of the blockchain. Pinno et al. proposed a blockchain-based IoT access authorization architecture that ensures the privacy and confidentiality of information collected by IoT devices. The architecture is compatible with many access control models used in the IoT today.
In summary, more and more blockchain technologies are being applied to the Internet of Things (IoT) to solve the privacy and security problems in the IoT. However, a blockchain consumes many resources, and IoT devices generally have little computing power and storage space, so the traditional blockchain is not directly applicable to the IoT.
7.5. Security AI
Thanks to the development of computing power brought about by cloud computing and the generation of many samples in the era of big data, artificial intelligence technology, represented by machine learning, has been developed and used increasingly. However, studies have shown that machine learning models are vulnerable to attacks that lead to privacy leaks, posing privacy and security risks.
Blockchain’s data are highly redundant and decentralized, which is ideal for storing and protecting important privacy data from data loss or privacy leakage caused by attacks or mismanagement of centralized institutions. In recent years, various scholars have researched how blockchain can be applied to AI privacy protection. Zyskind et al. implemented a decentralized personal data management system based on blockchain technology to ensure that users own and control their data. Additionally, they implemented a protocol that turns the blockchain into an automated access control manager that does not require a third party. Chen et al. proposed LearningChain, a decentralized machine learning system for privacy protection and security, and designed a distributed stochastic gradient descent (SGD) algorithm to learn general prediction models. Decentralized SGD uses a differential privacy-based scheme to protect the data privacy of each party. Qi et al. proposed a federated learning framework based on the consortium chains which can achieve secure and reliable federated learning without the need for a central model server. The federated learning framework can effectively protect model data privacy and prevent data poisoning attacks due to the noise-added differential privacy mechanism.
The blockchain can be regarded as a decentralized trusted database, replacing the centralized server to realize the data storage function required for machine learning and avoid privacy and security attacks on the central server.
7.6. Nft
A Non-Fungible Token (NFT) is a token issued according to the Ethereum ERC721 and ERC1155 standards. It has indivisible, irreplaceable, and unique characteristics. Through NFTs, all tokenized properties can be freely traded with customized values based on age, rarity, liquidity, etc. NFT is mainly used for games, artworks, domain names, collectibles, virtual assets, real assets tokenization, and other fields, especially artwork and games that have received great attention in the market. NFT has greatly stimulated the prosperity of the decentralized application market. According to data from the cryptoslam website, as of August 2022, the cumulative transaction volume of NFT has reached $39,245,668,068. Wang et al. conducted systematic research on NFTs for the first time, pointing out that the development of the NFT ecosystem is at an early stage, and related technologies need to be further developed.
7.7. Web 3.0
Web 3.0 is generally considered the next generation of the Internet, a decentralized Internet running on blockchain technology. In this environment, users do not have to create multiple identities on different centralized platforms but can create a decentralized universal digital identity system that can pass through various platforms. The most prominent feature of Web 3.0 is that it can not only realize the exchange of data but also realize the circulation of value . Web 1.0 data are read-only, such as Yahoo and MSN data. Web 2.0 data are read–write interactive, such as Facebook and Twitter data. Web 3.0 data are read–write interactive and owned and controlled by the creator; representative applications include Bitcoin, Ethereum, IPFS, etc. Web 3.0 is a new network infrastructure that integrates the traditional Internet, blockchain, programmable economy, etc. It is currently experiencing a blockchain, and its final architecture is uncertain, but the booming trend is unavoidable.