Getting Started with ink! v6

This guide will walk you through getting started with ink! v6.

Pop CLI introduces experimental support for ink! v6 smart contracts running on PolkaVM (RISC-V) via pallet-revive. This guide helps you transition from ink! v5 (WebAssembly) and start experimenting with ink! v6.

What's new in ink! v6?

  • ink! v5: Version of the ink! that can be compiled into WebAssembly byte code and can be executed on pallet-contracts virtual machine.

  • ink! v6: Version of ink! that can be compiled into RISC-V byte code and can be executed on PolkaVM (pallet-revive).

For more information about the benefits of RISC-V and pallet-revive, see RISC-V + pallet-revive.

Installing Pop CLI for ink! v6 support

Pop CLI supports ink! v6 through the polkavm-contracts feature flag.

To install it from the experimental branch, run:

cargo install pop-cli --no-default-features --locked -F polkavm-contracts,parachain,telemetry

⚠️ Note: Make sure you're using Rust 1.85 or higher, older versions will fail to compile. You can check your version with rustc --version.

Getting started with ink! v6

The workflow for developing smart contracts remains similar to ink! v5. To get started, see our guide: Create a new contract.

Migrating existing ink! smart contracts

If you already have an ink! smart contract, update your dependencies as follows: Update your Cargo.toml

[dependencies]
ink = { version = "6.0.0-alpha", default-features = false }

[dev-dependencies]
ink_e2e = { version = "6.0.0-alpha" }

For a complete example, check the ink! flipper example.

Account Mapping

pallet_revive enables the deployment and execution of PolkaVM smart contracts. It introduces support for 20-byte accounts (like EVM), while most Polkadot-based chains use 32-byte accounts (AccountId32). To ensure compatibility, pallet_revive provides a mapping feature that lets 32-byte accounts seamlessly interact with the VM.

When first interacting with pallet_revive, you must map your Polkadot account ID (32 bytes) to an Ethereum-compatible 20-byte address. This registration enables your account to interact with contracts.

Pop CLI will prompt you automatically:

Map Account Pop CLI

Alternatively, you can interact on Polkadot JS Apps:

Map Account Polkadot UI

For further information about account mapping, including native EVM contract integration with Asset Hub, see Native EVM Contracts.

Resources

Learning Resources

Technical Support

Last updated

Was this helpful?