olkadot is one of the innovative blockchains in the Web3 ecosystem. It uses parachains to reduce the load on the mainnet.
Although Polkadot is built natively with the Rust programming language, it does not support Solidity by default. This limitation prevents Solidity-based developers from relying on it.
To solve this problem, several steps and tools were built. An example is the Solang protocol which was describe during the Sub0 2023 event.
Cyrill LeutwilerRust Core Compiler Engineer at Parity Technologies, explained the fundamental differences between Ethereum and Polkadot in terms of smart contracts.
Polkadot, often referred to as a “layer 0” blockchain, does not natively support smart contracts on its relay chain.
Instead, it relies on parachains, such as Ethereum-compatible parachains, to manage smart contracts. This architecture opens up exciting possibilities but also presents unique challenges for developers.
He presented Solang, a Solidity compiler serving as a vital bridge between Ethereum’s Solidity palette and Polkadot’s contract palette for the public. The speaker said Solang is a versatile compiler designed to support multiple blockchain platforms, making it a valuable tool for developers looking to deploy Solidity-based contracts on Polkadot.
To deploy solidity contracts on Polkadot using Solang, developers must first install the Solang compiler. This can be done either from Brew, by downloading binaries, using ghcr.io/hyperledger/solang containers, building Solang using Dockerfile, or building Solang from source.
The next step is to write smart contracts in Solidity, after which the smart contract is compiled using Solang.
Solang is designed to be easy to use, with a simple command line interface and focused on the developer experience.
It is also designed to be fast and efficient, with optimizations to reduce the size of compiled contracts by up to 90%.
Once smart contracts are compiled, developers can deploy them to Polkadot parachains using the Contract Palette.
The Contract Palette is a built-in module in Substrate that allows developers to deploy and interact with smart contracts on Polkadot.
Benefits of Solang
The speaker also noted that one of the benefits of Solang is that it allows developers to write contracts in languages other than Solidity, such as Rust or AssemblyScript, thereby expanding the developer ecosystem on Polkadot.
He added that Solang not only simplifies contract deployment but also makes it easier to deploy production-ready contracts.
Attendees also learned how projects like Nabla Finance have successfully used Solang to deploy their contracts on Polkadot, bridging the gap between Solidity and this innovative blockchain ecosystem.
He reminded developers that while Solang simplifies the cross-chain deployment process, they must account for differences in address formats, balance types, and function calls between native Ethereum and Polkadot contracts.
Looking to the future
During the presentation, the speaker outlined Solang’s future plans, encompassing security audits, Ethereum API support, and compatibility improvements.
He also discussed the possibility of Solang working with RISC-V contracts, potentially paving the way for broader compatibility across multiple blockchains.
The presentation revealed that with the right tools and knowledge, developers can seamlessly integrate Ethereum’s Solidity contracts into the Polkadot ecosystem.
Solang’s role as Solidity compiler for Polkadot’s contract palette opens up exciting possibilities for the development of cross-chain smart contracts.
As more projects adopt this technology, Cyrill said the industry can expect to see a more interconnected and versatile blockchain landscape in the future.