Add Smart Contract Functionality¶
Introduction¶
When you build a blockchain with the Polkadot SDK, you can add smart contract support by including a smart contract pallet in your runtime. Users can then deploy and call contracts on your chain, and developers can build decentralized applications (dApps) on it with familiar tooling.
The Polkadot SDK smart contract pallet is pallet-revive. This page explains what pallet-revive provides, the components you add to your chain, and where to find reference runtimes that configure it.
What pallet-revive Provides¶
pallet-revive is the runtime module that executes smart contracts. Because it lives in the runtime rather than in the node binary, your chain gains Ethereum compatibility without changes to its node client.
pallet-revive runs contracts on two execution backends:
- REVM: Executes standard EVM bytecode compiled with
solc, so existing Solidity contracts can be deployed unchanged. - PVM: Executes contracts compiled to PolkaVM bytecode with
resolc, based on the RISC-V instruction set.
| Language | Compiler | Output Bytecode | Execution Backend |
|---|---|---|---|
| Solidity | resolc | PVM | PVM |
| Solidity | solc | EVM | REVM |
Any language that can compile to PVM bytecode and use the pallet-revive host functions (through pallet-revive-uapi) can target the PVM backend.
Both backends share the same account model, gas model, and precompiles. For a full description of the execution model, see the Smart Contracts Overview.
Components to Add¶
Adding smart contract support involves two components:
- Runtime pallet: Add
pallet-reviveto your runtime and implement itsConfigtrait. The configuration sets values such as storage deposits, the chain ID reported to Ethereum tools, whether EVM bytecode is allowed, which origins can upload and instantiate contracts, and which precompiles are available. - Ethereum JSON-RPC adapter: Run the
pallet-revive-eth-rpcserver (theeth-rpcbinary) next to your node. It translates Ethereum JSON-RPC requests into Polkadot SDK transactions so that Ethereum wallets and tools such as Hardhat can interact with your chain.
To try pallet-revive and the adapter locally before integrating them into your own runtime, follow the Local Development Node guide.
Reference Implementations¶
The Polkadot SDK repository includes runtimes that configure pallet-revive, which you can use as a starting point for your own Config implementation:
- Asset Hub Westend runtime: See the
pallet_revive::Configimplementation for a parachain configuration that exposes asset, XCM, and asset conversion precompiles. - Kitchensink runtime: See the
pallet_revive::Configimplementation in the Substrate node runtime used by the kitchensink node.
Note
Line ranges refer to the Polkadot SDK version polkadot-stable2609-1. If the links point to the wrong lines in a later version, search the file for impl pallet_revive::Config for Runtime.
Other Smart Contract Pallets¶
pallet-contracts is the earlier Wasm-based smart contract pallet and is considered legacy, as development has moved to pallet-revive.
Frontier, maintained by the polkadot-evm project, is an alternative Ethereum compatibility layer for Polkadot SDK chains built around pallet-evm and pallet-ethereum.
Where to Go Next¶
-
Guide Add pallet-revive to Your Runtime
Follow step-by-step instructions to add
pallet-reviveand its runtime APIs to your runtime. -
Guide Add a Pallet to the Runtime
Learn the step-by-step process for integrating Polkadot SDK pallets into your blockchain's runtime.
-
Tutorial Local Development Node
Run a local node with
pallet-reviveand the Ethereum JSON-RPC adapter for smart contract development.
| Created: November 17, 2026