Solana smart contract network
Solana emerged as an open-source solution free from Ethereum’s bottlenecks. It is one of the fastest growing ecosystems for Dapps, despite some run-ins with bots and outages. Aside from its speed, the Solana network boasts negligible transaction fees. Here is an in-depth overview of this ecosystem for smart contracts.
History of Solana blockchain
The Solana blockchain was proposed in 2017, and it went live in 2020. Its mastermind Anatoly Yakovenko (now Solana Lab’s CEO) joined forces with Raj Gokal, who became the company’s Chief Operations Officer. Leveraging his experience in system design, Yakovenko spearheaded a new blockchain paradigm with an emphasis on global adoption.
Speed as priority
Yakovenko is credited with inventing Proof-of-History (PoH), the timekeeping technique powering Solana. It speeds up the process of reaching consensus on transaction orders. We’ll delve deeper into this and other innovative features below.
Ethereum, until its 2.0 update is rolled out, will still handle 15 TPS on average. To put this into perspective, both Visa and Mastercards can process around 65,000 TPS. This figure matches the theoretical peak capacity of Solana.
Today, Yakovenko’s brainchild claims to be the world’s fastest blockchain. On a standard gigabit network, it can process up to 710,000 of 176-byte transactions per second.
Benefits of Solana vs. Ethereum
The Solana smart contract system is highly competitive compared to the veteran. Here are the biggest strengths in 2022:
- Higher speed and efficiency. The Solana nodes do not have to communicate with each other in real time. While it takes Ethereum 10-15 seconds to mine a block, Solana needs 400 milliseconds.
- Less bandwidth required. Data within the Solana network is broken down into smaller packets to facilitate the transfer.
- Enhanced scalability. Solana developers do not need layer 2 solutions to scale the network core.
- PoH. Solana creates a timestamp for every transaction. It uses a cryptographically secure function as a historical record. This solves the problem of agreement on time, which is typical for distributed ecosystems.
- Lower costs. Fees on the Solana blockchain average $0.00025 per transaction, and they have stayed approximately the same since October 2021. On Ethereum, the gas fees can soar to 10% of the transaction value. They also fluctuate dramatically – from a few cents for an ordinary transaction to $250 for an NFT purchase.
Architecture and technologies of Solana
Now, let’s explore the inner workings of this blockchain. According to its founders, the Solana smart contract network rests on eight innovative technologies. From PoH to Sealevel, here are the top six.
As blockchains are decentralized by definition, they do not have a central source of time. Ethereum and many other ecosystems trust external programs to produce a “median” timestamp. Meanwhile, validation follows the order in which transactions are received. This bonding contradicts the very philosophy of decentralization.
PoH makes the “timestamps” an organic part of the blockchain. This cryptographically safe source of time is used throughout the network, so validation is faster. Nodes trust the timestamps on the circulating messages, and the consensus overhead drops.
Nodes work faster as they do not constantly have to align themselves with the network. Solana offers superior speed even despite the computational steps for timestamp assigning.
PoH appends the hash of the data of the previous states. Solana also uses the verifiable delay function (VDF). It allows pinpointing the exact moment in the lifetime of the global state machine when a transaction occurred.
This consensus mechanism is an integral part of Solana’s hybrid consensus model. It reduces confirmation times through lower communication overhead and latency. The passage of time is encoded in SHA-256 using a verifiable delay function (VDF).
Every cluster comprises a number of computers, which are independently owned. They work with/against each other to verify the output of programs submitted by users. These clusters are used to create and maintain a record of events (or their programmatic interpretations) in proper order. This record, known as the ledger, is:
- lasting as long as the cluster itself
- accessible and reproducible, provided a copy of it is maintained anywhere in the world
If there is a ledger copy, the output of all its programs is reproducible. They can function regardless of the original creator. All transactions and accounts for various Solana clusters are accessible via Solana Explorer, aka Solana Devnet Explorer.
Gulfstream (transaction forwarding protocol)
Both Bitcoin and Ethereum use mempools. These are sets of transactions (typically up to 100,000) awaiting processing. Mempools shrink and expand based on the blockchain's supply and demand for space. Obviously, periods of expansion lead to processing bottlenecks.
What makes Solana different is that it does not need to boost throughput in order to manage a pool of 100,000. Even with the throughput of 50,000 TPS, it will be processed in seconds. This peculiarity, possible by the Gulfstream protocol, makes it the top performer among permissionless blockchains.
Solana uses a multiple transaction processing unit. It speeds up validation and replication, making subsecond confirmation possible. This model, borrowed from CPU design, separates stages into sequences of four, so every CPU finishes its task faster.
For many blockchains, scalability is problematic due to a trilemma. If the amount of bandwidth per node is fixed, adding more peers leads to delays. The system needs more time to propagate the data to them all.
Solana uses a block propagation protocol reminiscent of BitTorrent. It is optimized for streaming. The data is broken down into small packets, each transmitted to a different validator.
This is one of the most critical technologies for smart contract creators. Sealevel is a parallel smart contracts run-time. It enables digital agreements to run concurrently. As a result, multiple contracts are dispensed on the network in parallel.
Other innovative features
Benefits of Solana smart contract development
Smart contract developers choose Solana for a number of reasons. Aside from the superior speed, this environment offers:
- Affordable transaction costs thanks to PoH and Turbine. Smart contracts are a lighter burden for the network, which is great news for NFTs creators and sellers.
- Customization. Developers can tailor new smart contracts to their needs.
- Popular programming languages. Rust is popular with the global development community. Creators do not have to learn proprietary languages for smart contract code. Rust is suitable for marketplaces, games, and even new blockchains.
- Sustainable development. Solana does not use Proof-of-Work, unlike Bitcoin and Ethereum. Its agreement mechanism is 99.9% more energy-efficient.
Solana supports smart contracts in its own way
Unlike blockchains like Ethereum, where the heart of the system is the EVM, Solana offers different structural logic. The development of decentralized applications involves two dimensions – Program (creating and deploying smart contracts called programs) and Client (writing Dapps to communicate with these deployed programs).
This diagram shows this division in the build process. Find out about three key distinctions of Solana below.
On Solana, accounts store data like wallet information. On Ethereum, they only contain references to it.
Accounts vs. programs
Conventional systems do not separate accounts (state stored) from programs (contract logic). These elements are deployed on-chain together within one contract. Here is what happens on Solana:
- A smart contract (Solana program) includes only program logic – that is, it is stateless or read-only.
- After deployment, the contract becomes accessible for external accounts.
- The external accounts using Solana smart contracts keep all the data related to program interaction.
Program languages for decentralized applications
Like EOS, Solana does not have a proprietary programming language. Instead, users deploy smart contracts using Rust, C, and C++. They can do it via the Solana CLI (command line interface). Anyone with sufficient programming skills can use a deployed program via a Dapp. To create the latter and enhance interaction, they can employ:
- existing SDKs
- JSON RPC API
The Solana CLI supports multiple functions. Developers can create a wallet, transfer native tokens, and delegate their stakes for cluster participation. Check the official Solana CLI guide for more.
How to deploy Hello World Solana program
Programmers should use the Solana development environment as launching contracts on Windows is complicated. You can find simple instructions for deploying the Hello World program, a simple piece of code transferring output to the console and keeping track of calls. This procedure is beyond the scope of this guide, but we have outlined the main stages to show its relative simplicity:
- Setting up the Solana Development Environment
- Copying the source code for the Solana program
- Connecting to Solana Devnet
- Using Solana keygen (for demos only)
- Obtaining test tokens (using Solana airdrop)
- Deploying the contract
Solana can power a wide range of decentralized applications. Popular Dapps using its smart contract code fall into three main categories: decentralized finance, games, and marketplaces. As of this writing, the following products have the most users:
- Orca, a fast decentralized exchange with minimal transaction fees;
- Magic Eden, a prominent NFT marketplace;
- Gameta, an entrance to web 3 with games, tools, and learning resources;
- Raydium, an on-chain order book DeFi AMM (automatic market maker);
- MeanFi, a self-custody, permissionless, and trustless bank.
OpenSea, the biggest NFT marketplace, officially embraced collectibles minted on Solana in April 2022. In its announcement, the company praised the blockchain for its low fees, energy efficiency, and speed. OpenSea is an important addition to the 350+ Dapps successfully deployed on Solana.
SOL is currently the ninth cryptocurrency by market cap (almost $17.5 billion). Upon launch, the token traded for around $0.5. The all-time high of $259.96 was achieved on November 6, 2021. Since then, the cryptocurrency has lost over 80%, as it is now worth $51.45 (as of May 22, 2022).
The SOL tokens have several use cases:
- Within the network, Solana facilitates staking for rewards. The latter are weighted – that is, proportional to the number of tokens staked compared to the total token supply.
- The tokens cover the costs associated with running Solana programs (smart contracts) and other transactions.
- For security reasons, Solana spreads a fixed amount of rewards across the weighted validator set. These rewards are adjusted according to the inflation rate, which was initially set at 8%. It is expected to decrease by 15% annually until it drops to 1.5%.
Imperfections of Solana
Despite its status as one of the most performant blockchains, Solana has not had smooth sailing. Outages and suspicions of centralization have dented its reputation. Here are the biggest causes for concern.
Solana mainnet failures
On April 30, 2022, block production was interrupted for seven hours. As the team explained, heavy traffic caused consensus to stall. The validators ran out of memory and crashed due to “an enormous amount of inbound transactions (6 million per second)”. The incident was blamed on bots that attempted to win a new NFT.
The previous outage of this kind happened in September 2021. Not only was it longer (17 hours). Although the transaction request volumes were much lower, the network stopped functioning. The positive effect of the updates by the validator community is obvious.
Security is another prominent concern. In December 2021, the network suffered a serious DDoS interference, which caused its token to plunge. Such attacks aim to make a blockchain unusable by driving an insurmountable amount of traffic.
These risks have been mentioned by institutional investors like Grayscale, a major digital currency asset manager. Its December 2021 report highlighted cryptography imperfections that could make Solana vulnerable to such attacks.
Token distribution concerns
Some crypto experts note that Solana does not fully fit the definition of a decentralized network. According to the Messari report published on May 17th, 2021, almost half of all native tokens are held by three insiders:
- Venture Capital
- Solana developers
- Solana Labs
This model makes neutrality doubtful. In comparison, Ethereum allocated just 15% of ETH to insiders (the team, company, and VC). Cardano provided 17%, while EOS allocated just 10%.
Solana has fewer validators than Ethereum – 1,447 nodes against 2,471. While this makes it faster, there is also less decentralization by default.
What’s more, the team is only planning to implement slashing. This mechanism, which is available on Ethereum, prevents validators from breaking the rules. It removes a portion of the stake when malicious behavior is detected.
Conclusion: Solana as smart contract network
Solana is a highly efficient and sustainable environment built on innovative technologies. It offers multiple benefits to creators of smart contracts, Dapps, and NFTs. It supports smart contracts without the EVM, allowing developers to use popular languages, Solana CLI, and existing SDKs to deploy impressive DeFi exchanges, games, and more.
On the downside, as a relatively young network, Solana has suffered a number of outages in the recent past. Its structure makes some skeptics wonder if centralization is at risk. Nevertheless, these caveats have not stopped the network’s dramatic growth, which is still evolving.