Skip to content

Commit c20344b

Browse files
authored
Smart Contracts Overview (#1283)
* change scope * llms * rev * rev
1 parent 6aeffdc commit c20344b

File tree

13 files changed

+415
-543
lines changed

13 files changed

+415
-543
lines changed

.ai/categories/basics.md

Lines changed: 39 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2224,61 +2224,41 @@ Page Title: Smart Contracts Overview
22242224
22252225
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-overview.md
22262226
- Canonical (HTML): https://docs.polkadot.com/smart-contracts/overview/
2227-
- Summary: Learn about smart contract development capabilities in the Polkadot ecosystem, either by leveraging Polkadot Hub or other alternatives.
2227+
- Summary: Learn about smart contract development on Polkadot Hub with native PolkaVM support, dual-VM execution, and seamless cross-chain capabilities.
22282228
2229-
# Smart Contracts on Polkadot
2229+
# Smart Contracts on Polkadot Hub
22302230
22312231
## Introduction
22322232
2233-
Polkadot offers developers multiple approaches to building and deploying smart contracts within its ecosystem. As a multi-chain network designed for interoperability, Polkadot provides various environments optimized for different developer preferences and application requirements. From native smart contract support on Polkadot Hub to specialized parachain environments, developers can choose the platform that best suits their technical needs while benefiting from Polkadot's shared security model and cross-chain messaging capabilities.
2233+
Polkadot Hub provides a production-ready smart contract platform that combines Ethereum compatibility with the performance and cross-chain capabilities of the Polkadot ecosystem. Developers can deploy smart contracts directly on Polkadot Hub while using familiar Ethereum tooling, workflows, and programming languages.
22342234
2235-
Whether you're looking for Ethereum compatibility through EVM-based parachains like [Moonbeam](https://docs.moonbeam.network/){target=\_blank}, [Astar](https://docs.astar.network/){target=\_blank}, and [Acala](https://evmdocs.acala.network/){target=\_blank} or prefer PolkaVM-based development with [ink!](https://use.ink/docs/v6/){target=\_blank}, the Polkadot ecosystem accommodates a range of diverse developers.
2235+
Built with a dual-VM approach, Polkadot Hub offers two execution backends: REVM for unmodified EVM compatibility and native PolkaVM for optimized computationally expensive workloads. This dual-VM architecture enables developers to migrate existing Ethereum contracts instantly or optimize for speed and efficiency with native execution.
22362236
2237-
These guides explore the diverse smart contract options available in the Polkadot ecosystem, helping developers understand the unique advantages of each approach and make informed decisions about where to deploy their decentralized applications.
2237+
## Why Build on Polkadot Hub
22382238
2239-
## Native Smart Contracts
2239+
### Ethereum Compatibility
22402240
2241-
### Introduction
2241+
Deploy existing Ethereum contracts with zero modifications while maintaining full compatibility with your existing development stack:
22422242
2243-
Polkadot Hub enables smart contract deployment and execution through PolkaVM, a cutting-edge virtual machine designed specifically for the Polkadot ecosystem. This native integration allows developers to deploy smart contracts directly on Polkadot's system chain while maintaining compatibility with Ethereum development tools and workflows.
2243+
- **Complete JSON-RPC API support**: Use MetaMask, Hardhat, Remix, Foundry, and all standard Ethereum tooling.
2244+
- **Standard libraries**: Integrate Ethers.js, Web3.js, Viem, Wagmi, and Web3.py without changes.
2245+
- **Solidity development**: Write contracts in Solidity or migrate existing code directly.
2246+
- **Familiar workflows**: Maintain your existing deployment, testing, and monitoring processes.
22442247
2245-
### Smart Contract Development
2248+
### Performance Options
22462249
2247-
The smart contract platform on Polkadot Hub combines _Polkadot's robust security and scalability_ with the extensive Ethereum development ecosystem. Developers can utilize familiar Ethereum libraries for contract interactions and leverage industry-standard development environments for writing and testing smart contracts.
2250+
Choose between two execution backends:
22482251
2249-
Polkadot Hub provides _full Ethereum JSON-RPC API compatibility_, ensuring seamless integration with existing development tools and services. This compatibility enables developers to maintain their preferred workflows while building on Polkadot's native infrastructure.
2252+
- **REVM**: Run unmodified Ethereum contracts with full EVM/Ethereum compatibility.
2253+
- **PolkaVM**: Compile to optimized RISC-V bytecode for enhanced performance and lower fees while keeping Ethereum-compatibility.
22502254
2251-
### Technical Architecture
2255+
Both backends share the same RPC interface and tooling support, allowing seamless transitions. In addition, smart contracts can interact with Polkadot native services via [precompile contracts](/smart-contracts/precompiles/){target=\_blank}.
22522256
2253-
PolkaVM, the underlying virtual machine, utilizes a RISC-V-based register architecture _optimized for the Polkadot ecosystem_. This design choice offers several advantages:
2257+
### Cross-VM & Cross-Chain Capabilities
22542258
2255-
- Enhanced performance for smart contract execution.
2256-
- Improved gas efficiency for complex operations.
2257-
- Native compatibility with Polkadot's runtime environment.
2258-
- Optimized storage and state management.
2259+
Smart contracts written for one VM (for example, EVM) can interact directly with other smart contracts written for the RISC-V PolkaVM, and back. This allows to use full EVM compatible contracts but extend to heavy/complex execution workloads to the PolkaVM RISC-V backend.
22592260
2260-
### Development Tools and Resources
2261-
2262-
Polkadot Hub supports a comprehensive suite of development tools familiar to Ethereum developers. The platform integrates with popular development frameworks, testing environments, and deployment tools. Key features include:
2263-
2264-
- Contract development in Solidity or Rust.
2265-
- Support for standard Ethereum development libraries.
2266-
- Integration with widely used development environments.
2267-
- Access to blockchain explorers and indexing solutions.
2268-
- Compatibility with contract monitoring and management tools.
2269-
2270-
### Cross-Chain Capabilities
2271-
2272-
Smart contracts deployed on Polkadot Hub can leverage Polkadot's [cross-consensus messaging (XCM) protocol](/parachains/interoperability/get-started/){target=\_blank} protocol to seamlessly _transfer tokens and call functions on other blockchain networks_ within the Polkadot ecosystem, all without complex bridging infrastructure or third-party solutions.
2273-
2274-
### Use Cases
2275-
2276-
Polkadot Hub's smart contract platform is suitable for a wide range of applications:
2277-
2278-
- DeFi protocols leveraging _cross-chain capabilities_.
2279-
- NFT platforms utilizing Polkadot's native token standards.
2280-
- Governance systems integrated with Polkadot's democracy mechanisms.
2281-
- Cross-chain bridges and asset management solutions.
2261+
Furthermore, all smart contracts in Polkadot Hub can interact with any service in the Polkadot ecosystem through [XCM](/smart-contracts/precompiles/xcm/){target=\_blank}, enabling token transfers, remote execution, and cross-chain composability without bridges or intermediaries.
22822262
22832263
## Other Smart Contract Environments
22842264
@@ -2288,32 +2268,41 @@ Beyond Polkadot Hub's native PolkaVM support, the ecosystem offers two main alte
22882268
22892269
- **Rust (ink!)**: ink! is a Rust-based framework that can compile to PolkaVM. It uses [`#[ink(...)]`](https://use.ink/docs/v6/macros-attributes/){target=\_blank} attribute macros to create Polkadot SDK-compatible PolkaVM bytecode, offering strong memory safety from Rust, an advanced type system, high-performance PolkaVM execution, and platform independence with sandboxed security.
22902270
2271+
## Next Steps
2272+
2273+
<div class="grid cards" markdown>
22912274
2292-
Each environment provides unique advantages based on developer preferences and application requirements.
2275+
- <span class="badge guide">Guide</span> __Get Started__
22932276
2294-
## Where to Go Next
2277+
---
22952278
2296-
Developers can use their existing Ethereum development tools and connect to Polkadot Hub's RPC endpoints. The platform's Ethereum compatibility layer ensures a smooth transition for teams already building on Ethereum-compatible chains.
2279+
Quick-start guides for connecting, deploying, and building your first smart contract.
22972280
2298-
Subsequent sections of this guide provide detailed information about specific development tools, advanced features, and best practices for building on Polkadot Hub.
2281+
[:octicons-arrow-right-24: Get Started](/smart-contracts/get-started/)
22992282
2300-
<div class="grid cards" markdown>
2283+
- <span class="badge guide">Guide</span> __Cookbook__
2284+
2285+
---
2286+
2287+
Step-by-step tutorials for deploying contracts, tokens, NFTs, and full dApps.
2288+
2289+
[:octicons-arrow-right-24: View Tutorials](/smart-contracts/cookbook/)
23012290
2302-
- <span class="badge guide">Guide</span> __Libraries__
2291+
- <span class="badge guide">Guide</span> __Ethereum Developers__
23032292
23042293
---
23052294
2306-
Explore essential libraries to optimize smart contract development and interaction.
2295+
Understand key differences in accounts, fees, gas model, and deployment on Polkadot Hub.
23072296
2308-
[:octicons-arrow-right-24: Reference](/smart-contracts/libraries/ethers-js/)
2297+
[:octicons-arrow-right-24: Learn More](/smart-contracts/for-eth-devs/accounts/)
23092298
2310-
- <span class="badge guide">Guide</span> __Dev Environments__
2299+
- <span class="badge guide">Guide</span> __Precompiles__
23112300
23122301
---
23132302
2314-
Set up your development environment for seamless contract deployment and testing.
2303+
Discover advanced functionalities including XCM for cross-chain interactions.
23152304
2316-
[:octicons-arrow-right-24: Reference](/smart-contracts/dev-environments/local-dev-node/)
2305+
[:octicons-arrow-right-24: Explore Precompiles](/smart-contracts/precompiles/)
23172306
23182307
</div>
23192308

.ai/categories/dapps.md

Lines changed: 39 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -3405,61 +3405,41 @@ Page Title: Smart Contracts Overview
34053405
34063406
- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-overview.md
34073407
- Canonical (HTML): https://docs.polkadot.com/smart-contracts/overview/
3408-
- Summary: Learn about smart contract development capabilities in the Polkadot ecosystem, either by leveraging Polkadot Hub or other alternatives.
3408+
- Summary: Learn about smart contract development on Polkadot Hub with native PolkaVM support, dual-VM execution, and seamless cross-chain capabilities.
34093409
3410-
# Smart Contracts on Polkadot
3410+
# Smart Contracts on Polkadot Hub
34113411
34123412
## Introduction
34133413
3414-
Polkadot offers developers multiple approaches to building and deploying smart contracts within its ecosystem. As a multi-chain network designed for interoperability, Polkadot provides various environments optimized for different developer preferences and application requirements. From native smart contract support on Polkadot Hub to specialized parachain environments, developers can choose the platform that best suits their technical needs while benefiting from Polkadot's shared security model and cross-chain messaging capabilities.
3414+
Polkadot Hub provides a production-ready smart contract platform that combines Ethereum compatibility with the performance and cross-chain capabilities of the Polkadot ecosystem. Developers can deploy smart contracts directly on Polkadot Hub while using familiar Ethereum tooling, workflows, and programming languages.
34153415
3416-
Whether you're looking for Ethereum compatibility through EVM-based parachains like [Moonbeam](https://docs.moonbeam.network/){target=\_blank}, [Astar](https://docs.astar.network/){target=\_blank}, and [Acala](https://evmdocs.acala.network/){target=\_blank} or prefer PolkaVM-based development with [ink!](https://use.ink/docs/v6/){target=\_blank}, the Polkadot ecosystem accommodates a range of diverse developers.
3416+
Built with a dual-VM approach, Polkadot Hub offers two execution backends: REVM for unmodified EVM compatibility and native PolkaVM for optimized computationally expensive workloads. This dual-VM architecture enables developers to migrate existing Ethereum contracts instantly or optimize for speed and efficiency with native execution.
34173417
3418-
These guides explore the diverse smart contract options available in the Polkadot ecosystem, helping developers understand the unique advantages of each approach and make informed decisions about where to deploy their decentralized applications.
3418+
## Why Build on Polkadot Hub
34193419
3420-
## Native Smart Contracts
3420+
### Ethereum Compatibility
34213421
3422-
### Introduction
3422+
Deploy existing Ethereum contracts with zero modifications while maintaining full compatibility with your existing development stack:
34233423
3424-
Polkadot Hub enables smart contract deployment and execution through PolkaVM, a cutting-edge virtual machine designed specifically for the Polkadot ecosystem. This native integration allows developers to deploy smart contracts directly on Polkadot's system chain while maintaining compatibility with Ethereum development tools and workflows.
3424+
- **Complete JSON-RPC API support**: Use MetaMask, Hardhat, Remix, Foundry, and all standard Ethereum tooling.
3425+
- **Standard libraries**: Integrate Ethers.js, Web3.js, Viem, Wagmi, and Web3.py without changes.
3426+
- **Solidity development**: Write contracts in Solidity or migrate existing code directly.
3427+
- **Familiar workflows**: Maintain your existing deployment, testing, and monitoring processes.
34253428
3426-
### Smart Contract Development
3429+
### Performance Options
34273430
3428-
The smart contract platform on Polkadot Hub combines _Polkadot's robust security and scalability_ with the extensive Ethereum development ecosystem. Developers can utilize familiar Ethereum libraries for contract interactions and leverage industry-standard development environments for writing and testing smart contracts.
3431+
Choose between two execution backends:
34293432
3430-
Polkadot Hub provides _full Ethereum JSON-RPC API compatibility_, ensuring seamless integration with existing development tools and services. This compatibility enables developers to maintain their preferred workflows while building on Polkadot's native infrastructure.
3433+
- **REVM**: Run unmodified Ethereum contracts with full EVM/Ethereum compatibility.
3434+
- **PolkaVM**: Compile to optimized RISC-V bytecode for enhanced performance and lower fees while keeping Ethereum-compatibility.
34313435
3432-
### Technical Architecture
3436+
Both backends share the same RPC interface and tooling support, allowing seamless transitions. In addition, smart contracts can interact with Polkadot native services via [precompile contracts](/smart-contracts/precompiles/){target=\_blank}.
34333437
3434-
PolkaVM, the underlying virtual machine, utilizes a RISC-V-based register architecture _optimized for the Polkadot ecosystem_. This design choice offers several advantages:
3438+
### Cross-VM & Cross-Chain Capabilities
34353439
3436-
- Enhanced performance for smart contract execution.
3437-
- Improved gas efficiency for complex operations.
3438-
- Native compatibility with Polkadot's runtime environment.
3439-
- Optimized storage and state management.
3440+
Smart contracts written for one VM (for example, EVM) can interact directly with other smart contracts written for the RISC-V PolkaVM, and back. This allows to use full EVM compatible contracts but extend to heavy/complex execution workloads to the PolkaVM RISC-V backend.
34403441
3441-
### Development Tools and Resources
3442-
3443-
Polkadot Hub supports a comprehensive suite of development tools familiar to Ethereum developers. The platform integrates with popular development frameworks, testing environments, and deployment tools. Key features include:
3444-
3445-
- Contract development in Solidity or Rust.
3446-
- Support for standard Ethereum development libraries.
3447-
- Integration with widely used development environments.
3448-
- Access to blockchain explorers and indexing solutions.
3449-
- Compatibility with contract monitoring and management tools.
3450-
3451-
### Cross-Chain Capabilities
3452-
3453-
Smart contracts deployed on Polkadot Hub can leverage Polkadot's [cross-consensus messaging (XCM) protocol](/parachains/interoperability/get-started/){target=\_blank} protocol to seamlessly _transfer tokens and call functions on other blockchain networks_ within the Polkadot ecosystem, all without complex bridging infrastructure or third-party solutions.
3454-
3455-
### Use Cases
3456-
3457-
Polkadot Hub's smart contract platform is suitable for a wide range of applications:
3458-
3459-
- DeFi protocols leveraging _cross-chain capabilities_.
3460-
- NFT platforms utilizing Polkadot's native token standards.
3461-
- Governance systems integrated with Polkadot's democracy mechanisms.
3462-
- Cross-chain bridges and asset management solutions.
3442+
Furthermore, all smart contracts in Polkadot Hub can interact with any service in the Polkadot ecosystem through [XCM](/smart-contracts/precompiles/xcm/){target=\_blank}, enabling token transfers, remote execution, and cross-chain composability without bridges or intermediaries.
34633443
34643444
## Other Smart Contract Environments
34653445
@@ -3469,32 +3449,41 @@ Beyond Polkadot Hub's native PolkaVM support, the ecosystem offers two main alte
34693449
34703450
- **Rust (ink!)**: ink! is a Rust-based framework that can compile to PolkaVM. It uses [`#[ink(...)]`](https://use.ink/docs/v6/macros-attributes/){target=\_blank} attribute macros to create Polkadot SDK-compatible PolkaVM bytecode, offering strong memory safety from Rust, an advanced type system, high-performance PolkaVM execution, and platform independence with sandboxed security.
34713451
3452+
## Next Steps
3453+
3454+
<div class="grid cards" markdown>
34723455
3473-
Each environment provides unique advantages based on developer preferences and application requirements.
3456+
- <span class="badge guide">Guide</span> __Get Started__
34743457
3475-
## Where to Go Next
3458+
---
34763459
3477-
Developers can use their existing Ethereum development tools and connect to Polkadot Hub's RPC endpoints. The platform's Ethereum compatibility layer ensures a smooth transition for teams already building on Ethereum-compatible chains.
3460+
Quick-start guides for connecting, deploying, and building your first smart contract.
34783461
3479-
Subsequent sections of this guide provide detailed information about specific development tools, advanced features, and best practices for building on Polkadot Hub.
3462+
[:octicons-arrow-right-24: Get Started](/smart-contracts/get-started/)
34803463
3481-
<div class="grid cards" markdown>
3464+
- <span class="badge guide">Guide</span> __Cookbook__
3465+
3466+
---
3467+
3468+
Step-by-step tutorials for deploying contracts, tokens, NFTs, and full dApps.
3469+
3470+
[:octicons-arrow-right-24: View Tutorials](/smart-contracts/cookbook/)
34823471
3483-
- <span class="badge guide">Guide</span> __Libraries__
3472+
- <span class="badge guide">Guide</span> __Ethereum Developers__
34843473
34853474
---
34863475
3487-
Explore essential libraries to optimize smart contract development and interaction.
3476+
Understand key differences in accounts, fees, gas model, and deployment on Polkadot Hub.
34883477
3489-
[:octicons-arrow-right-24: Reference](/smart-contracts/libraries/ethers-js/)
3478+
[:octicons-arrow-right-24: Learn More](/smart-contracts/for-eth-devs/accounts/)
34903479
3491-
- <span class="badge guide">Guide</span> __Dev Environments__
3480+
- <span class="badge guide">Guide</span> __Precompiles__
34923481
34933482
---
34943483
3495-
Set up your development environment for seamless contract deployment and testing.
3484+
Discover advanced functionalities including XCM for cross-chain interactions.
34963485
3497-
[:octicons-arrow-right-24: Reference](/smart-contracts/dev-environments/local-dev-node/)
3486+
[:octicons-arrow-right-24: Explore Precompiles](/smart-contracts/precompiles/)
34983487
34993488
</div>
35003489

0 commit comments

Comments
 (0)