What is ink!?
ink! is a programming language for writing smart contracts that combines the power and safety of Rust with blockchain development.
Here's what makes ink! special:
Built on Rust: ink! takes the popular Rust programming language and adds everything you need for smart contract development. You get all of Rust's safety features like memory safety and type safety, plus access to the vast Rust ecosystem.
Smart Contract Ready: While ink! uses Rust as its foundation, it's specifically designed for smart contracts. This means:
- Special annotations and macros are provided for smart contract needs
- Built-in support for storage, events, and contract interactions
Simple but Powerful: ink! uses special #[ink(...)]
attribute macros to turn your Rust code into smart contracts. These macros tell ink! what different parts of your code represent; like storage, functions that can be called, or events that can be emitted.
Compile to RISC-V: Your ink! contracts compile to RISC-V bytecode that runs efficiently on blockchains, giving you both performance and compatibility.
What can you do with it?
ink! opens up a world of possibilities for blockchain development across the Polkadot ecosystem:
Build Smart Contracts for Polkadot Blockchains
With ink!, you can write smart contracts that run on any blockchain built with the Polkadot SDK that includes the pallet-revive
module. This includes many parachains and standalone chains in the Polkadot ecosystem.
-
DeFi Applications: Build decentralized exchanges, lending protocols, and other financial applications
-
NFT Platforms: Create marketplaces, games, and digital collectible platforms
-
Cross-Chain Applications: Take advantage of Polkadot's interoperability to build applications that work across multiple blockchains
-
Utility Contracts: From simple storage contracts to complex business logic, ink! can handle it all
Flexible Development Paths
ink! provides different approaches depending on your needs:
- Prototype Quickly: Start with a smart contract to test your idea and get user feedback
- Enhanced Chain Features: Use precompiles to access special blockchain functionality beyond basic smart contracts
- Scale to Parachains: Later migrate successful contracts to dedicated parachains for better performance and lower costs
Composability
One of ink!'s unique advantages is its compatibility with Solidity. This means:
- Solidity developers can call ink! contracts seamlessly
- You can use existing Ethereum tools and frameworks
- Easy migration between different blockchain ecosystems
Want to learn more about ink!'s relationship with the Polkadot ecosystem and its various use cases? Check out our detailed guide on Polkadot SDK and ink!.
Ready to get started? Head to our Getting Started guide to begin building your first ink! smart contract.