Moving from Ethereum to Solana
I was interested in what it would take to migrate smart contracts rom Ethereum to Solana. Here are my findings.
Introduction
Solana Blockchain is a blockchain network focusing on speed of transactions and it currently has very low transaction fees. It is developed by Solana Labs.
Solana blockchain
In other blockchains, the protocol allows for a long enough block time (it can be 10 minutes for Bitcoin) to allow for all nodes to be in sync globally. This is one of the key bottlenecks for the number of transactions per second in existing blockchains. Solana has a protocol to synchronise clocks for each node. This allows for faster block time and therefore increased throughput to up to 65 000 transactions (2500 currently) per second in theory.
The network implements a classic dPOS consensus mechanism then, to validate blocks. It uses the SOL token to compensate node validators.
Solana network also can execute multiple programs in parallel by having some reentrancy protections. This speeds up throughput compared to other blockchains.
Bridges
The most popular bridge between Solana and Ethereum is Wormhole. Wormhole is a decentralised cross chain bridging protocol. A bespoke bridge can also be implemented.
Any standard tokens can be registered to the bridge without coding: https://docs.wormholenetwork.com/wormhole/tutorial-token-register. This assumes that token contracts have been deployed on Solana and on Ethereum.
Oracles
Chainlink is being integrated into Solana. The same data sources can be reused there.
Currently Solana is not live on Chainlink: https://data.chain.link/
Staking
Solana requires validators to execute and validate transactions. Validators get compensated in SOL by clients running transactions on the network. More info here https://docs.solana.com/running-validator and here https://docs.solana.com/validator/anatomy
DEFI ecosystem
The Solana Ecosystem has seen explosive growth. In terms of DEFI, There has been 15 B$ TVL (total value locked) on Solana and in particular, 2.8B$ USDC has been issued.
Stats and Explorers
Smart Contracts on Solana
The development of smart contracts on Solana works in a similar way to other smart contract chains. They call smart contract programs. It is well documented here https://docs.solana.com/developing/programming-model/overview. Smart contracts are called Programs in Solana and they are written in Rust language. Programs are executed as part of transactions submitted to the chain. The key difference with Ethereum is that state costs money to maintain. Accounts can hold data and account owners need to pay rent to maintain that state. However if 2 years worth of rent is deposited into an account it is exempt from rent. Accounts that execute programs need to be exempt from rent.
EVM Compatible Smart Contracts on Solana
Neon EVM by Neon Labs allows the execution of EVM compatible code directly on Solana. It does with performance limitations — contracts can’t be executed in parallel like native Solana programs. Neon EVM is implemented as a Solana program and runs inside Solana. To use Neon EVM, the client needs to use a Neon Web 3 proxy. Metamask can be configured to use a public Neon proxy: https://docs.neon-labs.org/docs/devportal/metamask_setup.
Here is an example of truffle configuration to deploy to Solana: https://docs.neon-labs.org/docs/devportal/using_truffle.
Neon EVM is expected to go live in November 2021.
Other services needed by DApps
Chainlink Oracle Network: Chainlink is actively working in integrating Solana network.
The Graph: The Graph is an indexing protocol for querying networks like Ethereum and IPFS. The Graph is adding support for Solana: https://thegraph.com/blog/multiblockchain-support
Conclusion
Solana Network has seen a lot of interest in 2021 due to its performance features and many projects are migrating to it. All popular protocols are now considering cross-chain strategies. Solana is not EVM compatible. However Neon Labs has built an Ethereum VM deployed on Solana that can be used to execute Ethereum compatible smart contracts. This can be a valid option to start using Solana before considering Solana native implementations.
References
https://defillama.com/chain/Solana
https://www.gemini.com/cryptopedia/solana-blockchain
https://paulx.dev/blog/2021/01/14/programming-on-solana-an-introduction/
https://cryptobriefing.com/solana-has-introduced-ethereum-bridge-called-wormhole/
https://docs.wormholenetwork.com/wormhole/