diff --git a/.ai/categories/polkadot-protocol.md b/.ai/categories/polkadot-protocol.md
index b8ac4e161..b93b6c0b1 100644
--- a/.ai/categories/polkadot-protocol.md
+++ b/.ai/categories/polkadot-protocol.md
@@ -8332,6 +8332,186 @@ You must contact specific registrars individually to request judgment. Each regi
+---
+
+Page Title: Polkadot Hub Assets
+
+- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-assets.md
+- Canonical (HTML): https://docs.polkadot.com/reference/polkadot-hub/assets/
+- Summary: Learn about asset management on Polkadot Hub, including on-chain assets, foreign asset integration, and XCM for cross-chain asset transfers.
+
+# Assets on Polkadot Hub
+
+## Introduction
+
+Polkadot Hub is Polkadot's system parachain for issuing and managing on-chain assets. While the relay chain provides security, Polkadot Hub handles asset logic—minting, burning, transfers, and metadata—efficiently and cost-effectively.
+
+Polkadot Hub supports native assets issued on the parachain and foreign assets from other chains, both of which can move seamlessly across the network via XCM.
+
+This guide explains how assets are created, managed, and moved across chains, including key operations, roles, and the differences between native and foreign assets.
+
+## Why Use Polkadot Hub?
+
+Polkadot Hub provides a standardized framework for creating and managing fungible and non-fungible assets. Projects can issue tokens, manage supply, and transfer assets across parachains, extending the functionality of the Polkadot relay chain, which only supports its native token (DOT).
+
+**Key features**:
+
+- **Built-in asset operations**: Mint, burn, and transfer like ERC-20 on Ethereum, but native to Polkadot's runtime.
+- **Custom asset creation**: Issue tokens or NFTs with configurable permissions and metadata.
+- **Low fees**: Transactions cost roughly one-tenth of relay chain fees.
+- **Lower deposits**: Minimal on-chain storage costs for asset data.
+- **Pay fees in any asset**: Users don’t need DOT to transact; supported assets can cover fees.
+- **Cross-chain ready**: Assets can be transferred to other parachains using XCM.
+
+## Types of Assets
+
+Polkadot Hub supports two types of assets:
+
+- **Native assets**: Tokens and NFTs issued directly on Polkadot Hub using the Assets pallet. These assets benefit from the platform's custom features, such as configurable permissions and low fees
+- **Foreign assets**: Tokens originating from other Polkadot parachains or external networks (like Ethereum, via bridges). Once registered on Polkadot Hub, they are treated similarly to native assets.
+
+## Asset Structure
+
+Each asset is identified by a unique ID and stores:
+
+- Asset administrators
+- Total supply and holder count
+- Minimum balance configuration
+- Sufficiency–whether the asset can keep an account alive without DOT
+- Metadata (name, symbol, decimals)
+
+If a balance falls below the configured minimum, called the [existential deposit](/reference/glossary/#existential-deposit){target=\_blank}, it may be removed as “dust.” This ensures efficient storage while giving developers control over asset economics.
+
+## How Native Assets Work
+
+Native assets on Polkadot Hub are created and managed via the Assets pallet from the Polkadot SDK. This pallet defines the runtime logic for issuing, configuring, and administering fungible assets with customizable permissions.
+
+It supports both permissioned and permissionless asset creation, enabling everything from simple user-issued tokens to governed assets controlled by teams or DAOs.
+
+For implementation details, see the [Assets Pallet Rust docs](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/index.html){target=\_blank}.
+
+### Asset Operations
+
+The Assets pallet provides both state-changing operations and read-only queries for full lifecycle management of assets.
+
+Core operations include:
+
+- **Asset issuance**: Create new assets and assign initial supply.
+- **Transfers**: Move assets between accounts with balance tracking.
+- **Burning**: Reduce total supply by destroying tokens.
+- **Delegated transfers**: Approve transfers on behalf of another account without giving up custody.
+- **Freezing and thawing**: Temporarily lock and unlock an account's balance.
+
+For a complete list of extrinsics, see the [`pallet-assets` dispatchable functions reference](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/enum.Call.html){target=\_blank}.
+
+Data queries make it possible to:
+
+- Check account balances and total supply.
+- Retrieve asset metadata and configuration details.
+- Inspect account and asset status on-chain.
+
+For a full list of queries, see the [Pallet reference](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/struct.Pallet.html){target=\_blank}.
+
+### Roles and Permissions
+
+The Assets pallet uses role-based permissions to control who can manage different parts of an asset’s lifecycle:
+
+- **Owner**: Overarching control, including destroying an asset class; can set or update Issuer, Freezer, and Admin roles.
+- **Admin**: Can freeze assets and forcibly transfer balances between accounts. Admins can also reduce the balance of an asset class across arbitrary accounts.
+- **Issuer**: Responsible for minting new tokens. When new assets are created, the Issuer is the account that controls their distribution to other accounts.
+- **Freezer**: Can lock the transfer of assets from an account, preventing the account holder from moving their balance.
+
+These roles allow projects to enforce governance and security policies around their assets.
+
+### Freezing Assets
+
+Assets can be temporarily locked to prevent transfers from specific accounts. This is useful for dispute resolution, fraud prevention, or compliance controls.
+
+**How it works**:
+
+- Only authorized parties can freeze or unfreeze (thaw) assets.
+- Freezing pauses the movement of the asset without burning or removing it.
+- Once thawed, the asset can be transferred normally.
+
+Freezing provides a safe way to control asset flow while maintaining full ownership.
+
+**Key functions**: `freeze` and `thaw`.
+
+### Delegated Transfers
+
+Polkadot Hub supports delegated asset transfers, allowing one account to authorize another to move a limited amount of its assets—without giving up full control. This is useful for escrow logic, automated payments, and multi-party applications.
+
+**How it works**:
+
+- An account can grant permission to another account to transfer a specific amount of its assets.
+- Permissions can be revoked at any time, preventing further transfers.
+- Authorized accounts can execute transfers on behalf of the original owner within the approved limits.
+
+Delegated transfers simplify multi-step transactions and enable complex asset flows.
+
+**Key functions**: `approve_transfer`, `cancel_approval`, and `transfer_approved`.
+
+## How Foreign Assets Work
+
+Foreign assets are assets originating from other chains and are managed on Polkadot Hub via an instance of the Assets pallet that is configured specifically for foreign assets. It enables transfers, balance checks, and other standard asset operations, while handling foreign-asset specifics such as:
+
+- **Asset identifiers**: Foreign assets use an XCM multilocation as their identifier, rather than a numeric AssetId. This ensures assets from different chains can be referenced and moved safely across parachains.
+
+- **Transfers**: Once registered on Polkadot Hub, foreign assets can be transferred between accounts just like native assets. If supported, they can also be returned to their original blockchain using cross-chain messaging.
+
+This unified interface makes it easy for dApps to handle both native and cross-chain assets.
+
+## Moving Assets Across Chains
+
+Polkadot Hub enables assets to move safely between parachains and the relay chain using XCM (Cross-Consensus Messaging). XCM ensures assets can move securely between chains while preserving ownership and traceability
+
+To learn more about asset transfers with XCM, please refer to the [Introduction to XCM](/parachains/interoperability/get-started/) page.
+
+
+---
+
+Page Title: Polkadot Hub Smart Contracts
+
+- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-smart-contracts.md
+- Canonical (HTML): https://docs.polkadot.com/reference/polkadot-hub/smart-contracts/
+- Summary: Learn how Polkadot Hub supports smart contracts through the REVM, a Rust-based Ethereum Virtual Machine compatible runtime.
+
+# Smart Contracts on Polkadot Hub
+
+## Introduction
+
+Polkadot Hub enables developers to deploy and interact with Solidity contracts through REVM, a high-performance, Rust-based Ethereum Virtual Machine implementation. This brings Ethereum compatibility to Polkadot Hub, letting teams use familiar Solidity tooling, integrate with on-chain features like governance and XCM, and take advantage of cross-chain interoperability.
+
+For projects that require maximum computational performance, Polkadot Hub also supports PolkaVM (PVM), a native RISC-V execution engine. PVM is optional and designed for high-throughput, performance-intensive smart contracts.
+
+### REVM Smart Contracts
+
+[REVM](https://github.com/bluealloy/revm){target=_blank} brings full EVM compatibility to Polkadot Hub through a fast, memory-safe Rust implementation of the Ethereum Virtual Machine. Unlike PolkaVM, which compiles contracts to RISC-V for native execution, REVM executes standard Ethereum bytecode directly—making it ideal for teams who want to migrate existing Solidity projects to Polkadot with minimal changes.
+
+With REVM, developers can:
+
+- Deploy existing Solidity contracts without rewriting them.
+- Use familiar Ethereum tooling like Hardhat, Foundry, Remix, and MetaMask.
+- Interact with other parachains and on-chain assets using XCM and Polkadot Hub features.
+
+REVM builds on Rust’s safety guarantees and performance optimizations while retaining full opcode compatibility with the EVM. This provides a reliable path for Ethereum-native developers to access Polkadot’s native features—such as governance, treasury, multisig, and XCM—within a unified, interoperable runtime environment.
+
+### PVM Smart Contracts
+
+PVM is Polkadot Hub’s native, high-performance smart contract engine. Instead of emulating EVM bytecode, it runs contracts compiled to a [RISC-V](https://en.wikipedia.org/wiki/RISC-V){target=_blank} instruction set, unlocking higher performance and parallel execution while staying friendly to Ethereum-style development.
+
+With PVM, developers can:
+
+- Write Solidity contracts and use familiar tooling (e.g., Hardhat, Foundry) targeting PVM
+- Benefit from fast, predictable execution with carefully metered gas/weight.
+- Access detailed observability through Substrate events and contract logs for indexing and debugging.
+
+PolkaVM delivers maximum performance for computationally intensive contracts, offering a native, high-throughput option for Ethereum-style developers on Polkadot Hub.
+
+!!! smartcontract "PolkaVM Preview Release"
+ PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**.
+
+
---
Page Title: Polkadot SDK Accounts
diff --git a/.ai/categories/smart-contracts.md b/.ai/categories/smart-contracts.md
index 18e603f60..3a3f35da2 100644
--- a/.ai/categories/smart-contracts.md
+++ b/.ai/categories/smart-contracts.md
@@ -10585,6 +10585,160 @@ Your local development environment is now active and accessible at `http://local
You can connect wallets, deploy contracts using Remix or Hardhat, and interact with your smart contracts as you would on any Ethereum-compatible network.
+---
+
+Page Title: Migration FAQs and Considerations
+
+- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-for-eth-devs-migration.md
+- Canonical (HTML): https://docs.polkadot.com/smart-contracts/for-eth-devs/migration/
+- Summary: Learn how to migrate your existing Ethereum contracts to the Polkadot Hub using REVM and PolkaVM by following these considerations.
+
+# Migration FAQs and Considerations
+
+## Introduction
+
+This guide helps Ethereum developers migrate their smart contracts to Polkadot Hub. Most contracts work without modifications on the REVM backend, while the PolkaVM backend offers enhanced performance with minimal adaptation for standard patterns.
+
+## Migration Considerations
+
+Take into account the following considerations before migrating your contracts:
+
+- Standard ERC-20, ERC-721, ERC-1155 tokens work without changes.
+- DeFi protocols, DEXs, and AMMs migrate seamlessly.
+- DAOs and governance contracts are fully compatible.
+- Most Solidity contracts deploy identically to Ethereum.
+
+## Migration Checklist
+
+Before migrating your contracts, review this checklist:
+
+- Factory contracts using PVM bytecode need pre-uploaded dependencies.
+- Contracts using `EXTCODECOPY` for runtime manipulation require review (for projects that will use PVM bytecode, not EVM bytecode).
+- Replace `transfer()` and `send()` with proper reentrancy guards (for projects that will use PVM bytecode, not EVM bytecode).
+
+## Migration FAQs
+
+### Which backend should I choose?
+
+- Choose REVM if you want:
+
+ - Zero-modification deployment of existing Ethereum contracts.
+ - Exact EVM behavior for audited code.
+ - Compatibility with tools that inspect EVM bytecode.
+ - Rapid deployment without optimization.
+
+- Choose PolkaVM if you want:
+
+ - Better performance for computation-heavy applications.
+ - Lower execution costs for intensive operations.
+ - Access to next-generation smart contract features.
+
+If you are unsure which to choose, start with REVM for immediate compatibility, then consider PolkaVM for performance optimization once deployed.
+
+### Do I need to rewrite my Solidity code?
+
+No, for most contracts. Standard Solidity patterns work on both backends.
+
+### What about factory contracts?
+
+- **REVM**: Factory contracts work identically to Ethereum with no changes needed.
+
+ The original factory pattern is:
+
+ ```solidity
+ contract TokenFactory {
+ function createToken(string memory name) public returns (address) {
+ // Creates new contract at runtime
+ Token newToken = new Token(name);
+ return address(newToken);
+ }
+ }
+ ```
+
+- **PolkaVM**: Factory contracts require pre-uploading dependent contracts.
+
+ Here's how to adapt the original factory pattern:
+
+ ```solidity
+ contract TokenFactory {
+ // Reference pre-uploaded Token contract by hash
+ bytes32 public tokenCodeHash;
+
+ constructor(bytes32 _tokenCodeHash) {
+ tokenCodeHash = _tokenCodeHash;
+ }
+
+ function createToken(string memory name) public returns (address) {
+ // Instantiate from pre-uploaded code
+ Token newToken = new Token{salt: keccak256(abi.encode(name))}(name);
+ return address(newToken);
+ }
+ }
+ ```
+
+The deployment steps for PolkaVM factories are:
+
+1. Upload the contract code to the chain.
+2. Note the returned code hash.
+3. Deploy the Factory contract with the contract code hash.
+4. Factory can now instantiate contracts using the pre-uploaded code.
+
+### How do gas costs compare?
+
+For more information on gas costs, see the [Gas Model](/smart-contracts/for-eth-devs/gas-model/){target=\_blank} page.
+
+### Which Solidity features are not supported?
+
+For REVM, any Solidity feature will function smoothly without requiring changes or adaptations. For PVM, there are considerations, as was mentioned above.
+
+For PolkaVM, there are some considerations:
+
+- `EXTCODECOPY`: Only works in constructor code.
+- Runtime code modification: Use on-chain constructors instead.
+- **Gas stipends**: `address.send()` and `address.transfer()` don't provide reentrancy protection.
+- **Unsupported operations**: `pc`, `extcodecopy`, `selfdestruct`, `blobhash`, and `blobbasefee` (blob-related operations).
+
+### How do I handle the existential deposit?
+
+Polkadot requires accounts to maintain a minimum balance (existential deposit or ED) to remain active.
+
+This is handled automatically for you:
+
+- Balance queries via Ethereum RPC automatically deduct the ED.
+- New account transfers include ED in transaction fees.
+- Contract-to-contract transfers draw ED from the transaction signer.
+
+You typically don't need to do anything special, but be aware:
+
+- Accounts below ED threshold are automatically deleted.
+- ED is around 0.01 DOT (varies by network).
+- Your contracts don't need to manage this explicitly.
+
+### Can I use my existing development tools?
+
+Yes. Both backends support:
+
+- **Wallets**: [MetaMask](https://metamask.io/){target=\_blank}, [Talisman](https://talisman.xyz/){target=\_blank}, [SubWallet](https://www.subwallet.app/){target=\_blank}
+- **Development frameworks**: [Hardhat](/smart-contracts/cookbook/smart-contracts/deploy-basic/hardhat/){target=\_blank}, [Foundry](/smart-contracts/cookbook/smart-contracts/deploy-basic/foundry/){target=\_blank}, [Remix](/smart-contracts/cookbook/smart-contracts/deploy-basic/remix/){target=\_blank} (just consider that for PVM bytecode, you will use the Polkadot version of the tooling)
+- **Libraries**: [ethers.js](/smart-contracts/libraries/ethers-js/){target=\_blank}, [web3.js](/smart-contracts/libraries/web3-js/){target=\_blank}, [viem](/smart-contracts/libraries/viem/){target=\_blank}
+- **Testing tools**: Your existing test suites work
+
+Connect to Polkadot Hub's Ethereum JSON-RPC endpoint and use your familiar workflow.
+
+## Conclusion
+
+Most Ethereum contracts migrate to Polkadot Hub with minimal or no changes. Use REVM for seamless compatibility or PolkaVM for enhanced performance.
+
+There are a few key points to keep in mind during migration:
+
+- Replace `transfer()` and `send()` with `.call{value}("")` and use reentrancy guards (for projects that will use PVM bytecode, not EVM bytecode).
+- PolkaVM factory contracts using PVM bytecode need pre-uploaded dependencies.
+- Don't hardcode gas values.
+- Test thoroughly on [TestNet](/smart-contracts/connect/#__tabbed_1_1){target=\_blank} before mainnet deployment.
+
+Your existing Solidity knowledge and tooling transfer directly to Polkadot Hub, making migration straightforward for standard smart contract patterns.
+
+
---
Page Title: Networks
diff --git a/.ai/categories/tooling.md b/.ai/categories/tooling.md
index 41ae91e34..6f6a392c3 100644
--- a/.ai/categories/tooling.md
+++ b/.ai/categories/tooling.md
@@ -25913,7 +25913,7 @@ export default buildModule("StorageModule", (m) => {
Deploy the contract to Polkadot Hub TestNet:
```bash
-npx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotHub
+npx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotTestNet
```
You should see output similar to:
diff --git a/.ai/pages/reference-polkadot-hub-assets.md b/.ai/pages/reference-polkadot-hub-assets.md
new file mode 100644
index 000000000..69df2b11b
--- /dev/null
+++ b/.ai/pages/reference-polkadot-hub-assets.md
@@ -0,0 +1,133 @@
+---
+title: Polkadot Hub Assets
+description: Learn about asset management on Polkadot Hub, including on-chain assets, foreign asset integration, and XCM for cross-chain asset transfers.
+categories: Polkadot Protocol
+url: https://docs.polkadot.com/reference/polkadot-hub/assets/
+---
+
+# Assets on Polkadot Hub
+
+## Introduction
+
+Polkadot Hub is Polkadot's system parachain for issuing and managing on-chain assets. While the relay chain provides security, Polkadot Hub handles asset logic—minting, burning, transfers, and metadata—efficiently and cost-effectively.
+
+Polkadot Hub supports native assets issued on the parachain and foreign assets from other chains, both of which can move seamlessly across the network via XCM.
+
+This guide explains how assets are created, managed, and moved across chains, including key operations, roles, and the differences between native and foreign assets.
+
+## Why Use Polkadot Hub?
+
+Polkadot Hub provides a standardized framework for creating and managing fungible and non-fungible assets. Projects can issue tokens, manage supply, and transfer assets across parachains, extending the functionality of the Polkadot relay chain, which only supports its native token (DOT).
+
+**Key features**:
+
+- **Built-in asset operations**: Mint, burn, and transfer like ERC-20 on Ethereum, but native to Polkadot's runtime.
+- **Custom asset creation**: Issue tokens or NFTs with configurable permissions and metadata.
+- **Low fees**: Transactions cost roughly one-tenth of relay chain fees.
+- **Lower deposits**: Minimal on-chain storage costs for asset data.
+- **Pay fees in any asset**: Users don’t need DOT to transact; supported assets can cover fees.
+- **Cross-chain ready**: Assets can be transferred to other parachains using XCM.
+
+## Types of Assets
+
+Polkadot Hub supports two types of assets:
+
+- **Native assets**: Tokens and NFTs issued directly on Polkadot Hub using the Assets pallet. These assets benefit from the platform's custom features, such as configurable permissions and low fees
+- **Foreign assets**: Tokens originating from other Polkadot parachains or external networks (like Ethereum, via bridges). Once registered on Polkadot Hub, they are treated similarly to native assets.
+
+## Asset Structure
+
+Each asset is identified by a unique ID and stores:
+
+- Asset administrators
+- Total supply and holder count
+- Minimum balance configuration
+- Sufficiency–whether the asset can keep an account alive without DOT
+- Metadata (name, symbol, decimals)
+
+If a balance falls below the configured minimum, called the [existential deposit](/reference/glossary/#existential-deposit){target=\_blank}, it may be removed as “dust.” This ensures efficient storage while giving developers control over asset economics.
+
+## How Native Assets Work
+
+Native assets on Polkadot Hub are created and managed via the Assets pallet from the Polkadot SDK. This pallet defines the runtime logic for issuing, configuring, and administering fungible assets with customizable permissions.
+
+It supports both permissioned and permissionless asset creation, enabling everything from simple user-issued tokens to governed assets controlled by teams or DAOs.
+
+For implementation details, see the [Assets Pallet Rust docs](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/index.html){target=\_blank}.
+
+### Asset Operations
+
+The Assets pallet provides both state-changing operations and read-only queries for full lifecycle management of assets.
+
+Core operations include:
+
+- **Asset issuance**: Create new assets and assign initial supply.
+- **Transfers**: Move assets between accounts with balance tracking.
+- **Burning**: Reduce total supply by destroying tokens.
+- **Delegated transfers**: Approve transfers on behalf of another account without giving up custody.
+- **Freezing and thawing**: Temporarily lock and unlock an account's balance.
+
+For a complete list of extrinsics, see the [`pallet-assets` dispatchable functions reference](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/enum.Call.html){target=\_blank}.
+
+Data queries make it possible to:
+
+- Check account balances and total supply.
+- Retrieve asset metadata and configuration details.
+- Inspect account and asset status on-chain.
+
+For a full list of queries, see the [Pallet reference](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/struct.Pallet.html){target=\_blank}.
+
+### Roles and Permissions
+
+The Assets pallet uses role-based permissions to control who can manage different parts of an asset’s lifecycle:
+
+- **Owner**: Overarching control, including destroying an asset class; can set or update Issuer, Freezer, and Admin roles.
+- **Admin**: Can freeze assets and forcibly transfer balances between accounts. Admins can also reduce the balance of an asset class across arbitrary accounts.
+- **Issuer**: Responsible for minting new tokens. When new assets are created, the Issuer is the account that controls their distribution to other accounts.
+- **Freezer**: Can lock the transfer of assets from an account, preventing the account holder from moving their balance.
+
+These roles allow projects to enforce governance and security policies around their assets.
+
+### Freezing Assets
+
+Assets can be temporarily locked to prevent transfers from specific accounts. This is useful for dispute resolution, fraud prevention, or compliance controls.
+
+**How it works**:
+
+- Only authorized parties can freeze or unfreeze (thaw) assets.
+- Freezing pauses the movement of the asset without burning or removing it.
+- Once thawed, the asset can be transferred normally.
+
+Freezing provides a safe way to control asset flow while maintaining full ownership.
+
+**Key functions**: `freeze` and `thaw`.
+
+### Delegated Transfers
+
+Polkadot Hub supports delegated asset transfers, allowing one account to authorize another to move a limited amount of its assets—without giving up full control. This is useful for escrow logic, automated payments, and multi-party applications.
+
+**How it works**:
+
+- An account can grant permission to another account to transfer a specific amount of its assets.
+- Permissions can be revoked at any time, preventing further transfers.
+- Authorized accounts can execute transfers on behalf of the original owner within the approved limits.
+
+Delegated transfers simplify multi-step transactions and enable complex asset flows.
+
+**Key functions**: `approve_transfer`, `cancel_approval`, and `transfer_approved`.
+
+## How Foreign Assets Work
+
+Foreign assets are assets originating from other chains and are managed on Polkadot Hub via an instance of the Assets pallet that is configured specifically for foreign assets. It enables transfers, balance checks, and other standard asset operations, while handling foreign-asset specifics such as:
+
+- **Asset identifiers**: Foreign assets use an XCM multilocation as their identifier, rather than a numeric AssetId. This ensures assets from different chains can be referenced and moved safely across parachains.
+
+- **Transfers**: Once registered on Polkadot Hub, foreign assets can be transferred between accounts just like native assets. If supported, they can also be returned to their original blockchain using cross-chain messaging.
+
+This unified interface makes it easy for dApps to handle both native and cross-chain assets.
+
+## Moving Assets Across Chains
+
+Polkadot Hub enables assets to move safely between parachains and the relay chain using XCM (Cross-Consensus Messaging). XCM ensures assets can move securely between chains while preserving ownership and traceability
+
+To learn more about asset transfers with XCM, please refer to the [Introduction to XCM](/parachains/interoperability/get-started/) page.
diff --git a/.ai/pages/reference-polkadot-hub-smart-contracts.md b/.ai/pages/reference-polkadot-hub-smart-contracts.md
new file mode 100644
index 000000000..d49a31ccc
--- /dev/null
+++ b/.ai/pages/reference-polkadot-hub-smart-contracts.md
@@ -0,0 +1,41 @@
+---
+title: Polkadot Hub Smart Contracts
+description: Learn how Polkadot Hub supports smart contracts through the REVM, a Rust-based Ethereum Virtual Machine compatible runtime.
+categories: Polkadot Protocol
+url: https://docs.polkadot.com/reference/polkadot-hub/smart-contracts/
+---
+
+# Smart Contracts on Polkadot Hub
+
+## Introduction
+
+Polkadot Hub enables developers to deploy and interact with Solidity contracts through REVM, a high-performance, Rust-based Ethereum Virtual Machine implementation. This brings Ethereum compatibility to Polkadot Hub, letting teams use familiar Solidity tooling, integrate with on-chain features like governance and XCM, and take advantage of cross-chain interoperability.
+
+For projects that require maximum computational performance, Polkadot Hub also supports PolkaVM (PVM), a native RISC-V execution engine. PVM is optional and designed for high-throughput, performance-intensive smart contracts.
+
+### REVM Smart Contracts
+
+[REVM](https://github.com/bluealloy/revm){target=_blank} brings full EVM compatibility to Polkadot Hub through a fast, memory-safe Rust implementation of the Ethereum Virtual Machine. Unlike PolkaVM, which compiles contracts to RISC-V for native execution, REVM executes standard Ethereum bytecode directly—making it ideal for teams who want to migrate existing Solidity projects to Polkadot with minimal changes.
+
+With REVM, developers can:
+
+- Deploy existing Solidity contracts without rewriting them.
+- Use familiar Ethereum tooling like Hardhat, Foundry, Remix, and MetaMask.
+- Interact with other parachains and on-chain assets using XCM and Polkadot Hub features.
+
+REVM builds on Rust’s safety guarantees and performance optimizations while retaining full opcode compatibility with the EVM. This provides a reliable path for Ethereum-native developers to access Polkadot’s native features—such as governance, treasury, multisig, and XCM—within a unified, interoperable runtime environment.
+
+### PVM Smart Contracts
+
+PVM is Polkadot Hub’s native, high-performance smart contract engine. Instead of emulating EVM bytecode, it runs contracts compiled to a [RISC-V](https://en.wikipedia.org/wiki/RISC-V){target=_blank} instruction set, unlocking higher performance and parallel execution while staying friendly to Ethereum-style development.
+
+With PVM, developers can:
+
+- Write Solidity contracts and use familiar tooling (e.g., Hardhat, Foundry) targeting PVM
+- Benefit from fast, predictable execution with carefully metered gas/weight.
+- Access detailed observability through Substrate events and contract logs for indexing and debugging.
+
+PolkaVM delivers maximum performance for computationally intensive contracts, offering a native, high-throughput option for Ethereum-style developers on Polkadot Hub.
+
+!!! smartcontract "PolkaVM Preview Release"
+ PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**.
diff --git a/.ai/pages/smart-contracts-cookbook-dapps-zero-to-hero.md b/.ai/pages/smart-contracts-cookbook-dapps-zero-to-hero.md
index d2c8e9ade..b0cc72fa0 100644
--- a/.ai/pages/smart-contracts-cookbook-dapps-zero-to-hero.md
+++ b/.ai/pages/smart-contracts-cookbook-dapps-zero-to-hero.md
@@ -213,7 +213,7 @@ export default buildModule("StorageModule", (m) => {
Deploy the contract to Polkadot Hub TestNet:
```bash
-npx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotHub
+npx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotTestNet
```
You should see output similar to:
diff --git a/.ai/pages/smart-contracts-for-eth-devs-migration.md b/.ai/pages/smart-contracts-for-eth-devs-migration.md
index e791fd24d..58c91eb15 100644
--- a/.ai/pages/smart-contracts-for-eth-devs-migration.md
+++ b/.ai/pages/smart-contracts-for-eth-devs-migration.md
@@ -1,5 +1,151 @@
---
+title: Migration FAQs and Considerations
+description: Learn how to migrate your existing Ethereum contracts to the Polkadot Hub using REVM and PolkaVM by following these considerations.
+categories: Smart Contracts
url: https://docs.polkadot.com/smart-contracts/for-eth-devs/migration/
---
-TODO
+# Migration FAQs and Considerations
+
+## Introduction
+
+This guide helps Ethereum developers migrate their smart contracts to Polkadot Hub. Most contracts work without modifications on the REVM backend, while the PolkaVM backend offers enhanced performance with minimal adaptation for standard patterns.
+
+## Migration Considerations
+
+Take into account the following considerations before migrating your contracts:
+
+- Standard ERC-20, ERC-721, ERC-1155 tokens work without changes.
+- DeFi protocols, DEXs, and AMMs migrate seamlessly.
+- DAOs and governance contracts are fully compatible.
+- Most Solidity contracts deploy identically to Ethereum.
+
+## Migration Checklist
+
+Before migrating your contracts, review this checklist:
+
+- Factory contracts using PVM bytecode need pre-uploaded dependencies.
+- Contracts using `EXTCODECOPY` for runtime manipulation require review (for projects that will use PVM bytecode, not EVM bytecode).
+- Replace `transfer()` and `send()` with proper reentrancy guards (for projects that will use PVM bytecode, not EVM bytecode).
+
+## Migration FAQs
+
+### Which backend should I choose?
+
+- Choose REVM if you want:
+
+ - Zero-modification deployment of existing Ethereum contracts.
+ - Exact EVM behavior for audited code.
+ - Compatibility with tools that inspect EVM bytecode.
+ - Rapid deployment without optimization.
+
+- Choose PolkaVM if you want:
+
+ - Better performance for computation-heavy applications.
+ - Lower execution costs for intensive operations.
+ - Access to next-generation smart contract features.
+
+If you are unsure which to choose, start with REVM for immediate compatibility, then consider PolkaVM for performance optimization once deployed.
+
+### Do I need to rewrite my Solidity code?
+
+No, for most contracts. Standard Solidity patterns work on both backends.
+
+### What about factory contracts?
+
+- **REVM**: Factory contracts work identically to Ethereum with no changes needed.
+
+ The original factory pattern is:
+
+ ```solidity
+ contract TokenFactory {
+ function createToken(string memory name) public returns (address) {
+ // Creates new contract at runtime
+ Token newToken = new Token(name);
+ return address(newToken);
+ }
+ }
+ ```
+
+- **PolkaVM**: Factory contracts require pre-uploading dependent contracts.
+
+ Here's how to adapt the original factory pattern:
+
+ ```solidity
+ contract TokenFactory {
+ // Reference pre-uploaded Token contract by hash
+ bytes32 public tokenCodeHash;
+
+ constructor(bytes32 _tokenCodeHash) {
+ tokenCodeHash = _tokenCodeHash;
+ }
+
+ function createToken(string memory name) public returns (address) {
+ // Instantiate from pre-uploaded code
+ Token newToken = new Token{salt: keccak256(abi.encode(name))}(name);
+ return address(newToken);
+ }
+ }
+ ```
+
+The deployment steps for PolkaVM factories are:
+
+1. Upload the contract code to the chain.
+2. Note the returned code hash.
+3. Deploy the Factory contract with the contract code hash.
+4. Factory can now instantiate contracts using the pre-uploaded code.
+
+### How do gas costs compare?
+
+For more information on gas costs, see the [Gas Model](/smart-contracts/for-eth-devs/gas-model/){target=\_blank} page.
+
+### Which Solidity features are not supported?
+
+For REVM, any Solidity feature will function smoothly without requiring changes or adaptations. For PVM, there are considerations, as was mentioned above.
+
+For PolkaVM, there are some considerations:
+
+- `EXTCODECOPY`: Only works in constructor code.
+- Runtime code modification: Use on-chain constructors instead.
+- **Gas stipends**: `address.send()` and `address.transfer()` don't provide reentrancy protection.
+- **Unsupported operations**: `pc`, `extcodecopy`, `selfdestruct`, `blobhash`, and `blobbasefee` (blob-related operations).
+
+### How do I handle the existential deposit?
+
+Polkadot requires accounts to maintain a minimum balance (existential deposit or ED) to remain active.
+
+This is handled automatically for you:
+
+- Balance queries via Ethereum RPC automatically deduct the ED.
+- New account transfers include ED in transaction fees.
+- Contract-to-contract transfers draw ED from the transaction signer.
+
+You typically don't need to do anything special, but be aware:
+
+- Accounts below ED threshold are automatically deleted.
+- ED is around 0.01 DOT (varies by network).
+- Your contracts don't need to manage this explicitly.
+
+### Can I use my existing development tools?
+
+Yes. Both backends support:
+
+- **Wallets**: [MetaMask](https://metamask.io/){target=\_blank}, [Talisman](https://talisman.xyz/){target=\_blank}, [SubWallet](https://www.subwallet.app/){target=\_blank}
+- **Development frameworks**: [Hardhat](/smart-contracts/cookbook/smart-contracts/deploy-basic/hardhat/){target=\_blank}, [Foundry](/smart-contracts/cookbook/smart-contracts/deploy-basic/foundry/){target=\_blank}, [Remix](/smart-contracts/cookbook/smart-contracts/deploy-basic/remix/){target=\_blank} (just consider that for PVM bytecode, you will use the Polkadot version of the tooling)
+- **Libraries**: [ethers.js](/smart-contracts/libraries/ethers-js/){target=\_blank}, [web3.js](/smart-contracts/libraries/web3-js/){target=\_blank}, [viem](/smart-contracts/libraries/viem/){target=\_blank}
+- **Testing tools**: Your existing test suites work
+
+Connect to Polkadot Hub's Ethereum JSON-RPC endpoint and use your familiar workflow.
+
+## Conclusion
+
+Most Ethereum contracts migrate to Polkadot Hub with minimal or no changes. Use REVM for seamless compatibility or PolkaVM for enhanced performance.
+
+There are a few key points to keep in mind during migration:
+
+- Replace `transfer()` and `send()` with `.call{value}("")` and use reentrancy guards (for projects that will use PVM bytecode, not EVM bytecode).
+- PolkaVM factory contracts using PVM bytecode need pre-uploaded dependencies.
+- Don't hardcode gas values.
+- Test thoroughly on [TestNet](/smart-contracts/connect/#__tabbed_1_1){target=\_blank} before mainnet deployment.
+
+Your existing Solidity knowledge and tooling transfer directly to Polkadot Hub, making migration straightforward for standard smart contract patterns.
diff --git a/.ai/site-index.json b/.ai/site-index.json
index 64e35be44..1f404b896 100644
--- a/.ai/site-index.json
+++ b/.ai/site-index.json
@@ -17,7 +17,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -38,7 +37,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -59,7 +57,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -80,7 +77,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -101,7 +97,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -122,7 +117,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -234,7 +228,6 @@
"estimated_token_count_total": 4830
},
"hash": "sha256:a6bf7623a535e7a9162c0913b07bd59d43c8535025ad8225fb3e5adc83084c7a",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -306,7 +299,6 @@
"estimated_token_count_total": 7755
},
"hash": "sha256:086a87823ab67ceac102358030e316583cd733c0ec326316e7f29061fe7f6934",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -327,7 +319,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -389,7 +380,6 @@
"estimated_token_count_total": 5207
},
"hash": "sha256:91f59a76dd33641ca2b5bf6d58230f65034fa3cc5f8313525fb57e854a878a56",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -481,7 +471,6 @@
"estimated_token_count_total": 2132
},
"hash": "sha256:1b9efd2fe00b251d3b4054c9cfcb55f9b5a1384238eeaca81a6f1542fc36d75c",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -502,7 +491,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -569,7 +557,6 @@
"estimated_token_count_total": 4063
},
"hash": "sha256:bd07cdae71bf63786994865d2f33fba5f7bf8855dce6399414ad44ab0ec6635c",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -626,7 +613,6 @@
"estimated_token_count_total": 2225
},
"hash": "sha256:e916033f54c2874eb5ce9a43d58af058eb935429f73b7b1acc7da1592218e0b8",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -674,7 +660,6 @@
"estimated_token_count_total": 1523
},
"hash": "sha256:d9d85827d2c14bff8dd6b3301617345430cf63db603e37859720713004ecafae",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -694,9 +679,7 @@
"headings": 0,
"estimated_token_count_total": 0
},
- "hash": "sha256:2b017d8a89f8734b9cbb501f03612a22657d2f8d4d85c51e490e4c8ca4bf771b",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
"token_estimator": "heuristic-v1"
},
{
@@ -754,7 +737,6 @@
"estimated_token_count_total": 1635
},
"hash": "sha256:46252e238b0b51105148dc622da6d8809c55ec11da7ec7b2953c35ca52f5f585",
- "last_modified": "2025-10-28T14:42:10+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -797,7 +779,6 @@
"estimated_token_count_total": 1491
},
"hash": "sha256:db37b2f5888f283b5eb5bd84a5f8c81fc66b2313e3f94f510a73dfeb310ae3f0",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -864,7 +845,6 @@
"estimated_token_count_total": 955
},
"hash": "sha256:72ee7394fd1308c111a8d548cb4dc63c6b9bc5b6e2bb556dd1baacbaedb92286",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -916,7 +896,6 @@
"estimated_token_count_total": 876
},
"hash": "sha256:d6cb22337280a19bdf24981dcba98f337d48ee4f79ce7ac040466ef1cb4b330b",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -998,7 +977,6 @@
"estimated_token_count_total": 2744
},
"hash": "sha256:1a2d34ccab19bd71263763bbc294977acf34f5800398f51398753594cfc7d7a6",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -1070,7 +1048,6 @@
"estimated_token_count_total": 608
},
"hash": "sha256:7bba6105d99721373aa6f494627d20af97b1851c19703f26be26c32f0c83524b",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -1137,7 +1114,6 @@
"estimated_token_count_total": 558
},
"hash": "sha256:b79fe56c9604712825bdf30d17667fd8f237fce9691be0d8d042d38691dbba7a",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -1189,7 +1165,58 @@
"estimated_token_count_total": 348
},
"hash": "sha256:11cd8d428fa9c3e70490da5c63ce4597cd89ec46306d2bb49b016ced6aa68c3d",
- "last_modified": "2025-10-28T14:42:11+00:00",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "develop-interoperability-versions-v5",
+ "title": "XCMv5",
+ "slug": "develop-interoperability-versions-v5",
+ "categories": [
+ "Uncategorized"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-interoperability-versions-v5.md",
+ "html_url": "https://docs.polkadot.com/develop/interoperability/versions/v5/",
+ "preview": "The latest iteration of XCM is version 5. The main RFCs defining the changes in version 5 are the following:",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "In This Section",
+ "anchor": "in-this-section"
+ }
+ ],
+ "stats": {
+ "chars": 2970,
+ "words": 438,
+ "headings": 1,
+ "estimated_token_count_total": 12
+ },
+ "hash": "sha256:3821c2ef97699091b76e1de58e6d95e866df69d39fca16f2a15c156b71da5b22",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "develop-interoperability-versions",
+ "title": "XCM Versions",
+ "slug": "develop-interoperability-versions",
+ "categories": [
+ "Uncategorized"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-interoperability-versions.md",
+ "html_url": "https://docs.polkadot.com/develop/interoperability/versions/",
+ "preview": "XCM is a versioned language that evolves to meet the growing needs of cross-chain communication in the Polkadot ecosystem. Understanding XCM versioning is essential for developers building interoperable applications to keep up with the latest improvements.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "In This Section",
+ "anchor": "in-this-section"
+ }
+ ],
+ "stats": {
+ "chars": 835,
+ "words": 114,
+ "headings": 1,
+ "estimated_token_count_total": 12
+ },
+ "hash": "sha256:634e299f347beb8ad690697943bb7f99915d62d40cda4227179619ed18abe2ff",
"token_estimator": "heuristic-v1"
},
{
@@ -1237,7 +1264,6 @@
"estimated_token_count_total": 1365
},
"hash": "sha256:5f8fa89fc725c5c559975012fe2f9ae92c3b62f10024b5688dcd118331118f1a",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -1290,7 +1316,6 @@
"estimated_token_count_total": 4979
},
"hash": "sha256:ed3b7c8101b69f9c907cca7c5edfef67fdb5e7bc3c8df8d9fbad297f9dd3c80a",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -1347,7 +1372,6 @@
"estimated_token_count_total": 1781
},
"hash": "sha256:35c71a215558cd0642d363e4515ad240093995d42720e6495cd2994c859243e4",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -1394,7 +1418,6 @@
"estimated_token_count_total": 1447
},
"hash": "sha256:0e39aee80fbcf3dfaa19133f31d664914ed45b42a1a929270f05d8ae876b89e2",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -1441,7 +1464,6 @@
"estimated_token_count_total": 1082
},
"hash": "sha256:ec82957c768c2c07a272e7a28659c812b223df836e21372b1642f0bb249d7b39",
- "last_modified": "2025-10-28T14:42:11+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -1483,7 +1505,63 @@
"estimated_token_count_total": 4178
},
"hash": "sha256:d480791a76082937b47c77f7cf3794e701f193452ed347fcb1c04c3c67577bf5",
- "last_modified": "2025-10-28T14:42:11+00:00",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "develop-interoperability-xcm-guides-from-apps",
+ "title": "From Apps",
+ "slug": "develop-interoperability-xcm-guides-from-apps",
+ "categories": [
+ "Uncategorized"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-interoperability-xcm-guides-from-apps.md",
+ "html_url": "https://docs.polkadot.com/develop/interoperability/xcm-guides/from-apps/",
+ "preview": "This section shows how to interact with XCM from applications, providing practical guidance for implementing cross-chain functionality in your dApps and services.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "In This Section",
+ "anchor": "in-this-section"
+ }
+ ],
+ "stats": {
+ "chars": 511,
+ "words": 70,
+ "headings": 1,
+ "estimated_token_count_total": 12
+ },
+ "hash": "sha256:63584f5b1dab7b67b18b35b47dfc19d00ad5c013804772f0d653a11ac3fca38d",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "develop-interoperability-xcm-guides",
+ "title": "XCM Guides",
+ "slug": "develop-interoperability-xcm-guides",
+ "categories": [
+ "Uncategorized"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-interoperability-xcm-guides.md",
+ "html_url": "https://docs.polkadot.com/develop/interoperability/xcm-guides/",
+ "preview": "This section provides comprehensive guides for implementing XCM functionality, including application development patterns, fee management, asset transfers, and cross-chain transaction handling.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "In This Section",
+ "anchor": "in-this-section"
+ },
+ {
+ "depth": 2,
+ "title": "Additional Resources",
+ "anchor": "additional-resources"
+ }
+ ],
+ "stats": {
+ "chars": 1663,
+ "words": 215,
+ "headings": 2,
+ "estimated_token_count_total": 340
+ },
+ "hash": "sha256:d4c2d7fd46ddf60f638f948c88ba3940de6d69f140923ba8df52ed787b0afede",
"token_estimator": "heuristic-v1"
},
{
@@ -1551,7 +1629,37 @@
"estimated_token_count_total": 6510
},
"hash": "sha256:353ad782303ef79bce1262bfa945e6f11b3c3c9ca1edf5705b778c46bada6200",
- "last_modified": "2025-10-28T14:42:12+00:00",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "develop-interoperability",
+ "title": "Interoperability",
+ "slug": "develop-interoperability",
+ "categories": [
+ "Uncategorized"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-interoperability.md",
+ "html_url": "https://docs.polkadot.com/develop/interoperability/",
+ "preview": "This section covers everything you need to know about building and implementing [Cross-Consensus Messaging (XCM)](/parachains/interoperability/get-started/){target=\\_blank} solutions in the Polkadot ecosystem. Whether you're working on establishing cross-chain channels, sending and receiving XCM messages, or testing and debugging your cross-chain configurations, you'll find the essential resources and tools here to support your interoperability needs, regardless of your development focus.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "In This Section",
+ "anchor": "in-this-section"
+ },
+ {
+ "depth": 2,
+ "title": "Additional Resources",
+ "anchor": "additional-resources"
+ }
+ ],
+ "stats": {
+ "chars": 2363,
+ "words": 323,
+ "headings": 2,
+ "estimated_token_count_total": 402
+ },
+ "hash": "sha256:5da6bdeec1deee5ef3d7ab1a43f546067bcef91acdc67df4ce114ee8f8669e82",
"token_estimator": "heuristic-v1"
},
{
@@ -1614,19 +1722,19 @@
"estimated_token_count_total": 1520
},
"hash": "sha256:ed09ef7a6abe21204006186fd5791ada7597688fad67e30244dc449c51330309",
- "last_modified": "2025-10-28T14:42:12+00:00",
"token_estimator": "heuristic-v1"
},
{
- "id": "develop-parachains-customize-parachain-add-existing-pallets",
- "title": "Add a Pallet to the Runtime",
- "slug": "develop-parachains-customize-parachain-add-existing-pallets",
+ "id": "develop-parachains-customize-parachain-overview",
+ "title": "Overview of FRAME",
+ "slug": "develop-parachains-customize-parachain-overview",
"categories": [
+ "Basics",
"Parachains"
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-customize-parachain-add-existing-pallets.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/customize-parachain/add-existing-pallets/",
- "preview": "The [Polkadot SDK Solochain Template](https://github.com/paritytech/polkadot-sdk-solochain-template){target=\\_blank} provides a functional runtime that includes default FRAME development modules (pallets) to help you get started with building a custom blockchain.",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-customize-parachain-overview.md",
+ "html_url": "https://docs.polkadot.com/develop/parachains/customize-parachain/overview/",
+ "preview": "The runtime is the heart of any Polkadot SDK-based blockchain, handling the essential logic that governs state changes and transaction processing. With Polkadot SDK’s [FRAME (Framework for Runtime Aggregation of Modularized Entities)](/reference/glossary/#frame-framework-for-runtime-aggregation-of-modularized-entities){target=\\_bank}, developers gain access to a powerful suite of tools for building custom blockchain runtimes. FRAME offers a modular architecture, featuring reusable pallets and su",
"outline": [
{
"depth": 2,
@@ -1635,91 +1743,38 @@
},
{
"depth": 2,
- "title": "Configuring Runtime Dependencies",
- "anchor": "configuring-runtime-dependencies"
- },
- {
- "depth": 2,
- "title": "Dependencies for a New Pallet",
- "anchor": "dependencies-for-a-new-pallet"
- },
- {
- "depth": 2,
- "title": "Config Trait for Pallets",
- "anchor": "config-trait-for-pallets"
+ "title": "FRAME Runtime Architecture",
+ "anchor": "frame-runtime-architecture"
},
{
"depth": 3,
- "title": "Utility Pallet Example",
- "anchor": "utility-pallet-example"
- },
- {
- "depth": 2,
- "title": "Parameter Configuration for Pallets",
- "anchor": "parameter-configuration-for-pallets"
- },
- {
- "depth": 2,
- "title": "Pallet Config in the Runtime",
- "anchor": "pallet-config-in-the-runtime"
+ "title": "Pallets",
+ "anchor": "pallets"
},
{
- "depth": 2,
- "title": "Where to Go Next",
- "anchor": "where-to-go-next"
- }
- ],
- "stats": {
- "chars": 11939,
- "words": 1615,
- "headings": 8,
- "estimated_token_count_total": 2598
- },
- "hash": "sha256:b2b3d8c048863e7760f633b12ab2a0202c741be3050ea4beafb9a7265cfe96b5",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "token_estimator": "heuristic-v1"
- },
- {
- "id": "develop-parachains-customize-parachain-add-pallet-instances",
- "title": "Add Multiple Pallet Instances",
- "slug": "develop-parachains-customize-parachain-add-pallet-instances",
- "categories": [
- "Parachains"
- ],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-customize-parachain-add-pallet-instances.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/customize-parachain/add-pallet-instances/",
- "preview": "Running multiple instances of the same pallet within a runtime is a powerful technique in Polkadot SDK development. This approach lets you reuse pallet functionality without reimplementing it, enabling diverse use cases with the same codebase. The Polkadot SDK provides developer-friendly traits for creating instantiable pallets and, in most cases, handles unique storage allocation for different instances automatically. This guide teaches you how to implement and configure multiple instances of a",
- "outline": [
- {
- "depth": 2,
- "title": "Introduction",
- "anchor": "introduction"
+ "depth": 3,
+ "title": "Support Libraries",
+ "anchor": "support-libraries"
},
{
"depth": 2,
- "title": "Understanding Instantiable Pallets",
- "anchor": "understanding-instantiable-pallets"
+ "title": "Compose a Runtime with Pallets",
+ "anchor": "compose-a-runtime-with-pallets"
},
{
"depth": 2,
- "title": "Adding Instantiable Pallets to Your Runtime",
- "anchor": "adding-instantiable-pallets-to-your-runtime"
- },
- {
- "depth": 3,
- "title": "Define Pallet Parameters",
- "anchor": "define-pallet-parameters"
+ "title": "Starting from Templates",
+ "anchor": "starting-from-templates"
},
{
"depth": 3,
- "title": "Configure the Pallet Instances",
- "anchor": "configure-the-pallet-instances"
+ "title": "Solochain Templates",
+ "anchor": "solochain-templates"
},
{
"depth": 3,
- "title": "Add Pallet Instances to the Runtime",
- "anchor": "add-pallet-instances-to-the-runtime"
+ "title": "Parachain Templates",
+ "anchor": "parachain-templates"
},
{
"depth": 2,
@@ -1728,69 +1783,55 @@
}
],
"stats": {
- "chars": 6294,
- "words": 729,
- "headings": 7,
- "estimated_token_count_total": 1219
+ "chars": 9427,
+ "words": 1267,
+ "headings": 9,
+ "estimated_token_count_total": 2019
},
- "hash": "sha256:262e7a3ad3d0a0102897c52c7589e3f94c7827c441398b3b446b205f6c6753d3",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:d03ea172f2af9f4648e730d60033a80c2c1e64efa9241fed0c1ba40a5f846ae5",
"token_estimator": "heuristic-v1"
},
{
- "id": "develop-parachains-customize-parachain-add-smart-contract-functionality",
- "title": "Add Smart Contract Functionality",
- "slug": "develop-parachains-customize-parachain-add-smart-contract-functionality",
+ "id": "develop-parachains-customize-parachain",
+ "title": "Customize Your Parachain",
+ "slug": "develop-parachains-customize-parachain",
"categories": [
- "Parachains"
+ "Uncategorized"
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-customize-parachain-add-smart-contract-functionality.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/customize-parachain/add-smart-contract-functionality/",
- "preview": "When building your custom blockchain with the Polkadot SDK, you have the flexibility to add smart contract capabilities through specialized pallets. These pallets allow blockchain users to deploy and execute smart contracts, enhancing your chain's functionality and programmability.",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-customize-parachain.md",
+ "html_url": "https://docs.polkadot.com/develop/parachains/customize-parachain/",
+ "preview": "Learn how to build a custom parachain with Polkadot SDK's FRAME framework, which includes pallet development, testing, smart contracts, and runtime customization. Pallets are modular components within the FRAME ecosystem that contain specific blockchain functionalities. This modularity grants developers increased flexibility and control around which behaviors to include in the core logic of their parachain.",
"outline": [
{
"depth": 2,
- "title": "Introduction",
- "anchor": "introduction"
- },
- {
- "depth": 2,
- "title": "EVM Smart Contracts",
- "anchor": "evm-smart-contracts"
- },
- {
- "depth": 2,
- "title": "Wasm Smart Contracts",
- "anchor": "wasm-smart-contracts"
+ "title": "In This Section",
+ "anchor": "in-this-section"
},
{
"depth": 2,
- "title": "Where to Go Next",
- "anchor": "where-to-go-next"
+ "title": "Additional Resources",
+ "anchor": "additional-resources"
}
],
"stats": {
- "chars": 3896,
- "words": 523,
- "headings": 4,
- "estimated_token_count_total": 905
+ "chars": 1899,
+ "words": 259,
+ "headings": 2,
+ "estimated_token_count_total": 335
},
- "hash": "sha256:ad8e6d9c77d5451c5f4d17f8e6311b21e6ad24eae8780fd4c3ae6013744822cf",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:9a08b66442c564c7116c686d8914b74ad617326f450d0894b05e753462f69aac",
"token_estimator": "heuristic-v1"
},
{
- "id": "develop-parachains-customize-parachain-make-custom-pallet",
- "title": "Make a Custom Pallet",
- "slug": "develop-parachains-customize-parachain-make-custom-pallet",
+ "id": "develop-parachains-deployment-build-deterministic-runtime",
+ "title": "Build a deterministic runtime",
+ "slug": "develop-parachains-deployment-build-deterministic-runtime",
"categories": [
"Parachains"
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-customize-parachain-make-custom-pallet.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/customize-parachain/make-custom-pallet/",
- "preview": "FRAME provides a powerful set of tools for blockchain development, including a library of pre-built pallets. However, its true strength lies in the ability to create custom pallets tailored to your specific needs. This section will guide you through creating your own custom pallet, allowing you to extend your blockchain's functionality in unique ways.",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-deployment-build-deterministic-runtime.md",
+ "html_url": "https://docs.polkadot.com/develop/parachains/deployment/build-deterministic-runtime/",
+ "preview": "By default, the Rust compiler produces optimized Wasm binaries. These binaries are suitable for working in an isolated environment, such as local development. However, the Wasm binaries the compiler builds by default aren't guaranteed to be deterministically reproducible. Each time the compiler generates the Wasm runtime, it might produce a slightly different Wasm byte code. This is problematic in a blockchain network where all nodes must use exactly the same raw chain specification file.",
"outline": [
{
"depth": 2,
@@ -1799,67 +1840,64 @@
},
{
"depth": 2,
- "title": "Initial Setup",
- "anchor": "initial-setup"
+ "title": "Prerequisites",
+ "anchor": "prerequisites"
},
{
"depth": 2,
- "title": "Pallet Configuration",
- "anchor": "pallet-configuration"
+ "title": "Tooling for Wasm Runtime",
+ "anchor": "tooling-for-wasm-runtime"
},
{
"depth": 2,
- "title": "Pallet Events",
- "anchor": "pallet-events"
+ "title": "Working with the Docker Container",
+ "anchor": "working-with-the-docker-container"
},
{
"depth": 2,
- "title": "Pallet Errors",
- "anchor": "pallet-errors"
+ "title": "Prepare the Environment",
+ "anchor": "prepare-the-environment"
},
{
"depth": 2,
- "title": "Pallet Storage",
- "anchor": "pallet-storage"
+ "title": "Start a Deterministic Build",
+ "anchor": "start-a-deterministic-build"
},
{
"depth": 2,
- "title": "Pallet Dispatchable Extrinsics",
- "anchor": "pallet-dispatchable-extrinsics"
+ "title": "Use srtool in GitHub Actions",
+ "anchor": "use-srtool-in-github-actions"
},
{
"depth": 2,
- "title": "Pallet Implementation Overview",
- "anchor": "pallet-implementation-overview"
+ "title": "Use the srtool Image via Docker Hub",
+ "anchor": "use-the-srtool-image-via-docker-hub"
},
{
- "depth": 2,
- "title": "Where to Go Next",
- "anchor": "where-to-go-next"
+ "depth": 3,
+ "title": "Naming Convention for Images",
+ "anchor": "naming-convention-for-images"
}
],
"stats": {
- "chars": 17824,
- "words": 2311,
+ "chars": 8470,
+ "words": 1227,
"headings": 9,
- "estimated_token_count_total": 3995
+ "estimated_token_count_total": 1944
},
- "hash": "sha256:19997d390abf2847824024ba923f46a61106ef77544d256d50b371210816b309",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:4fc8cab40e982e860b64d9aede1058fe7fa82ec321ac215b919db00c4df0a9c0",
"token_estimator": "heuristic-v1"
},
{
- "id": "develop-parachains-customize-parachain-overview",
- "title": "Overview of FRAME",
- "slug": "develop-parachains-customize-parachain-overview",
+ "id": "develop-parachains-deployment-coretime-renewal",
+ "title": "Coretime Renewal",
+ "slug": "develop-parachains-deployment-coretime-renewal",
"categories": [
- "Basics",
"Parachains"
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-customize-parachain-overview.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/customize-parachain/overview/",
- "preview": "The runtime is the heart of any Polkadot SDK-based blockchain, handling the essential logic that governs state changes and transaction processing. With Polkadot SDK’s [FRAME (Framework for Runtime Aggregation of Modularized Entities)](/reference/glossary/#frame-framework-for-runtime-aggregation-of-modularized-entities){target=\\_bank}, developers gain access to a powerful suite of tools for building custom blockchain runtimes. FRAME offers a modular architecture, featuring reusable pallets and su",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-deployment-coretime-renewal.md",
+ "html_url": "https://docs.polkadot.com/develop/parachains/deployment/coretime-renewal/",
+ "preview": "Coretime can be purchased in bulk for a period of 28 days, providing access to Polkadot's shared security and interoperability for Polkadot parachains. The bulk purchase of coretime includes a rent-control mechanism that keeps future purchases within a predictable price range of the initial purchase. This allows cores to be renewed at a known price without competing against other participants in the open market.",
"outline": [
{
"depth": 2,
@@ -1868,157 +1906,23 @@
},
{
"depth": 2,
- "title": "FRAME Runtime Architecture",
- "anchor": "frame-runtime-architecture"
- },
- {
- "depth": 3,
- "title": "Pallets",
- "anchor": "pallets"
+ "title": "Bulk Sale Phases",
+ "anchor": "bulk-sale-phases"
},
{
- "depth": 3,
- "title": "Support Libraries",
- "anchor": "support-libraries"
+ "depth": 2,
+ "title": "Renewal Timing",
+ "anchor": "renewal-timing"
},
{
"depth": 2,
- "title": "Compose a Runtime with Pallets",
- "anchor": "compose-a-runtime-with-pallets"
+ "title": "Manual Renewal",
+ "anchor": "manual-renewal"
},
{
"depth": 2,
- "title": "Starting from Templates",
- "anchor": "starting-from-templates"
- },
- {
- "depth": 3,
- "title": "Solochain Templates",
- "anchor": "solochain-templates"
- },
- {
- "depth": 3,
- "title": "Parachain Templates",
- "anchor": "parachain-templates"
- },
- {
- "depth": 2,
- "title": "Where to Go Next",
- "anchor": "where-to-go-next"
- }
- ],
- "stats": {
- "chars": 9427,
- "words": 1267,
- "headings": 9,
- "estimated_token_count_total": 2019
- },
- "hash": "sha256:0becb82886d34e2ed23d963efd2c14120112e6e080ea4072e864531299b59753",
- "last_modified": "2025-10-28T14:42:12+00:00",
- "token_estimator": "heuristic-v1"
- },
- {
- "id": "develop-parachains-deployment-build-deterministic-runtime",
- "title": "Build a deterministic runtime",
- "slug": "develop-parachains-deployment-build-deterministic-runtime",
- "categories": [
- "Parachains"
- ],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-deployment-build-deterministic-runtime.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/deployment/build-deterministic-runtime/",
- "preview": "By default, the Rust compiler produces optimized Wasm binaries. These binaries are suitable for working in an isolated environment, such as local development. However, the Wasm binaries the compiler builds by default aren't guaranteed to be deterministically reproducible. Each time the compiler generates the Wasm runtime, it might produce a slightly different Wasm byte code. This is problematic in a blockchain network where all nodes must use exactly the same raw chain specification file.",
- "outline": [
- {
- "depth": 2,
- "title": "Introduction",
- "anchor": "introduction"
- },
- {
- "depth": 2,
- "title": "Prerequisites",
- "anchor": "prerequisites"
- },
- {
- "depth": 2,
- "title": "Tooling for Wasm Runtime",
- "anchor": "tooling-for-wasm-runtime"
- },
- {
- "depth": 2,
- "title": "Working with the Docker Container",
- "anchor": "working-with-the-docker-container"
- },
- {
- "depth": 2,
- "title": "Prepare the Environment",
- "anchor": "prepare-the-environment"
- },
- {
- "depth": 2,
- "title": "Start a Deterministic Build",
- "anchor": "start-a-deterministic-build"
- },
- {
- "depth": 2,
- "title": "Use srtool in GitHub Actions",
- "anchor": "use-srtool-in-github-actions"
- },
- {
- "depth": 2,
- "title": "Use the srtool Image via Docker Hub",
- "anchor": "use-the-srtool-image-via-docker-hub"
- },
- {
- "depth": 3,
- "title": "Naming Convention for Images",
- "anchor": "naming-convention-for-images"
- }
- ],
- "stats": {
- "chars": 8470,
- "words": 1227,
- "headings": 9,
- "estimated_token_count_total": 1944
- },
- "hash": "sha256:4fc8cab40e982e860b64d9aede1058fe7fa82ec321ac215b919db00c4df0a9c0",
- "last_modified": "2025-10-28T14:42:12+00:00",
- "token_estimator": "heuristic-v1"
- },
- {
- "id": "develop-parachains-deployment-coretime-renewal",
- "title": "Coretime Renewal",
- "slug": "develop-parachains-deployment-coretime-renewal",
- "categories": [
- "Parachains"
- ],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-deployment-coretime-renewal.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/deployment/coretime-renewal/",
- "preview": "Coretime can be purchased in bulk for a period of 28 days, providing access to Polkadot's shared security and interoperability for Polkadot parachains. The bulk purchase of coretime includes a rent-control mechanism that keeps future purchases within a predictable price range of the initial purchase. This allows cores to be renewed at a known price without competing against other participants in the open market.",
- "outline": [
- {
- "depth": 2,
- "title": "Introduction",
- "anchor": "introduction"
- },
- {
- "depth": 2,
- "title": "Bulk Sale Phases",
- "anchor": "bulk-sale-phases"
- },
- {
- "depth": 2,
- "title": "Renewal Timing",
- "anchor": "renewal-timing"
- },
- {
- "depth": 2,
- "title": "Manual Renewal",
- "anchor": "manual-renewal"
- },
- {
- "depth": 2,
- "title": "Auto-Renewal",
- "anchor": "auto-renewal"
+ "title": "Auto-Renewal",
+ "anchor": "auto-renewal"
},
{
"depth": 3,
@@ -2053,7 +1957,6 @@
"estimated_token_count_total": 3068
},
"hash": "sha256:9918593a46c12a1756552ddfaf7421ad6262600735b6f1fec030911420fe1736",
- "last_modified": "2025-10-28T14:42:12+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -2135,7 +2038,6 @@
"estimated_token_count_total": 3025
},
"hash": "sha256:a60fe36a5ba6d1cafe12eab75300afd24a46d3ace1e791087adb7e3e538afcc3",
- "last_modified": "2025-10-28T14:42:12+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -2187,7 +2089,6 @@
"estimated_token_count_total": 1289
},
"hash": "sha256:39c58dbe2ddcd542d7074d08d72f1811318dc8a3130419025480fd5cbe9fc3e7",
- "last_modified": "2025-10-28T14:42:12+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -2223,152 +2124,7 @@
"headings": 3,
"estimated_token_count_total": 966
},
- "hash": "sha256:358ed14147b96b47deb61df9a1ea0e1103a139ea5edb78c5d50a48d5a779b80d",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "token_estimator": "heuristic-v1"
- },
- {
- "id": "develop-parachains-install-polkadot-sdk",
- "title": "Install Polkadot SDK Dependencies",
- "slug": "develop-parachains-install-polkadot-sdk",
- "categories": [
- "Basics",
- "Tooling"
- ],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-install-polkadot-sdk.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/install-polkadot-sdk/",
- "preview": "This guide provides step-by-step instructions for installing the dependencies you need to work with the Polkadot SDK-based chains on macOS, Linux, and Windows. Follow the appropriate section for your operating system to ensure all necessary tools are installed and configured properly.",
- "outline": [
- {
- "depth": 2,
- "title": "macOS",
- "anchor": "macos"
- },
- {
- "depth": 3,
- "title": "Before You Begin",
- "anchor": "before-you-begin"
- },
- {
- "depth": 3,
- "title": "Install Required Packages and Rust",
- "anchor": "install-required-packages-and-rust"
- },
- {
- "depth": 2,
- "title": "Linux",
- "anchor": "linux"
- },
- {
- "depth": 3,
- "title": "Before You Begin {: #before-you-begin-linux }",
- "anchor": "before-you-begin-before-you-begin-linux"
- },
- {
- "depth": 3,
- "title": "Install Required Packages and Rust {: #install-required-packages-and-rust-linux }",
- "anchor": "install-required-packages-and-rust-install-required-packages-and-rust-linux"
- },
- {
- "depth": 2,
- "title": "Windows (WSL)",
- "anchor": "windows-wsl"
- },
- {
- "depth": 3,
- "title": "Before You Begin {: #before-you-begin-windows }",
- "anchor": "before-you-begin-before-you-begin-windows"
- },
- {
- "depth": 3,
- "title": "Set Up Windows Subsystem for Linux",
- "anchor": "set-up-windows-subsystem-for-linux"
- },
- {
- "depth": 3,
- "title": "Install Required Packages and Rust {: #install-required-packages-and-rust-windows }",
- "anchor": "install-required-packages-and-rust-install-required-packages-and-rust-windows"
- },
- {
- "depth": 2,
- "title": "Verifying Installation",
- "anchor": "verifying-installation"
- },
- {
- "depth": 2,
- "title": "Where to Go Next",
- "anchor": "where-to-go-next"
- }
- ],
- "stats": {
- "chars": 12756,
- "words": 1840,
- "headings": 12,
- "estimated_token_count_total": 2709
- },
- "hash": "sha256:2ee5656f749b4bca445172f2bc66c7fc39af40ff173626662ae4c399f49cf909",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "token_estimator": "heuristic-v1"
- },
- {
- "id": "develop-parachains-intro-polkadot-sdk",
- "title": "Introduction to Polkadot SDK",
- "slug": "develop-parachains-intro-polkadot-sdk",
- "categories": [
- "Basics",
- "Tooling"
- ],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-intro-polkadot-sdk.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/intro-polkadot-sdk/",
- "preview": "The [Polkadot SDK](https://github.com/paritytech/polkadot-sdk/tree/polkadot-stable2506-2){target=\\_blank} is a powerful and versatile developer kit designed to facilitate building on the Polkadot network. It provides the necessary components for creating custom blockchains, parachains, generalized rollups, and more. Written in the Rust programming language, it puts security and robustness at the forefront of its design.",
- "outline": [
- {
- "depth": 2,
- "title": "Introduction",
- "anchor": "introduction"
- },
- {
- "depth": 2,
- "title": "Polkadot SDK Overview",
- "anchor": "polkadot-sdk-overview"
- },
- {
- "depth": 3,
- "title": "Substrate",
- "anchor": "substrate"
- },
- {
- "depth": 3,
- "title": "FRAME",
- "anchor": "frame"
- },
- {
- "depth": 3,
- "title": "Cumulus",
- "anchor": "cumulus"
- },
- {
- "depth": 2,
- "title": "Why Use Polkadot SDK?",
- "anchor": "why-use-polkadot-sdk"
- },
- {
- "depth": 2,
- "title": "Create a Custom Blockchain Using the SDK",
- "anchor": "create-a-custom-blockchain-using-the-sdk"
- }
- ],
- "stats": {
- "chars": 8758,
- "words": 1156,
- "headings": 7,
- "estimated_token_count_total": 1892
- },
- "hash": "sha256:74de798c287cae75729e7db54019507f03a361dbbd1f2bb58c4694605f83efab",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:b25618dc598f4f946da06f854211645768214e0b51d06b684b0cab668b66124c",
"token_estimator": "heuristic-v1"
},
{
@@ -2420,7 +2176,6 @@
"estimated_token_count_total": 4719
},
"hash": "sha256:bfad885d8053d052c55dbffc3c09e6196586795c3a1d07ab6ad58f9006ec3345",
- "last_modified": "2025-10-28T14:42:12+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -2482,7 +2237,6 @@
"estimated_token_count_total": 1819
},
"hash": "sha256:b0c1535fa8e969a9bdeee426a5a35a42b4649121fb8ce6fd2b15fdeba35b5d5f",
- "last_modified": "2025-10-28T14:42:12+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -2513,9 +2267,7 @@
"headings": 2,
"estimated_token_count_total": 236
},
- "hash": "sha256:07e63e1e99b9acf1cc3b5ef8fa1f06ff22182b2a801582ce800eba37d7d39408",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:3b0a9e8037c7634c33ac6674170bd763599fca914855d9d2fbf490d359140130",
"token_estimator": "heuristic-v1"
},
{
@@ -2546,9 +2298,7 @@
"headings": 2,
"estimated_token_count_total": 211
},
- "hash": "sha256:55dc252fdecf1590048ce8d009b822e90231442abe81e9593cf1635944a31336",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:0ce1fe38de00827a0735b9fa8076492205c2450c61da9fbd1937d9f38cfe7825",
"token_estimator": "heuristic-v1"
},
{
@@ -2579,604 +2329,591 @@
"headings": 2,
"estimated_token_count_total": 330
},
- "hash": "sha256:f4964f894f7cd2fdfd699c017b4bd25cffc322b03a5a88a36c682cf952832ccc",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:75a6fa2f21b67009be62e07bab01655a10b2c35a5292dc1f7ca57df846d709f3",
"token_estimator": "heuristic-v1"
},
{
- "id": "develop-parachains-testing-benchmarking",
- "title": "Benchmarking FRAME Pallets",
- "slug": "develop-parachains-testing-benchmarking",
+ "id": "develop-smart-contracts-connect-to-kusama",
+ "title": "Connect to Kusama",
+ "slug": "develop-smart-contracts-connect-to-kusama",
"categories": [
- "Parachains"
+ "Uncategorized"
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-parachains-testing-benchmarking.md",
- "html_url": "https://docs.polkadot.com/develop/parachains/testing/benchmarking/",
- "preview": "Benchmarking is a critical component of developing efficient and secure blockchain runtimes. In the Polkadot ecosystem, accurately benchmarking your custom pallets ensures that each extrinsic has a precise [weight](/polkadot-protocol/glossary/#weight){target=\\_blank}, representing its computational and storage demands. This process is vital for maintaining the blockchain's performance and preventing potential vulnerabilities, such as Denial of Service (DoS) attacks.",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/develop-smart-contracts-connect-to-kusama.md",
+ "html_url": "https://docs.polkadot.com/develop/smart-contracts/connect-to-kusama/",
+ "preview": "!!! smartcontract \"PolkaVM Preview Release\" PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**.
\n\n- Tutorial __Register a Local Asset__\n\n ---\n\n Comprehensive guide to registering a local asset on the Asset Hub system parachain, including step-by-step instructions.\n\n [:octicons-arrow-right-24: Reference](/chain-interactions/token-operations/register-local-asset/)\n\n- Tutorial __Register a Foreign Asset__\n\n ---\n\n An in-depth guide to registering a foreign asset on the Asset Hub parachain, providing clear, step-by-step instructions.\n\n [:octicons-arrow-right-24: Reference](/chain-interactions/token-operations/register-foreign-asset/)\n\n- Tutorial __Convert Assets__\n\n ---\n\n A guide detailing the step-by-step process of converting assets on Asset Hub, helping users efficiently navigate asset management on the platform.\n\n [:octicons-arrow-right-24: Reference](/chain-interactions/token-operations/convert-assets/)\n\n
"}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 0, "depth": 2, "title": "Introduction", "anchor": "introduction", "start_char": 26, "end_char": 608, "estimated_token_count": 106, "token_estimator": "heuristic-v1", "text": "## Introduction\n\nPolkadot Hub is Polkadot's system parachain for issuing and managing on-chain assets. While the relay chain provides security, Polkadot Hub handles asset logic—minting, burning, transfers, and metadata—efficiently and cost-effectively.\n\nPolkadot Hub supports native assets issued on the parachain and foreign assets from other chains, both of which can move seamlessly across the network via XCM.\n\nThis guide explains how assets are created, managed, and moved across chains, including key operations, roles, and the differences between native and foreign assets."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 1, "depth": 2, "title": "Why Use Polkadot Hub?", "anchor": "why-use-polkadot-hub", "start_char": 608, "end_char": 1475, "estimated_token_count": 198, "token_estimator": "heuristic-v1", "text": "## Why Use Polkadot Hub?\n\nPolkadot Hub provides a standardized framework for creating and managing fungible and non-fungible assets. Projects can issue tokens, manage supply, and transfer assets across parachains, extending the functionality of the Polkadot relay chain, which only supports its native token (DOT).\n\n**Key features**:\n\n- **Built-in asset operations**: Mint, burn, and transfer like ERC-20 on Ethereum, but native to Polkadot's runtime.\n- **Custom asset creation**: Issue tokens or NFTs with configurable permissions and metadata.\n- **Low fees**: Transactions cost roughly one-tenth of relay chain fees.\n- **Lower deposits**: Minimal on-chain storage costs for asset data.\n- **Pay fees in any asset**: Users don’t need DOT to transact; supported assets can cover fees.\n- **Cross-chain ready**: Assets can be transferred to other parachains using XCM."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 2, "depth": 2, "title": "Types of Assets", "anchor": "types-of-assets", "start_char": 1475, "end_char": 1939, "estimated_token_count": 91, "token_estimator": "heuristic-v1", "text": "## Types of Assets\n\nPolkadot Hub supports two types of assets:\n\n- **Native assets**: Tokens and NFTs issued directly on Polkadot Hub using the Assets pallet. These assets benefit from the platform's custom features, such as configurable permissions and low fees\n- **Foreign assets**: Tokens originating from other Polkadot parachains or external networks (like Ethereum, via bridges). Once registered on Polkadot Hub, they are treated similarly to native assets."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 3, "depth": 2, "title": "Asset Structure", "anchor": "asset-structure", "start_char": 1939, "end_char": 2462, "estimated_token_count": 104, "token_estimator": "heuristic-v1", "text": "## Asset Structure\n\nEach asset is identified by a unique ID and stores:\n\n- Asset administrators\n- Total supply and holder count\n- Minimum balance configuration\n- Sufficiency–whether the asset can keep an account alive without DOT\n- Metadata (name, symbol, decimals)\n\nIf a balance falls below the configured minimum, called the [existential deposit](/reference/glossary/#existential-deposit){target=\\_blank}, it may be removed as “dust.” This ensures efficient storage while giving developers control over asset economics."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 4, "depth": 2, "title": "How Native Assets Work", "anchor": "how-native-assets-work", "start_char": 2462, "end_char": 3038, "estimated_token_count": 111, "token_estimator": "heuristic-v1", "text": "## How Native Assets Work\n\nNative assets on Polkadot Hub are created and managed via the Assets pallet from the Polkadot SDK. This pallet defines the runtime logic for issuing, configuring, and administering fungible assets with customizable permissions.\n\nIt supports both permissioned and permissionless asset creation, enabling everything from simple user-issued tokens to governed assets controlled by teams or DAOs.\n\nFor implementation details, see the [Assets Pallet Rust docs](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/index.html){target=\\_blank}."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 5, "depth": 3, "title": "Asset Operations", "anchor": "asset-operations", "start_char": 3038, "end_char": 4095, "estimated_token_count": 243, "token_estimator": "heuristic-v1", "text": "### Asset Operations\n\nThe Assets pallet provides both state-changing operations and read-only queries for full lifecycle management of assets.\n\nCore operations include:\n\n- **Asset issuance**: Create new assets and assign initial supply.\n- **Transfers**: Move assets between accounts with balance tracking.\n- **Burning**: Reduce total supply by destroying tokens.\n- **Delegated transfers**: Approve transfers on behalf of another account without giving up custody.\n- **Freezing and thawing**: Temporarily lock and unlock an account's balance.\n\nFor a complete list of extrinsics, see the [`pallet-assets` dispatchable functions reference](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/enum.Call.html){target=\\_blank}.\n\nData queries make it possible to:\n\n- Check account balances and total supply.\n- Retrieve asset metadata and configuration details.\n- Inspect account and asset status on-chain.\n\nFor a full list of queries, see the [Pallet reference](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/struct.Pallet.html){target=\\_blank}."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 6, "depth": 3, "title": "Roles and Permissions", "anchor": "roles-and-permissions", "start_char": 4095, "end_char": 4891, "estimated_token_count": 159, "token_estimator": "heuristic-v1", "text": "### Roles and Permissions\n\nThe Assets pallet uses role-based permissions to control who can manage different parts of an asset’s lifecycle:\n\n- **Owner**: Overarching control, including destroying an asset class; can set or update Issuer, Freezer, and Admin roles.\n- **Admin**: Can freeze assets and forcibly transfer balances between accounts. Admins can also reduce the balance of an asset class across arbitrary accounts.\n- **Issuer**: Responsible for minting new tokens. When new assets are created, the Issuer is the account that controls their distribution to other accounts.\n- **Freezer**: Can lock the transfer of assets from an account, preventing the account holder from moving their balance.\n\nThese roles allow projects to enforce governance and security policies around their assets."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 7, "depth": 3, "title": "Freezing Assets", "anchor": "freezing-assets", "start_char": 4891, "end_char": 5413, "estimated_token_count": 106, "token_estimator": "heuristic-v1", "text": "### Freezing Assets\n\nAssets can be temporarily locked to prevent transfers from specific accounts. This is useful for dispute resolution, fraud prevention, or compliance controls.\n\n**How it works**:\n\n- Only authorized parties can freeze or unfreeze (thaw) assets.\n- Freezing pauses the movement of the asset without burning or removing it.\n- Once thawed, the asset can be transferred normally.\n\nFreezing provides a safe way to control asset flow while maintaining full ownership.\n\n**Key functions**: `freeze` and `thaw`."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 8, "depth": 3, "title": "Delegated Transfers", "anchor": "delegated-transfers", "start_char": 5413, "end_char": 6148, "estimated_token_count": 138, "token_estimator": "heuristic-v1", "text": "### Delegated Transfers\n\nPolkadot Hub supports delegated asset transfers, allowing one account to authorize another to move a limited amount of its assets—without giving up full control. This is useful for escrow logic, automated payments, and multi-party applications.\n\n**How it works**:\n\n- An account can grant permission to another account to transfer a specific amount of its assets.\n- Permissions can be revoked at any time, preventing further transfers.\n- Authorized accounts can execute transfers on behalf of the original owner within the approved limits.\n\nDelegated transfers simplify multi-step transactions and enable complex asset flows.\n\n**Key functions**: `approve_transfer`, `cancel_approval`, and `transfer_approved`."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 9, "depth": 2, "title": "How Foreign Assets Work", "anchor": "how-foreign-assets-work", "start_char": 6148, "end_char": 7010, "estimated_token_count": 157, "token_estimator": "heuristic-v1", "text": "## How Foreign Assets Work\n\nForeign assets are assets originating from other chains and are managed on Polkadot Hub via an instance of the Assets pallet that is configured specifically for foreign assets. It enables transfers, balance checks, and other standard asset operations, while handling foreign-asset specifics such as:\n\n- **Asset identifiers**: Foreign assets use an XCM multilocation as their identifier, rather than a numeric AssetId. This ensures assets from different chains can be referenced and moved safely across parachains.\n\n- **Transfers**: Once registered on Polkadot Hub, foreign assets can be transferred between accounts just like native assets. If supported, they can also be returned to their original blockchain using cross-chain messaging.\n\nThis unified interface makes it easy for dApps to handle both native and cross-chain assets."}
+{"page_id": "reference-polkadot-hub-assets", "page_title": "Polkadot Hub Assets", "index": 10, "depth": 2, "title": "Moving Assets Across Chains", "anchor": "moving-assets-across-chains", "start_char": 7010, "end_char": 7397, "estimated_token_count": 72, "token_estimator": "heuristic-v1", "text": "## Moving Assets Across Chains\n\nPolkadot Hub enables assets to move safely between parachains and the relay chain using XCM (Cross-Consensus Messaging). XCM ensures assets can move securely between chains while preserving ownership and traceability\n\nTo learn more about asset transfers with XCM, please refer to the [Introduction to XCM](/parachains/interoperability/get-started/) page."}
{"page_id": "reference-polkadot-hub-bridging", "page_title": "Bridge Hub", "index": 0, "depth": 2, "title": "Introduction", "anchor": "introduction", "start_char": 14, "end_char": 1065, "estimated_token_count": 184, "token_estimator": "heuristic-v1", "text": "## Introduction\n\nThe Bridge Hub system parachain plays a crucial role in facilitating trustless interactions between Polkadot, Kusama, Ethereum, and other blockchain ecosystems. By implementing on-chain light clients and supporting protocols like BEEFY and GRANDPA, Bridge Hub ensures seamless message transmission and state verification across chains. It also provides essential [pallets](/reference/glossary/#pallet){target=\\_blank} for sending and receiving messages, making it a cornerstone of Polkadot’s interoperability framework. With built-in support for XCM (Cross-Consensus Messaging), Bridge Hub enables secure, efficient communication between diverse blockchain networks.\n\nThis guide covers the architecture, components, and deployment of the Bridge Hub system. You'll explore its trustless bridging mechanisms, key pallets for various blockchains, and specific implementations like Snowbridge and the Polkadot <> Kusama bridge. By the end, you'll understand how Bridge Hub enhances connectivity within the Polkadot ecosystem and beyond."}
{"page_id": "reference-polkadot-hub-bridging", "page_title": "Bridge Hub", "index": 1, "depth": 2, "title": "Trustless Bridging", "anchor": "trustless-bridging", "start_char": 1065, "end_char": 2671, "estimated_token_count": 313, "token_estimator": "heuristic-v1", "text": "## Trustless Bridging\n\nBridge Hub provides a mode of trustless bridging through its implementation of on-chain light clients and trustless relayers. Trustless bridges are essentially two one-way bridges, where each chain has a method of verifying the state of the other in a trustless manner through consensus proofs. In this context, \"trustless\" refers to the lack of need to trust a human when interacting with various system components. Trustless systems are based instead on trusting mathematics, cryptography, and code. The target chain and source chain both provide ways of verifying one another's state and actions (such as a transfer) based on the consensus and finality of both chains rather than an external mechanism controlled by a third party.\n\n[BEEFY (Bridge Efficiency Enabling Finality Yielder)](/reference/polkadot-hub/consensus-and-security/pos-consensus/#bridging-beefy){target=\\_blank} is instrumental in this solution. It provides a more efficient way to verify the consensus on the relay chain. It allows the participants in a network to verify finality proofs, meaning a remote chain like Ethereum can verify the state of Polkadot at a given block height. \n\nFor example, the Ethereum and Polkadot bridging solution that [Snowbridge](https://docs.snowbridge.network/){target=\\_blank} implements involves two light clients: one which verifies the state of Polkadot and the other which verifies the state of Ethereum. The light client for Polkadot is implemented in the runtime as a pallet, whereas the light client for Ethereum is implemented as a smart contract on the beacon chain."}
{"page_id": "reference-polkadot-hub-bridging", "page_title": "Bridge Hub", "index": 2, "depth": 2, "title": "Bridging Components", "anchor": "bridging-components", "start_char": 2671, "end_char": 3623, "estimated_token_count": 242, "token_estimator": "heuristic-v1", "text": "## Bridging Components\n\nIn any given Bridge Hub implementation (Kusama, Polkadot, or other relay chains), there are a few primary pallets that are utilized:\n\n- **[Pallet Bridge GRANDPA](https://paritytech.github.io/polkadot-sdk/master/pallet_bridge_grandpa/index.html){target=\\_blank}**: An on-chain GRANDPA light client for Substrate based chains.\n- **[Pallet Bridge Parachains](https://paritytech.github.io/polkadot-sdk/master/pallet_bridge_parachains/index.html){target=\\_blank}**: A finality module for parachains.\n- **[Pallet Bridge Messages](https://paritytech.github.io/polkadot-sdk/master/pallet_bridge_messages/index.html){target=\\_blank}**: A pallet which allows sending, receiving, and tracking of inbound and outbound messages.\n- **[Pallet XCM Bridge](https://paritytech.github.io/polkadot-sdk/master/pallet_xcm_bridge_hub/index.html){target=\\_blank}**: A pallet which, with the Bridge Messages pallet, adds XCM support to bridge pallets."}
@@ -1113,6 +1124,9 @@
{"page_id": "reference-polkadot-hub-people-and-identity", "page_title": "People Chain", "index": 5, "depth": 3, "title": "Judgment Classifications", "anchor": "judgment-classifications", "start_char": 1598, "end_char": 2385, "estimated_token_count": 150, "token_estimator": "heuristic-v1", "text": "### Judgment Classifications\n\nRegistrars can assign the following confidence levels to identity information:\n\n- **Unknown**: Default status; no judgment rendered yet.\n- **Reasonable**: Data appears valid but without formal verification (standard for most verified identities).\n- **Known good**: Information certified correct through formal verification (requires documentation; limited to registrars).\n- **Out of date**: Previously verified information that requires updating.\n- **Low quality**: Imprecise information requiring correction.\n- **Erroneous**: Incorrect information, potentially indicating fraudulent intent.\n\nA temporary \"Fee Paid\" status indicates judgment in progress. Both \"Fee Paid\" and \"Erroneous\" statuses lock identity information from modification until resolved."}
{"page_id": "reference-polkadot-hub-people-and-identity", "page_title": "People Chain", "index": 6, "depth": 3, "title": "Registrars", "anchor": "registrars", "start_char": 2385, "end_char": 3680, "estimated_token_count": 198, "token_estimator": "heuristic-v1", "text": "### Registrars\n\nRegistrars serve as trusted verification authorities within the People chain ecosystem. These entities validate user identities and provide attestations that build trust in the network.\n\n- Registrars set specific fees for their verification services.\n- They can specialize in verifying particular identity fields.\n- Verification costs vary based on complexity and thoroughness.\n\nWhen requesting verification, users specify their maximum acceptable fee. Only registrars whose fees fall below this threshold can provide judgment. Upon completing the verification process, the user pays the registrar's fee, and the registrar issues an appropriate confidence level classification based on their assessment.\n\nMultiple registrars operate across the Polkadot and People chain ecosystems, each with unique specializations and fee structures. To request verification:\n\n1. Research available registrars and their verification requirements.\n2. Contact your chosen registrar directly through their specified channels.\n3. Submit required documentation according to their verification process.\n4. Pay the associated verification fee.\n\nYou must contact specific registrars individually to request judgment. Each registrar maintains its own verification procedures and communication channels."}
{"page_id": "reference-polkadot-hub-people-and-identity", "page_title": "People Chain", "index": 7, "depth": 2, "title": "Where to Go Next", "anchor": "where-to-go-next", "start_char": 3680, "end_char": 4750, "estimated_token_count": 257, "token_estimator": "heuristic-v1", "text": "## Where to Go Next\n\n
\n\n- External __Polkadot.js Guides about Identity__\n\n ---\n\n Step-by-step instructions for managing identities through the Polkadot.js interface, with practical examples and visual guides.\n\n [:octicons-arrow-right-24: Reference](https://wiki.polkadot.com/learn/learn-guides-identity/)\n\n- External __How to Set and Clear an Identity__\n\n ---\n\n Practical walkthrough covering identity setup and removal process on People chain.\n\n [:octicons-arrow-right-24: Reference](https://support.polkadot.network/support/solutions/articles/65000181981-how-to-set-and-clear-an-identity)\n\n- External __People Chain Runtime Implementation__\n\n ---\n\n Source code for the People chain runtime, detailing the technical architecture of decentralized identity management.\n\n [:octicons-arrow-right-24: Reference](https://github.com/polkadot-fellows/runtimes/tree/main/system-parachains/people)\n\n
"}
+{"page_id": "reference-polkadot-hub-smart-contracts", "page_title": "Polkadot Hub Smart Contracts", "index": 0, "depth": 2, "title": "Introduction", "anchor": "introduction", "start_char": 35, "end_char": 652, "estimated_token_count": 106, "token_estimator": "heuristic-v1", "text": "## Introduction\n\nPolkadot Hub enables developers to deploy and interact with Solidity contracts through REVM, a high-performance, Rust-based Ethereum Virtual Machine implementation. This brings Ethereum compatibility to Polkadot Hub, letting teams use familiar Solidity tooling, integrate with on-chain features like governance and XCM, and take advantage of cross-chain interoperability.\n\nFor projects that require maximum computational performance, Polkadot Hub also supports PolkaVM (PVM), a native RISC-V execution engine. PVM is optional and designed for high-throughput, performance-intensive smart contracts."}
+{"page_id": "reference-polkadot-hub-smart-contracts", "page_title": "Polkadot Hub Smart Contracts", "index": 1, "depth": 3, "title": "REVM Smart Contracts", "anchor": "revm-smart-contracts", "start_char": 652, "end_char": 1675, "estimated_token_count": 192, "token_estimator": "heuristic-v1", "text": "### REVM Smart Contracts\n\n[REVM](https://github.com/bluealloy/revm){target=_blank} brings full EVM compatibility to Polkadot Hub through a fast, memory-safe Rust implementation of the Ethereum Virtual Machine. Unlike PolkaVM, which compiles contracts to RISC-V for native execution, REVM executes standard Ethereum bytecode directly—making it ideal for teams who want to migrate existing Solidity projects to Polkadot with minimal changes.\n\nWith REVM, developers can:\n\n- Deploy existing Solidity contracts without rewriting them.\n- Use familiar Ethereum tooling like Hardhat, Foundry, Remix, and MetaMask.\n- Interact with other parachains and on-chain assets using XCM and Polkadot Hub features.\n\nREVM builds on Rust’s safety guarantees and performance optimizations while retaining full opcode compatibility with the EVM. This provides a reliable path for Ethereum-native developers to access Polkadot’s native features—such as governance, treasury, multisig, and XCM—within a unified, interoperable runtime environment."}
+{"page_id": "reference-polkadot-hub-smart-contracts", "page_title": "Polkadot Hub Smart Contracts", "index": 2, "depth": 3, "title": "PVM Smart Contracts", "anchor": "pvm-smart-contracts", "start_char": 1675, "end_char": 2661, "estimated_token_count": 191, "token_estimator": "heuristic-v1", "text": "### PVM Smart Contracts\n\nPVM is Polkadot Hub’s native, high-performance smart contract engine. Instead of emulating EVM bytecode, it runs contracts compiled to a [RISC-V](https://en.wikipedia.org/wiki/RISC-V){target=_blank} instruction set, unlocking higher performance and parallel execution while staying friendly to Ethereum-style development.\n\nWith PVM, developers can:\n\n- Write Solidity contracts and use familiar tooling (e.g., Hardhat, Foundry) targeting PVM\n- Benefit from fast, predictable execution with carefully metered gas/weight.\n- Access detailed observability through Substrate events and contract logs for indexing and debugging.\n\nPolkaVM delivers maximum performance for computationally intensive contracts, offering a native, high-throughput option for Ethereum-style developers on Polkadot Hub.\n\n!!! smartcontract \"PolkaVM Preview Release\"\n PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**."}
{"page_id": "reference-tools-dedot", "page_title": "Dedot", "index": 0, "depth": 2, "title": "Introduction", "anchor": "introduction", "start_char": 9, "end_char": 445, "estimated_token_count": 99, "token_estimator": "heuristic-v1", "text": "## Introduction\n\n[Dedot](https://github.com/dedotdev/dedot){target=\\_blank} is a next-generation JavaScript client for Polkadot and Polkadot SDK-based blockchains. Designed to elevate the dApp development experience, Dedot is built and optimized to be lightweight and tree-shakable, offering precise types and APIs suggestions for individual Polkadot SDK-based blockchains and [ink! smart contracts](https://use.ink/){target=\\_blank}."}
{"page_id": "reference-tools-dedot", "page_title": "Dedot", "index": 1, "depth": 3, "title": "Key Features", "anchor": "key-features", "start_char": 445, "end_char": 1529, "estimated_token_count": 298, "token_estimator": "heuristic-v1", "text": "### Key Features\n\n- **Lightweight and tree-shakable**: No more bn.js or WebAssembly blobs, optimized for dapps bundle size.\n- **Fully typed API**: Comprehensive TypeScript support for seamless on-chain interaction and ink! smart contract integration.\n- **Multi-version JSON-RPC support**: Compatible with both [legacy](https://github.com/w3f/PSPs/blob/master/PSPs/drafts/psp-6.md){target=\\_blank} and [new](https://paritytech.github.io/json-rpc-interface-spec/introduction.html){target=\\_blank} JSON-RPC APIs for broad ecosystem interoperability.\n- **Light client support**: Designed to work with light clients such as [Smoldot](https://github.com/smol-dot/smoldot){target=\\_blank}.\n- **Native TypeScript for scale codec**: Implements scale codec parsing directly in TypeScript without relying on custom wrappers.\n- **Wallet integration**: Works out-of-the-box with [@polkadot/extension-based](https://github.com/polkadot-js/extension?tab=readme-ov-file#api-interface){target=\\_blank} wallets.\n- **Familiar API design**: Similar API style to Polkadot.js for easy and fast migration."}
{"page_id": "reference-tools-dedot", "page_title": "Dedot", "index": 2, "depth": 2, "title": "Installation", "anchor": "installation", "start_char": 1529, "end_char": 2152, "estimated_token_count": 177, "token_estimator": "heuristic-v1", "text": "## Installation\n\nTo add Dedot to your project, use the following command:\n\n=== \"npm\"\n\n ```bash\n npm i dedot\n ```\n\n=== \"pnpm\"\n\n ```bash\n pnpm add dedot\n ```\n\n=== \"yarn\"\n\n ```bash\n yarn add dedot\n ```\n\nTo enable auto-completion/IntelliSense for individual chains, install the [`@dedot/chaintypes`](https://www.npmjs.com/package/@dedot/chaintypes){target=\\_blank} package as a development dependency:\n\n=== \"npm\"\n\n ```bash\n npm i -D @dedot/chaintypes\n ```\n\n=== \"pnpm\"\n\n ```bash\n pnpm add -D @dedot/chaintypes\n ```\n\n=== \"yarn\"\n\n ```bash\n yarn add -D @dedot/chaintypes\n ```"}
@@ -1214,21 +1228,21 @@
{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 4, "depth": 3, "title": "Create the Storage Contract", "anchor": "create-the-storage-contract", "start_char": 3094, "end_char": 3633, "estimated_token_count": 112, "token_estimator": "heuristic-v1", "text": "### Create the Storage Contract\n\nIn the `contracts` directory, create a new file called `Storage.sol` and add the following code:\n\n```solidity title=\"Storage.sol\"\n// SPDX-License-Identifier: MIT\npragma solidity ^0.8.0;\n\ncontract Storage {\n uint256 private storedNumber;\n\n event NumberStored(uint256 newNumber);\n\n function setNumber(uint256 _number) public {\n storedNumber = _number;\n emit NumberStored(_number);\n }\n}\n```\n\nThis simple contract stores a single number and provides functions to read and update it."}
{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 5, "depth": 3, "title": "Configure Hardhat for Polkadot Hub", "anchor": "configure-hardhat-for-polkadot-hub", "start_char": 3633, "end_char": 5430, "estimated_token_count": 415, "token_estimator": "heuristic-v1", "text": "### Configure Hardhat for Polkadot Hub\n\nUpdate your `hardhat.config.ts` file to include the Polkadot Hub TestNet configuration:\n\n```typescript title=\"hardhat.config.ts\" hl_lines=\"39-44\"\nimport type { HardhatUserConfig } from \"hardhat/config\";\n\nimport hardhatToolboxViemPlugin from \"@nomicfoundation/hardhat-toolbox-viem\";\nimport { configVariable } from \"hardhat/config\";\n\nconst config: HardhatUserConfig = {\n plugins: [hardhatToolboxViemPlugin],\n solidity: {\n profiles: {\n default: {\n version: \"0.8.28\",\n },\n production: {\n version: \"0.8.28\",\n settings: {\n optimizer: {\n enabled: true,\n runs: 200,\n },\n },\n },\n },\n },\n networks: {\n hardhatMainnet: {\n type: \"edr-simulated\",\n chainType: \"l1\",\n },\n hardhatOp: {\n type: \"edr-simulated\",\n chainType: \"op\",\n },\n sepolia: {\n type: \"http\",\n chainType: \"l1\",\n url: configVariable(\"SEPOLIA_RPC_URL\"),\n accounts: [configVariable(\"SEPOLIA_PRIVATE_KEY\")],\n },\n polkadotTestNet: {\n type: \"http\",\n chainType: \"l1\",\n url: 'http://127.0.0.1:8545',\n accounts: [process.env.PRIVATE_KEY || ''],\n },\n },\n};\n\nexport default config;\n```\n\nCreate a `.env` file in the root of your Hardhat project:\n\n```text title=\".env\"\nPRIVATE_KEY=INSERT_PRIVATE_KEY_HERE\n```\n\nReplace `INSERT_PRIVATE_KEY_HERE` with your actual private key. You can get this by exporting the private key from your wallet (e.g., MetaMask).\n\n!!! warning\n Never commit your private key to version control. Use environment variables or a `.env` file (and add it to `.gitignore`) to manage sensitive information. Keep your private key safe, and never share it with anyone. If it is compromised, your funds can be stolen."}
{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 6, "depth": 3, "title": "Compile the Contract", "anchor": "compile-the-contract", "start_char": 5430, "end_char": 5579, "estimated_token_count": 29, "token_estimator": "heuristic-v1", "text": "### Compile the Contract\n\nCompile your Storage contract:\n\n```bash\nnpx hardhat compile\n```\n\nYou should see output indicating successful compilation."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 7, "depth": 3, "title": "Deploy the Contract", "anchor": "deploy-the-contract", "start_char": 5579, "end_char": 7212, "estimated_token_count": 416, "token_estimator": "heuristic-v1", "text": "### Deploy the Contract\n\nCreate a deployment script in the `ignition/modules` directory called `Storage.ts`:\n\n```typescript title=\"Storage.ts\"\nimport { buildModule } from \"@nomicfoundation/hardhat-ignition/modules\";\n\nexport default buildModule(\"StorageModule\", (m) => {\n const storage = m.contract(\"Storage\");\n\n return { storage };\n});\n```\n\nDeploy the contract to Polkadot Hub TestNet:\n\n```bash\nnpx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotHub\n```\n\nYou should see output similar to:\n\n
\n npx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotTestNet\n WARNING: You are using Node.js 23.11.0 which is not supported by Hardhat.\n Please upgrade to 22.10.0 or a later LTS version (even major version number)\n ✔ Confirm deploy to network polkadotTestNet (420420420)? … yes\n Hardhat Ignition 🚀\n Deploying [ StorageModule ]\n Batch #1\n Executed StorageModule#Storage\n [ StorageModule ] successfully deployed 🚀\n Deployed Addresses\n StorageModule#Storage - 0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3\n
\n\n!!! note\n Save the deployed contract address - you'll need it when building your dApp. In the following sections, we'll reference a pre-deployed contract at `0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3`, but you can use your own deployed contract address instead."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 8, "depth": 3, "title": "Export the Contract ABI", "anchor": "export-the-contract-abi", "start_char": 7212, "end_char": 7599, "estimated_token_count": 89, "token_estimator": "heuristic-v1", "text": "### Export the Contract ABI\n\nAfter deployment, you'll need the contract's Application Binary Interface (ABI) for your dApp. You can find it in the `artifacts/contracts/Storage.sol/Storage.json` file generated by Hardhat. You'll use this in the next section when setting up your dApp.\n\nNow that you have your contract deployed, you're ready to build the dApp that will interact with it!"}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 9, "depth": 2, "title": "Set Up the dApp Project", "anchor": "set-up-the-dapp-project", "start_char": 7599, "end_char": 7796, "estimated_token_count": 59, "token_estimator": "heuristic-v1", "text": "## Set Up the dApp Project\n\nNavigate to the root of the project, and create a new Next.js project called `dapp`:\n\n```bash\nnpx create-next-app dapp --ts --eslint --tailwind --app --yes\ncd dapp\n```"}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 10, "depth": 2, "title": "Install Dependencies", "anchor": "install-dependencies", "start_char": 7796, "end_char": 7955, "estimated_token_count": 50, "token_estimator": "heuristic-v1", "text": "## Install Dependencies\n\nInstall viem and related packages:\n\n```bash\nnpm install viem@2.38.5\nnpm install --save-dev typescript@5.9.3 @types/node@22.19.24\n```"}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 11, "depth": 2, "title": "Connect to Polkadot Hub", "anchor": "connect-to-polkadot-hub", "start_char": 7955, "end_char": 10052, "estimated_token_count": 509, "token_estimator": "heuristic-v1", "text": "## Connect to Polkadot Hub\n\nTo interact with Polkadot Hub, you need to set up a [Public Client](https://viem.sh/docs/clients/public#public-client){target=\\_blank} that connects to the blockchain. In this example, you will interact with the Polkadot Hub TestNet, to experiment safely. Start by creating a new file called `utils/viem.ts` and add the following code:\n\n```typescript title=\"viem.ts\"\nimport { createPublicClient, http, createWalletClient, custom } from 'viem'\nimport 'viem/window';\n\nconst transport = http('http://127.0.0.1:8545') // TODO: change to the paseo asset hub RPC URL when it's available\n\n// Configure the Polkadot Testnet Hub chain\nexport const polkadotTestnet = {\n id: 420420420,\n name: 'Polkadot Testnet',\n network: 'polkadot-testnet',\n nativeCurrency: {\n decimals: 18,\n name: 'PAS',\n symbol: 'PAS',\n },\n rpcUrls: {\n default: {\n http: ['http://127.0.0.1:8545'], // TODO: change to the paseo asset hub RPC URL\n },\n },\n} as const\n\n// Create a public client for reading data\nexport const publicClient = createPublicClient({\n chain: polkadotTestnet,\n transport\n})\n\n// Create a wallet client for signing transactions\nexport const getWalletClient = async () => {\n if (typeof window !== 'undefined' && window.ethereum) {\n const [account] = await window.ethereum.request({ method: 'eth_requestAccounts' });\n return createWalletClient({\n chain: polkadotTestnet,\n transport: custom(window.ethereum),\n account,\n });\n }\n throw new Error('No Ethereum browser provider detected');\n};\n```\n\nThis file initializes a viem client, providing helper functions for obtaining a Public Client and a [Wallet Client](https://viem.sh/docs/clients/wallet#wallet-client){target=\\_blank}. The Public Client enables reading blockchain data, while the Wallet Client allows users to sign and send transactions. Also, note that by importing `viem/window` the global `window.ethereum` will be typed as an `EIP1193Provider`, check the [`window` Polyfill](https://viem.sh/docs/typescript#window-polyfill){target=\\_blank} reference for more information."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 12, "depth": 2, "title": "Set Up the Smart Contract Interface", "anchor": "set-up-the-smart-contract-interface", "start_char": 10052, "end_char": 11943, "estimated_token_count": 415, "token_estimator": "heuristic-v1", "text": "## Set Up the Smart Contract Interface\n\nFor this dApp, you'll use a simple [Storage contract](/tutorials/smart-contracts/launch-your-first-project/create-contracts){target=\\_blank} that's already deployed in the Polkadot Hub TestNet: `0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3`. To interact with it, you need to define the contract interface.\n\nCreate a folder called `abis` at the root of your project, then create a file named `Storage.json` and paste the corresponding ABI of the Storage contract. You can copy and paste the following:\n\n```bash\ncp ./storage-contract/artifacts/contracts/Storage.sol/Storage.json ./dapp/abis/Storage.json\n```\n\nNext, create a file called `utils/contract.ts`:\n\n```typescript title=\"contract.ts\"\nimport { getContract } from 'viem';\nimport { publicClient, getWalletClient } from './viem';\nimport StorageABI from '../abis/Storage.json';\n\nexport const CONTRACT_ADDRESS = '0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3'; // TODO: change when the paseo asset hub RPC URL is available, and the contract is redeployed\nexport const CONTRACT_ABI = StorageABI.abi;\n\n// Create a function to get a contract instance for reading\nexport const getContractInstance = () => {\n return getContract({\n address: CONTRACT_ADDRESS,\n abi: CONTRACT_ABI,\n client: publicClient,\n });\n};\n\n// Create a function to get a contract instance with a signer for writing\nexport const getSignedContract = async () => {\n const walletClient = await getWalletClient();\n return getContract({\n address: CONTRACT_ADDRESS,\n abi: CONTRACT_ABI,\n client: walletClient,\n });\n};\n```\n\nThis file defines the contract address, ABI, and functions to create a viem [contract instance](https://viem.sh/docs/contract/getContract#contract-instances){target=\\_blank} for reading and writing operations. viem's contract utilities enable more efficient, type-safe interaction with smart contracts."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 13, "depth": 2, "title": "Create the Wallet Connection Component", "anchor": "create-the-wallet-connection-component", "start_char": 11943, "end_char": 17968, "estimated_token_count": 1343, "token_estimator": "heuristic-v1", "text": "## Create the Wallet Connection Component\n\nNow, let's create a component to handle wallet connections. Create a new file called `components/WalletConnect.tsx`:\n\n```typescript title=\"WalletConnect.tsx\"\n\"use client\";\n\nimport React, { useState, useEffect } from \"react\";\nimport { polkadotTestnet } from \"../utils/viem\";\n\ninterface WalletConnectProps {\n onConnect: (account: string) => void;\n}\n\nconst WalletConnect: React.FC = ({ onConnect }) => {\n const [account, setAccount] = useState(null);\n const [chainId, setChainId] = useState(null);\n const [error, setError] = useState(null);\n\n useEffect(() => {\n // Check if user already has an authorized wallet connection\n const checkConnection = async () => {\n if (typeof window !== 'undefined' && window.ethereum) {\n try {\n // eth_accounts doesn't trigger the wallet popup\n const accounts = await window.ethereum.request({\n method: 'eth_accounts',\n }) as string[];\n \n if (accounts.length > 0) {\n setAccount(accounts[0]);\n const chainIdHex = await window.ethereum.request({\n method: 'eth_chainId',\n }) as string;\n setChainId(parseInt(chainIdHex, 16));\n onConnect(accounts[0]);\n }\n } catch (err) {\n console.error('Error checking connection:', err);\n setError('Failed to check wallet connection');\n }\n }\n };\n\n checkConnection();\n\n if (typeof window !== 'undefined' && window.ethereum) {\n // Setup wallet event listeners\n window.ethereum.on('accountsChanged', (accounts: string[]) => {\n setAccount(accounts[0] || null);\n if (accounts[0]) onConnect(accounts[0]);\n });\n\n window.ethereum.on('chainChanged', (chainIdHex: string) => {\n setChainId(parseInt(chainIdHex, 16));\n });\n }\n\n return () => {\n // Cleanup event listeners\n if (typeof window !== 'undefined' && window.ethereum) {\n window.ethereum.removeListener('accountsChanged', () => {});\n window.ethereum.removeListener('chainChanged', () => {});\n }\n };\n }, [onConnect]);\n\n const connectWallet = async () => {\n if (typeof window === 'undefined' || !window.ethereum) {\n setError(\n 'MetaMask not detected! Please install MetaMask to use this dApp.'\n );\n return;\n }\n\n try {\n // eth_requestAccounts triggers the wallet popup\n const accounts = await window.ethereum.request({\n method: 'eth_requestAccounts',\n }) as string[];\n \n setAccount(accounts[0]);\n\n const chainIdHex = await window.ethereum.request({\n method: 'eth_chainId',\n }) as string;\n \n const currentChainId = parseInt(chainIdHex, 16);\n setChainId(currentChainId);\n\n // Prompt user to switch networks if needed\n if (currentChainId !== polkadotTestnet.id) {\n await switchNetwork();\n }\n\n onConnect(accounts[0]);\n } catch (err) {\n console.error('Error connecting to wallet:', err);\n setError('Failed to connect wallet');\n }\n };\n\n const switchNetwork = async () => {\n console.log('Switch network')\n try {\n await window.ethereum.request({\n method: 'wallet_switchEthereumChain',\n params: [{ chainId: `0x${polkadotTestnet.id.toString(16)}` }],\n });\n } catch (switchError: any) {\n // Error 4902 means the chain hasn't been added to MetaMask\n if (switchError.code === 4902) {\n try {\n await window.ethereum.request({\n method: 'wallet_addEthereumChain',\n params: [\n {\n chainId: `0x${polkadotTestnet.id.toString(16)}`,\n chainName: polkadotTestnet.name,\n rpcUrls: [polkadotTestnet.rpcUrls.default.http[0]],\n nativeCurrency: {\n name: polkadotTestnet.nativeCurrency.name,\n symbol: polkadotTestnet.nativeCurrency.symbol,\n decimals: polkadotTestnet.nativeCurrency.decimals,\n },\n },\n ],\n });\n } catch (addError) {\n setError('Failed to add network to wallet');\n }\n } else {\n setError('Failed to switch network');\n }\n }\n };\n\n // UI-only disconnection - MetaMask doesn't support programmatic disconnection\n const disconnectWallet = () => {\n setAccount(null);\n };\n\n return (\n
\n );\n};\n\nexport default WalletConnect;\n```\n\nThis component handles connecting to the wallet, switching networks if necessary, and keeping track of the connected account. It provides a button for users to connect their wallet and displays the connected account address once connected."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 14, "depth": 2, "title": "Create the Read Contract Component", "anchor": "create-the-read-contract-component", "start_char": 17968, "end_char": 20502, "estimated_token_count": 617, "token_estimator": "heuristic-v1", "text": "## Create the Read Contract Component\n\nNow, let's create a component to read data from the contract. Create a file called `components/ReadContract.tsx`:\n\n```typescript title=\"ReadContract.tsx\"\n'use client';\n\nimport React, { useState, useEffect } from 'react';\nimport { publicClient } from '../utils/viem';\nimport { CONTRACT_ADDRESS, CONTRACT_ABI } from '../utils/contract';\n\nconst ReadContract: React.FC = () => {\n const [storedNumber, setStoredNumber] = useState(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(null);\n\n useEffect(() => {\n // Function to read data from the blockchain\n const fetchData = async () => {\n try {\n setLoading(true);\n // Call the smart contract's storedNumber function\n const number = await publicClient.readContract({\n address: CONTRACT_ADDRESS,\n abi: CONTRACT_ABI,\n functionName: 'storedNumber',\n args: [],\n }) as bigint;\n\n setStoredNumber(number.toString());\n setError(null);\n } catch (err) {\n console.error('Error fetching stored number:', err);\n setError('Failed to fetch data from the contract');\n } finally {\n setLoading(false);\n }\n };\n\n fetchData();\n\n // Poll for updates every 10 seconds to keep UI in sync with blockchain\n const interval = setInterval(fetchData, 10000);\n\n // Clean up interval on component unmount\n return () => clearInterval(interval);\n }, []);\n\n return (\n
\n
Contract Data
\n {loading ? (\n
\n \n
\n ) : error ? (\n
{error}
\n ) : (\n
\n
\n Stored Number: {storedNumber}\n
\n
\n )}\n
\n );\n};\n\nexport default ReadContract;\n```\n\nThis component reads the `storedNumber` value from the contract and displays it to the user. It also sets up a polling interval to refresh the data periodically, ensuring that the UI stays in sync with the blockchain state."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 15, "depth": 2, "title": "Create the Write Contract Component", "anchor": "create-the-write-contract-component", "start_char": 20502, "end_char": 28611, "estimated_token_count": 1825, "token_estimator": "heuristic-v1", "text": "## Create the Write Contract Component\n\nFinally, let's create a component that allows users to update the stored number. Create a file called `components/WriteContract.tsx`:\n\n```typescript title=\"WriteContract.tsx\"\n\"use client\";\n\nimport React, { useState, useEffect } from \"react\";\nimport { publicClient, getWalletClient } from '../utils/viem';\nimport { CONTRACT_ADDRESS, CONTRACT_ABI } from '../utils/contract';\n\ninterface WriteContractProps {\n account: string | null;\n}\n\nconst WriteContract: React.FC = ({ account }) => {\n const [newNumber, setNewNumber] = useState(\"\");\n const [status, setStatus] = useState<{\n type: string | null;\n message: string;\n }>({\n type: null,\n message: \"\",\n });\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [isCorrectNetwork, setIsCorrectNetwork] = useState(true);\n\n // Check if the account is on the correct network\n useEffect(() => {\n const checkNetwork = async () => {\n if (!account) return;\n\n try {\n // Get the chainId from the public client\n const chainId = await publicClient.getChainId();\n\n // Get the user's current chainId from their wallet\n const walletClient = await getWalletClient();\n if (!walletClient) return;\n\n const walletChainId = await walletClient.getChainId();\n\n // Check if they match\n setIsCorrectNetwork(chainId === walletChainId);\n } catch (err) {\n console.error(\"Error checking network:\", err);\n setIsCorrectNetwork(false);\n }\n };\n\n checkNetwork();\n }, [account]);\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n // Validation checks\n if (!account) {\n setStatus({ type: \"error\", message: \"Please connect your wallet first\" });\n return;\n }\n\n if (!isCorrectNetwork) {\n setStatus({\n type: \"error\",\n message: \"Please switch to the correct network in your wallet\",\n });\n return;\n }\n\n if (!newNumber || isNaN(Number(newNumber))) {\n setStatus({ type: \"error\", message: \"Please enter a valid number\" });\n return;\n }\n\n try {\n setIsSubmitting(true);\n setStatus({ type: \"info\", message: \"Initiating transaction...\" });\n\n // Get wallet client for transaction signing\n const walletClient = await getWalletClient();\n\n if (!walletClient) {\n setStatus({ type: \"error\", message: \"Wallet client not available\" });\n return;\n }\n\n // Check if account matches\n if (\n walletClient.account?.address.toLowerCase() !== account.toLowerCase()\n ) {\n setStatus({\n type: \"error\",\n message:\n \"Connected wallet account doesn't match the selected account\",\n });\n return;\n }\n\n // Prepare transaction and wait for user confirmation in wallet\n setStatus({\n type: \"info\",\n message: \"Please confirm the transaction in your wallet...\",\n });\n\n // Simulate the contract call first\n console.log('newNumber', newNumber);\n const { request } = await publicClient.simulateContract({\n address: CONTRACT_ADDRESS,\n abi: CONTRACT_ABI,\n functionName: \"setNumber\",\n args: [BigInt(newNumber)],\n account: walletClient.account,\n });\n\n // Send the transaction with wallet client\n const hash = await walletClient.writeContract(request);\n\n // Wait for transaction to be mined\n setStatus({\n type: \"info\",\n message: \"Transaction submitted. Waiting for confirmation...\",\n });\n\n const receipt = await publicClient.waitForTransactionReceipt({\n hash,\n });\n\n setStatus({\n type: \"success\",\n message: `Transaction confirmed! Transaction hash: ${receipt.transactionHash}`,\n });\n\n setNewNumber(\"\");\n } catch (err: any) {\n console.error(\"Error updating number:\", err);\n\n // Handle specific errors\n if (err.code === 4001) {\n // User rejected transaction\n setStatus({ type: \"error\", message: \"Transaction rejected by user.\" });\n } else if (err.message?.includes(\"Account not found\")) {\n // Account not found on the network\n setStatus({\n type: \"error\",\n message:\n \"Account not found on current network. Please check your wallet is connected to the correct network.\",\n });\n } else if (err.message?.includes(\"JSON is not a valid request object\")) {\n // JSON error - specific to your current issue\n setStatus({\n type: \"error\",\n message:\n \"Invalid request format. Please try again or contact support.\",\n });\n } else {\n // Other errors\n setStatus({\n type: \"error\",\n message: `Error: ${err.message || \"Failed to send transaction\"}`,\n });\n }\n } finally {\n setIsSubmitting(false);\n }\n };\n\n return (\n
\n
Update Stored Number
\n\n {!isCorrectNetwork && account && (\n
\n ⚠️ You are not connected to the correct network. Please switch\n networks in your wallet.\n
\n )}\n\n {status.message && (\n
\n {status.message}\n
\n )}\n\n \n\n {!account && (\n
\n Connect your wallet to update the stored number.\n
\n )}\n
\n );\n};\n\nexport default WriteContract;\n```\n\nThis component allows users to input a new number and send a transaction to update the value stored in the contract. It provides appropriate feedback during each step of the transaction process and handles error scenarios.\n\nUpdate the `app/page.tsx` file to integrate all components:\n\n```typescript title=\"page.tsx\"\n\"use client\";\n\nimport { useState } from \"react\";\nimport WalletConnect from \"./components/WalletConnect\";\nimport ReadContract from \"./components/ReadContract\";\nimport WriteContract from \"./components/WriteContract\";\n\nexport default function Home() {\n const [account, setAccount] = useState(null);\n\n const handleConnect = (connectedAccount: string) => {\n setAccount(connectedAccount);\n };\n\n return (\n \n
\n Polkadot Hub - Zero To Hero DApp\n
\n \n \n \n \n );\n}\n```\n\nRun the dApp:\n\n```bash\nnpm run dev\n```\n\nNavigate to `http://localhost:3000` in your browser, and you should see your dApp with the wallet connection button, the stored number displayed, and the form to update the number. You should see something like this:"}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 16, "depth": 2, "title": "How It Works", "anchor": "how-it-works", "start_char": 28611, "end_char": 28704, "estimated_token_count": 18, "token_estimator": "heuristic-v1", "text": "## How It Works\n\nThis dApp uses components to interact with the blockchain in several ways."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 17, "depth": 3, "title": "Wallet Connection", "anchor": "wallet-connection", "start_char": 28704, "end_char": 29010, "estimated_token_count": 60, "token_estimator": "heuristic-v1", "text": "### Wallet Connection \n\nThe `WalletConnect` component uses the browser's Ethereum provider (MetaMask) to connect to the user's wallet and handles network switching to ensure the user is connected to the Polkadot Hub TestNet. Once connected, it provides the user's account address to the parent component."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 18, "depth": 3, "title": "Data Reads", "anchor": "data-reads", "start_char": 29010, "end_char": 29311, "estimated_token_count": 57, "token_estimator": "heuristic-v1", "text": "### Data Reads\n\nThe `ReadContract` component uses viem's `readContract` function to call the `storedNumber` view function and periodically poll for updates to keep the UI in sync with the blockchain state. The component also displays a loading indicator while fetching data and handles error states."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 19, "depth": 3, "title": "Data Writes", "anchor": "data-writes", "start_char": 29311, "end_char": 29713, "estimated_token_count": 71, "token_estimator": "heuristic-v1", "text": "### Data Writes\n\nThe `WriteContract` component uses viem's `writeContract` function to send a transaction to the `setNumber` function and ensures the wallet is connected before allowing a transaction. The component shows detailed feedback during transaction submission and confirmation. After a successful transaction, the value displayed in the `ReadContract` component will update on the next poll."}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 20, "depth": 2, "title": "Conclusion", "anchor": "conclusion", "start_char": 29713, "end_char": 30610, "estimated_token_count": 178, "token_estimator": "heuristic-v1", "text": "## Conclusion\n\nCongratulations! You've successfully built a fully functional dApp that interacts with a smart contract on Polkadot Hub using viem and Next.js. Your application can now:\n\n- Create a smart contract with Hardhat and deploy it to Polkadot Hub TestNet.\n- Connect to a user's wallet and handle network switching.\n- Read data from a smart contract and keep it updated.\n- Write data to the blockchain through transactions.\n\nThese fundamental skills provide the foundation for building more complex dApps on Polkadot Hub. With this knowledge, you can extend your application to interact with more sophisticated smart contracts and create advanced user interfaces.\n\nTo get started right away with a working example, you can clone the repository and navigate to the implementation:\n\n```bash\ngit clone https://github.com/polkadot-developers/revm-hardhat-examples.git\ncd zero-to-hero-dapp\n```"}
-{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 21, "depth": 2, "title": "Where to Go Next", "anchor": "where-to-go-next", "start_char": 30610, "end_char": 31203, "estimated_token_count": 147, "token_estimator": "heuristic-v1", "text": "## Where to Go Next\n\n
\n\n- Guide __Port Ethereum Projects to Polkadot Hub__\n\n ---\n\n Learn how to port an Ethereum project to Polkadot Hub using Hardhat and Viem.\n\n [:octicons-arrow-right-24: Get Started](/smart-contracts/cookbook/eth-dapps/)\n\n- Guide __Dive Deeper into Polkadot Precompiles__\n\n ---\n\n Learn how to use the Polkadot precompiles to interact with the blockchain.\n\n [:octicons-arrow-right-24: Get Started](/smart-contracts/cookbook/polkadot-precompiles/)\n
"}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 7, "depth": 3, "title": "Deploy the Contract", "anchor": "deploy-the-contract", "start_char": 5579, "end_char": 7216, "estimated_token_count": 416, "token_estimator": "heuristic-v1", "text": "### Deploy the Contract\n\nCreate a deployment script in the `ignition/modules` directory called `Storage.ts`:\n\n```typescript title=\"Storage.ts\"\nimport { buildModule } from \"@nomicfoundation/hardhat-ignition/modules\";\n\nexport default buildModule(\"StorageModule\", (m) => {\n const storage = m.contract(\"Storage\");\n\n return { storage };\n});\n```\n\nDeploy the contract to Polkadot Hub TestNet:\n\n```bash\nnpx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotTestNet\n```\n\nYou should see output similar to:\n\n
\n npx hardhat ignition deploy ./ignition/modules/Storage.ts --network polkadotTestNet\n WARNING: You are using Node.js 23.11.0 which is not supported by Hardhat.\n Please upgrade to 22.10.0 or a later LTS version (even major version number)\n ✔ Confirm deploy to network polkadotTestNet (420420420)? … yes\n Hardhat Ignition 🚀\n Deploying [ StorageModule ]\n Batch #1\n Executed StorageModule#Storage\n [ StorageModule ] successfully deployed 🚀\n Deployed Addresses\n StorageModule#Storage - 0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3\n
\n\n!!! note\n Save the deployed contract address - you'll need it when building your dApp. In the following sections, we'll reference a pre-deployed contract at `0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3`, but you can use your own deployed contract address instead."}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 8, "depth": 3, "title": "Export the Contract ABI", "anchor": "export-the-contract-abi", "start_char": 7216, "end_char": 7603, "estimated_token_count": 89, "token_estimator": "heuristic-v1", "text": "### Export the Contract ABI\n\nAfter deployment, you'll need the contract's Application Binary Interface (ABI) for your dApp. You can find it in the `artifacts/contracts/Storage.sol/Storage.json` file generated by Hardhat. You'll use this in the next section when setting up your dApp.\n\nNow that you have your contract deployed, you're ready to build the dApp that will interact with it!"}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 9, "depth": 2, "title": "Set Up the dApp Project", "anchor": "set-up-the-dapp-project", "start_char": 7603, "end_char": 7800, "estimated_token_count": 59, "token_estimator": "heuristic-v1", "text": "## Set Up the dApp Project\n\nNavigate to the root of the project, and create a new Next.js project called `dapp`:\n\n```bash\nnpx create-next-app dapp --ts --eslint --tailwind --app --yes\ncd dapp\n```"}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 10, "depth": 2, "title": "Install Dependencies", "anchor": "install-dependencies", "start_char": 7800, "end_char": 7959, "estimated_token_count": 50, "token_estimator": "heuristic-v1", "text": "## Install Dependencies\n\nInstall viem and related packages:\n\n```bash\nnpm install viem@2.38.5\nnpm install --save-dev typescript@5.9.3 @types/node@22.19.24\n```"}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 11, "depth": 2, "title": "Connect to Polkadot Hub", "anchor": "connect-to-polkadot-hub", "start_char": 7959, "end_char": 10056, "estimated_token_count": 509, "token_estimator": "heuristic-v1", "text": "## Connect to Polkadot Hub\n\nTo interact with Polkadot Hub, you need to set up a [Public Client](https://viem.sh/docs/clients/public#public-client){target=\\_blank} that connects to the blockchain. In this example, you will interact with the Polkadot Hub TestNet, to experiment safely. Start by creating a new file called `utils/viem.ts` and add the following code:\n\n```typescript title=\"viem.ts\"\nimport { createPublicClient, http, createWalletClient, custom } from 'viem'\nimport 'viem/window';\n\nconst transport = http('http://127.0.0.1:8545') // TODO: change to the paseo asset hub RPC URL when it's available\n\n// Configure the Polkadot Testnet Hub chain\nexport const polkadotTestnet = {\n id: 420420420,\n name: 'Polkadot Testnet',\n network: 'polkadot-testnet',\n nativeCurrency: {\n decimals: 18,\n name: 'PAS',\n symbol: 'PAS',\n },\n rpcUrls: {\n default: {\n http: ['http://127.0.0.1:8545'], // TODO: change to the paseo asset hub RPC URL\n },\n },\n} as const\n\n// Create a public client for reading data\nexport const publicClient = createPublicClient({\n chain: polkadotTestnet,\n transport\n})\n\n// Create a wallet client for signing transactions\nexport const getWalletClient = async () => {\n if (typeof window !== 'undefined' && window.ethereum) {\n const [account] = await window.ethereum.request({ method: 'eth_requestAccounts' });\n return createWalletClient({\n chain: polkadotTestnet,\n transport: custom(window.ethereum),\n account,\n });\n }\n throw new Error('No Ethereum browser provider detected');\n};\n```\n\nThis file initializes a viem client, providing helper functions for obtaining a Public Client and a [Wallet Client](https://viem.sh/docs/clients/wallet#wallet-client){target=\\_blank}. The Public Client enables reading blockchain data, while the Wallet Client allows users to sign and send transactions. Also, note that by importing `viem/window` the global `window.ethereum` will be typed as an `EIP1193Provider`, check the [`window` Polyfill](https://viem.sh/docs/typescript#window-polyfill){target=\\_blank} reference for more information."}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 12, "depth": 2, "title": "Set Up the Smart Contract Interface", "anchor": "set-up-the-smart-contract-interface", "start_char": 10056, "end_char": 11947, "estimated_token_count": 415, "token_estimator": "heuristic-v1", "text": "## Set Up the Smart Contract Interface\n\nFor this dApp, you'll use a simple [Storage contract](/tutorials/smart-contracts/launch-your-first-project/create-contracts){target=\\_blank} that's already deployed in the Polkadot Hub TestNet: `0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3`. To interact with it, you need to define the contract interface.\n\nCreate a folder called `abis` at the root of your project, then create a file named `Storage.json` and paste the corresponding ABI of the Storage contract. You can copy and paste the following:\n\n```bash\ncp ./storage-contract/artifacts/contracts/Storage.sol/Storage.json ./dapp/abis/Storage.json\n```\n\nNext, create a file called `utils/contract.ts`:\n\n```typescript title=\"contract.ts\"\nimport { getContract } from 'viem';\nimport { publicClient, getWalletClient } from './viem';\nimport StorageABI from '../abis/Storage.json';\n\nexport const CONTRACT_ADDRESS = '0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3'; // TODO: change when the paseo asset hub RPC URL is available, and the contract is redeployed\nexport const CONTRACT_ABI = StorageABI.abi;\n\n// Create a function to get a contract instance for reading\nexport const getContractInstance = () => {\n return getContract({\n address: CONTRACT_ADDRESS,\n abi: CONTRACT_ABI,\n client: publicClient,\n });\n};\n\n// Create a function to get a contract instance with a signer for writing\nexport const getSignedContract = async () => {\n const walletClient = await getWalletClient();\n return getContract({\n address: CONTRACT_ADDRESS,\n abi: CONTRACT_ABI,\n client: walletClient,\n });\n};\n```\n\nThis file defines the contract address, ABI, and functions to create a viem [contract instance](https://viem.sh/docs/contract/getContract#contract-instances){target=\\_blank} for reading and writing operations. viem's contract utilities enable more efficient, type-safe interaction with smart contracts."}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 13, "depth": 2, "title": "Create the Wallet Connection Component", "anchor": "create-the-wallet-connection-component", "start_char": 11947, "end_char": 17972, "estimated_token_count": 1343, "token_estimator": "heuristic-v1", "text": "## Create the Wallet Connection Component\n\nNow, let's create a component to handle wallet connections. Create a new file called `components/WalletConnect.tsx`:\n\n```typescript title=\"WalletConnect.tsx\"\n\"use client\";\n\nimport React, { useState, useEffect } from \"react\";\nimport { polkadotTestnet } from \"../utils/viem\";\n\ninterface WalletConnectProps {\n onConnect: (account: string) => void;\n}\n\nconst WalletConnect: React.FC = ({ onConnect }) => {\n const [account, setAccount] = useState(null);\n const [chainId, setChainId] = useState(null);\n const [error, setError] = useState(null);\n\n useEffect(() => {\n // Check if user already has an authorized wallet connection\n const checkConnection = async () => {\n if (typeof window !== 'undefined' && window.ethereum) {\n try {\n // eth_accounts doesn't trigger the wallet popup\n const accounts = await window.ethereum.request({\n method: 'eth_accounts',\n }) as string[];\n \n if (accounts.length > 0) {\n setAccount(accounts[0]);\n const chainIdHex = await window.ethereum.request({\n method: 'eth_chainId',\n }) as string;\n setChainId(parseInt(chainIdHex, 16));\n onConnect(accounts[0]);\n }\n } catch (err) {\n console.error('Error checking connection:', err);\n setError('Failed to check wallet connection');\n }\n }\n };\n\n checkConnection();\n\n if (typeof window !== 'undefined' && window.ethereum) {\n // Setup wallet event listeners\n window.ethereum.on('accountsChanged', (accounts: string[]) => {\n setAccount(accounts[0] || null);\n if (accounts[0]) onConnect(accounts[0]);\n });\n\n window.ethereum.on('chainChanged', (chainIdHex: string) => {\n setChainId(parseInt(chainIdHex, 16));\n });\n }\n\n return () => {\n // Cleanup event listeners\n if (typeof window !== 'undefined' && window.ethereum) {\n window.ethereum.removeListener('accountsChanged', () => {});\n window.ethereum.removeListener('chainChanged', () => {});\n }\n };\n }, [onConnect]);\n\n const connectWallet = async () => {\n if (typeof window === 'undefined' || !window.ethereum) {\n setError(\n 'MetaMask not detected! Please install MetaMask to use this dApp.'\n );\n return;\n }\n\n try {\n // eth_requestAccounts triggers the wallet popup\n const accounts = await window.ethereum.request({\n method: 'eth_requestAccounts',\n }) as string[];\n \n setAccount(accounts[0]);\n\n const chainIdHex = await window.ethereum.request({\n method: 'eth_chainId',\n }) as string;\n \n const currentChainId = parseInt(chainIdHex, 16);\n setChainId(currentChainId);\n\n // Prompt user to switch networks if needed\n if (currentChainId !== polkadotTestnet.id) {\n await switchNetwork();\n }\n\n onConnect(accounts[0]);\n } catch (err) {\n console.error('Error connecting to wallet:', err);\n setError('Failed to connect wallet');\n }\n };\n\n const switchNetwork = async () => {\n console.log('Switch network')\n try {\n await window.ethereum.request({\n method: 'wallet_switchEthereumChain',\n params: [{ chainId: `0x${polkadotTestnet.id.toString(16)}` }],\n });\n } catch (switchError: any) {\n // Error 4902 means the chain hasn't been added to MetaMask\n if (switchError.code === 4902) {\n try {\n await window.ethereum.request({\n method: 'wallet_addEthereumChain',\n params: [\n {\n chainId: `0x${polkadotTestnet.id.toString(16)}`,\n chainName: polkadotTestnet.name,\n rpcUrls: [polkadotTestnet.rpcUrls.default.http[0]],\n nativeCurrency: {\n name: polkadotTestnet.nativeCurrency.name,\n symbol: polkadotTestnet.nativeCurrency.symbol,\n decimals: polkadotTestnet.nativeCurrency.decimals,\n },\n },\n ],\n });\n } catch (addError) {\n setError('Failed to add network to wallet');\n }\n } else {\n setError('Failed to switch network');\n }\n }\n };\n\n // UI-only disconnection - MetaMask doesn't support programmatic disconnection\n const disconnectWallet = () => {\n setAccount(null);\n };\n\n return (\n
\n );\n};\n\nexport default WalletConnect;\n```\n\nThis component handles connecting to the wallet, switching networks if necessary, and keeping track of the connected account. It provides a button for users to connect their wallet and displays the connected account address once connected."}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 14, "depth": 2, "title": "Create the Read Contract Component", "anchor": "create-the-read-contract-component", "start_char": 17972, "end_char": 20506, "estimated_token_count": 617, "token_estimator": "heuristic-v1", "text": "## Create the Read Contract Component\n\nNow, let's create a component to read data from the contract. Create a file called `components/ReadContract.tsx`:\n\n```typescript title=\"ReadContract.tsx\"\n'use client';\n\nimport React, { useState, useEffect } from 'react';\nimport { publicClient } from '../utils/viem';\nimport { CONTRACT_ADDRESS, CONTRACT_ABI } from '../utils/contract';\n\nconst ReadContract: React.FC = () => {\n const [storedNumber, setStoredNumber] = useState(null);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState(null);\n\n useEffect(() => {\n // Function to read data from the blockchain\n const fetchData = async () => {\n try {\n setLoading(true);\n // Call the smart contract's storedNumber function\n const number = await publicClient.readContract({\n address: CONTRACT_ADDRESS,\n abi: CONTRACT_ABI,\n functionName: 'storedNumber',\n args: [],\n }) as bigint;\n\n setStoredNumber(number.toString());\n setError(null);\n } catch (err) {\n console.error('Error fetching stored number:', err);\n setError('Failed to fetch data from the contract');\n } finally {\n setLoading(false);\n }\n };\n\n fetchData();\n\n // Poll for updates every 10 seconds to keep UI in sync with blockchain\n const interval = setInterval(fetchData, 10000);\n\n // Clean up interval on component unmount\n return () => clearInterval(interval);\n }, []);\n\n return (\n
\n
Contract Data
\n {loading ? (\n
\n \n
\n ) : error ? (\n
{error}
\n ) : (\n
\n
\n Stored Number: {storedNumber}\n
\n
\n )}\n
\n );\n};\n\nexport default ReadContract;\n```\n\nThis component reads the `storedNumber` value from the contract and displays it to the user. It also sets up a polling interval to refresh the data periodically, ensuring that the UI stays in sync with the blockchain state."}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 15, "depth": 2, "title": "Create the Write Contract Component", "anchor": "create-the-write-contract-component", "start_char": 20506, "end_char": 28615, "estimated_token_count": 1825, "token_estimator": "heuristic-v1", "text": "## Create the Write Contract Component\n\nFinally, let's create a component that allows users to update the stored number. Create a file called `components/WriteContract.tsx`:\n\n```typescript title=\"WriteContract.tsx\"\n\"use client\";\n\nimport React, { useState, useEffect } from \"react\";\nimport { publicClient, getWalletClient } from '../utils/viem';\nimport { CONTRACT_ADDRESS, CONTRACT_ABI } from '../utils/contract';\n\ninterface WriteContractProps {\n account: string | null;\n}\n\nconst WriteContract: React.FC = ({ account }) => {\n const [newNumber, setNewNumber] = useState(\"\");\n const [status, setStatus] = useState<{\n type: string | null;\n message: string;\n }>({\n type: null,\n message: \"\",\n });\n const [isSubmitting, setIsSubmitting] = useState(false);\n const [isCorrectNetwork, setIsCorrectNetwork] = useState(true);\n\n // Check if the account is on the correct network\n useEffect(() => {\n const checkNetwork = async () => {\n if (!account) return;\n\n try {\n // Get the chainId from the public client\n const chainId = await publicClient.getChainId();\n\n // Get the user's current chainId from their wallet\n const walletClient = await getWalletClient();\n if (!walletClient) return;\n\n const walletChainId = await walletClient.getChainId();\n\n // Check if they match\n setIsCorrectNetwork(chainId === walletChainId);\n } catch (err) {\n console.error(\"Error checking network:\", err);\n setIsCorrectNetwork(false);\n }\n };\n\n checkNetwork();\n }, [account]);\n\n const handleSubmit = async (e: React.FormEvent) => {\n e.preventDefault();\n\n // Validation checks\n if (!account) {\n setStatus({ type: \"error\", message: \"Please connect your wallet first\" });\n return;\n }\n\n if (!isCorrectNetwork) {\n setStatus({\n type: \"error\",\n message: \"Please switch to the correct network in your wallet\",\n });\n return;\n }\n\n if (!newNumber || isNaN(Number(newNumber))) {\n setStatus({ type: \"error\", message: \"Please enter a valid number\" });\n return;\n }\n\n try {\n setIsSubmitting(true);\n setStatus({ type: \"info\", message: \"Initiating transaction...\" });\n\n // Get wallet client for transaction signing\n const walletClient = await getWalletClient();\n\n if (!walletClient) {\n setStatus({ type: \"error\", message: \"Wallet client not available\" });\n return;\n }\n\n // Check if account matches\n if (\n walletClient.account?.address.toLowerCase() !== account.toLowerCase()\n ) {\n setStatus({\n type: \"error\",\n message:\n \"Connected wallet account doesn't match the selected account\",\n });\n return;\n }\n\n // Prepare transaction and wait for user confirmation in wallet\n setStatus({\n type: \"info\",\n message: \"Please confirm the transaction in your wallet...\",\n });\n\n // Simulate the contract call first\n console.log('newNumber', newNumber);\n const { request } = await publicClient.simulateContract({\n address: CONTRACT_ADDRESS,\n abi: CONTRACT_ABI,\n functionName: \"setNumber\",\n args: [BigInt(newNumber)],\n account: walletClient.account,\n });\n\n // Send the transaction with wallet client\n const hash = await walletClient.writeContract(request);\n\n // Wait for transaction to be mined\n setStatus({\n type: \"info\",\n message: \"Transaction submitted. Waiting for confirmation...\",\n });\n\n const receipt = await publicClient.waitForTransactionReceipt({\n hash,\n });\n\n setStatus({\n type: \"success\",\n message: `Transaction confirmed! Transaction hash: ${receipt.transactionHash}`,\n });\n\n setNewNumber(\"\");\n } catch (err: any) {\n console.error(\"Error updating number:\", err);\n\n // Handle specific errors\n if (err.code === 4001) {\n // User rejected transaction\n setStatus({ type: \"error\", message: \"Transaction rejected by user.\" });\n } else if (err.message?.includes(\"Account not found\")) {\n // Account not found on the network\n setStatus({\n type: \"error\",\n message:\n \"Account not found on current network. Please check your wallet is connected to the correct network.\",\n });\n } else if (err.message?.includes(\"JSON is not a valid request object\")) {\n // JSON error - specific to your current issue\n setStatus({\n type: \"error\",\n message:\n \"Invalid request format. Please try again or contact support.\",\n });\n } else {\n // Other errors\n setStatus({\n type: \"error\",\n message: `Error: ${err.message || \"Failed to send transaction\"}`,\n });\n }\n } finally {\n setIsSubmitting(false);\n }\n };\n\n return (\n
\n
Update Stored Number
\n\n {!isCorrectNetwork && account && (\n
\n ⚠️ You are not connected to the correct network. Please switch\n networks in your wallet.\n
\n )}\n\n {status.message && (\n
\n {status.message}\n
\n )}\n\n \n\n {!account && (\n
\n Connect your wallet to update the stored number.\n
\n )}\n
\n );\n};\n\nexport default WriteContract;\n```\n\nThis component allows users to input a new number and send a transaction to update the value stored in the contract. It provides appropriate feedback during each step of the transaction process and handles error scenarios.\n\nUpdate the `app/page.tsx` file to integrate all components:\n\n```typescript title=\"page.tsx\"\n\"use client\";\n\nimport { useState } from \"react\";\nimport WalletConnect from \"./components/WalletConnect\";\nimport ReadContract from \"./components/ReadContract\";\nimport WriteContract from \"./components/WriteContract\";\n\nexport default function Home() {\n const [account, setAccount] = useState(null);\n\n const handleConnect = (connectedAccount: string) => {\n setAccount(connectedAccount);\n };\n\n return (\n \n
\n Polkadot Hub - Zero To Hero DApp\n
\n \n \n \n \n );\n}\n```\n\nRun the dApp:\n\n```bash\nnpm run dev\n```\n\nNavigate to `http://localhost:3000` in your browser, and you should see your dApp with the wallet connection button, the stored number displayed, and the form to update the number. You should see something like this:"}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 16, "depth": 2, "title": "How It Works", "anchor": "how-it-works", "start_char": 28615, "end_char": 28708, "estimated_token_count": 18, "token_estimator": "heuristic-v1", "text": "## How It Works\n\nThis dApp uses components to interact with the blockchain in several ways."}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 17, "depth": 3, "title": "Wallet Connection", "anchor": "wallet-connection", "start_char": 28708, "end_char": 29014, "estimated_token_count": 60, "token_estimator": "heuristic-v1", "text": "### Wallet Connection \n\nThe `WalletConnect` component uses the browser's Ethereum provider (MetaMask) to connect to the user's wallet and handles network switching to ensure the user is connected to the Polkadot Hub TestNet. Once connected, it provides the user's account address to the parent component."}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 18, "depth": 3, "title": "Data Reads", "anchor": "data-reads", "start_char": 29014, "end_char": 29315, "estimated_token_count": 57, "token_estimator": "heuristic-v1", "text": "### Data Reads\n\nThe `ReadContract` component uses viem's `readContract` function to call the `storedNumber` view function and periodically poll for updates to keep the UI in sync with the blockchain state. The component also displays a loading indicator while fetching data and handles error states."}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 19, "depth": 3, "title": "Data Writes", "anchor": "data-writes", "start_char": 29315, "end_char": 29717, "estimated_token_count": 71, "token_estimator": "heuristic-v1", "text": "### Data Writes\n\nThe `WriteContract` component uses viem's `writeContract` function to send a transaction to the `setNumber` function and ensures the wallet is connected before allowing a transaction. The component shows detailed feedback during transaction submission and confirmation. After a successful transaction, the value displayed in the `ReadContract` component will update on the next poll."}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 20, "depth": 2, "title": "Conclusion", "anchor": "conclusion", "start_char": 29717, "end_char": 30614, "estimated_token_count": 178, "token_estimator": "heuristic-v1", "text": "## Conclusion\n\nCongratulations! You've successfully built a fully functional dApp that interacts with a smart contract on Polkadot Hub using viem and Next.js. Your application can now:\n\n- Create a smart contract with Hardhat and deploy it to Polkadot Hub TestNet.\n- Connect to a user's wallet and handle network switching.\n- Read data from a smart contract and keep it updated.\n- Write data to the blockchain through transactions.\n\nThese fundamental skills provide the foundation for building more complex dApps on Polkadot Hub. With this knowledge, you can extend your application to interact with more sophisticated smart contracts and create advanced user interfaces.\n\nTo get started right away with a working example, you can clone the repository and navigate to the implementation:\n\n```bash\ngit clone https://github.com/polkadot-developers/revm-hardhat-examples.git\ncd zero-to-hero-dapp\n```"}
+{"page_id": "smart-contracts-cookbook-dapps-zero-to-hero", "page_title": "Zero to Hero Smart Contract DApp", "index": 21, "depth": 2, "title": "Where to Go Next", "anchor": "where-to-go-next", "start_char": 30614, "end_char": 31207, "estimated_token_count": 147, "token_estimator": "heuristic-v1", "text": "## Where to Go Next\n\n
\n\n- Guide __Port Ethereum Projects to Polkadot Hub__\n\n ---\n\n Learn how to port an Ethereum project to Polkadot Hub using Hardhat and Viem.\n\n [:octicons-arrow-right-24: Get Started](/smart-contracts/cookbook/eth-dapps/)\n\n- Guide __Dive Deeper into Polkadot Precompiles__\n\n ---\n\n Learn how to use the Polkadot precompiles to interact with the blockchain.\n\n [:octicons-arrow-right-24: Get Started](/smart-contracts/cookbook/polkadot-precompiles/)\n
"}
{"page_id": "smart-contracts-cookbook-eth-dapps-uniswap-v2", "page_title": "Deploying Uniswap V2 on Polkadot", "index": 0, "depth": 2, "title": "Introduction", "anchor": "introduction", "start_char": 191, "end_char": 857, "estimated_token_count": 131, "token_estimator": "heuristic-v1", "text": "## Introduction\n\nDecentralized exchanges (DEXs) are a cornerstone of the DeFi ecosystem, allowing for permissionless token swaps without intermediaries. [Uniswap V2](https://docs.uniswap.org/contracts/v2/overview){target=\\_blank}, with its Automated Market Maker (AMM) model, revolutionized DEXs by enabling liquidity provision for any ERC-20 token pair.\n\nThis tutorial will guide you through how Uniswap V2 works so you can take advantage of it in your projects deployed to Polkadot Hub. By understanding these contracts, you'll gain hands-on experience with one of the most influential DeFi protocols and understand how it functions across blockchain ecosystems."}
{"page_id": "smart-contracts-cookbook-eth-dapps-uniswap-v2", "page_title": "Deploying Uniswap V2 on Polkadot", "index": 1, "depth": 2, "title": "Prerequisites", "anchor": "prerequisites", "start_char": 857, "end_char": 1357, "estimated_token_count": 124, "token_estimator": "heuristic-v1", "text": "## Prerequisites\n\nBefore starting, make sure you have:\n\n- Node.js (v16.0.0 or later) and npm installed.\n- Basic understanding of Solidity and JavaScript.\n- Familiarity with [`hardhat-polkadot`](/smart-contracts/dev-environments/hardhat/get-started/){target=\\_blank} development environment.\n- Some PAS test tokens to cover transaction fees (obtained from the [Polkadot faucet](https://faucet.polkadot.io/?parachain=1111){target=\\_blank}).\n- Basic understanding of how AMMs and liquidity pools work."}
{"page_id": "smart-contracts-cookbook-eth-dapps-uniswap-v2", "page_title": "Deploying Uniswap V2 on Polkadot", "index": 2, "depth": 2, "title": "Set Up the Project", "anchor": "set-up-the-project", "start_char": 1357, "end_char": 3682, "estimated_token_count": 570, "token_estimator": "heuristic-v1", "text": "## Set Up the Project\n\nLet's start by cloning the Uniswap V2 project:\n\n1. Clone the Uniswap V2 repository:\n\n ```\n git clone https://github.com/polkadot-developers/polkavm-hardhat-examples.git -b v0.0.6\n cd polkavm-hardhat-examples/uniswap-v2-polkadot/\n ```\n\n2. Install the required dependencies:\n\n ```bash\n npm install\n ```\n\n3. Update the `hardhat.config.js` file so the paths for the Substrate node and the ETH-RPC adapter match with the paths on your machine. For more info, check the [Testing your Contract](/smart-contracts/dev-environments/hardhat/compile-and-test/){target=\\_blank} section in the Hardhat guide.\n\n ```js title=\"hardhat.config.js\"\n hardhat: {\n polkavm: true,\n nodeConfig: {\n nodeBinaryPath: '../bin/substrate-node',\n rpcPort: 8000,\n dev: true,\n },\n adapterConfig: {\n adapterBinaryPath: '../bin/eth-rpc',\n dev: true,\n },\n },\n ```\n\n4. Create a `.env` file in your project root to store your private keys (you can use as an example the `env.example` file):\n\n ```text title=\".env\"\n LOCAL_PRIV_KEY=\"INSERT_LOCAL_PRIVATE_KEY\"\n AH_PRIV_KEY=\"INSERT_AH_PRIVATE_KEY\"\n ```\n\n Ensure to replace `\"INSERT_LOCAL_PRIVATE_KEY\"` with a private key available in the local environment (you can get them from this [file](https://github.com/paritytech/hardhat-polkadot/blob/main/packages/hardhat-polkadot-node/src/constants.ts#L22){target=\\_blank}). And `\"INSERT_AH_PRIVATE_KEY\"` with the account's private key you want to use to deploy the contracts. You can get this by exporting the private key from your wallet (e.g., MetaMask).\n\n !!!warning\n Keep your private key safe, and never share it with anyone. If it is compromised, your funds can be stolen.\n\n5. Compile the contracts:\n\n ```bash\n npx hardhat compile\n ```\n\nIf the compilation is successful, you should see the following output:\n\n
\n\nAfter running the above command, you should see the compiled contracts in the `artifacts-pvm` directory. This directory contains the ABI and bytecode of your contracts."}
@@ -1525,6 +1539,18 @@
{"page_id": "smart-contracts-for-eth-devs-json-rpc-apis", "page_title": "JSON-RPC APIs", "index": 32, "depth": 3, "title": "debug_traceCall", "anchor": "debug_tracecall", "start_char": 28867, "end_char": 31324, "estimated_token_count": 767, "token_estimator": "heuristic-v1", "text": "### debug_traceCall\n\nExecutes a new message call and returns a detailed execution trace without creating a transaction on the blockchain.\n\n**Parameters**:\n\n- **`transaction` ++\"object\"++**: The transaction call object, similar to `eth_call` parameters.\n - **`to` ++\"string\"++**: Recipient address of the call. Must be a [20-byte data](https://ethereum.org/en/developers/docs/apis/json-rpc/#unformatted-data-encoding){target=\\_blank} string.\n - **`data` ++\"string\"++**: Hash of the method signature and encoded parameters. Must be a [data](https://ethereum.org/en/developers/docs/apis/json-rpc/#unformatted-data-encoding){target=\\_blank} string.\n - **`from` ++\"string\"++**: (Optional) Sender's address for the call. Must be a [20-byte data](https://ethereum.org/en/developers/docs/apis/json-rpc/#unformatted-data-encoding){target=\\_blank} string.\n - **`gas` ++\"string\"++**: (Optional) Gas limit to execute the call. Must be a [quantity](https://ethereum.org/en/developers/docs/apis/json-rpc/#quantities-encoding){target=\\_blank} string.\n - **`gasPrice` ++\"string\"++**: (Optional) Gas price per unit of gas. Must be a [quantity](https://ethereum.org/en/developers/docs/apis/json-rpc/#quantities-encoding){target=\\_blank} string.\n - **`value` ++\"string\"++**: (Optional) Value in wei to send with the call. Must be a [quantity](https://ethereum.org/en/developers/docs/apis/json-rpc/#quantities-encoding){target=\\_blank} string.\n- **`blockValue` ++\"string\"++**: (Optional) Block tag or block number to execute the call at. Must be a [quantity](https://ethereum.org/en/developers/docs/apis/json-rpc/#quantities-encoding){target=\\_blank} string or a [default block parameter](https://ethereum.org/en/developers/docs/apis/json-rpc/#default-block){target=\\_blank}.\n- **`options` ++\"object\"++**: (Optional) An object containing tracer options (e.g., `tracer: \"callTracer\"`).\n\n**Example**:\n\n```bash title=\"debug_traceCall\"\ncurl -X POST https://testnet-passet-hub-eth-rpc.polkadot.io \\\n-H \"Content-Type: application/json\" \\\n--data '{\n \"jsonrpc\":\"2.0\",\n \"method\":\"debug_traceCall\",\n \"params\":[{\n \"from\": \"INSERT_SENDER_ADDRESS\",\n \"to\": \"INSERT_RECIPIENT_ADDRESS\",\n \"data\": \"INSERT_ENCODED_CALL\"\n }, \"INSERT_BLOCK_VALUE\", {\"tracer\": \"callTracer\"}],\n \"id\":1\n}'\n```\n\nEnsure to replace the `INSERT_SENDER_ADDRESS`, `INSERT_RECIPIENT_ADDRESS`, `INSERT_ENCODED_CALL`, and `INSERT_BLOCK_VALUE` with the proper value.\n\n---"}
{"page_id": "smart-contracts-for-eth-devs-json-rpc-apis", "page_title": "JSON-RPC APIs", "index": 33, "depth": 2, "title": "Response Format", "anchor": "response-format", "start_char": 31324, "end_char": 31507, "estimated_token_count": 57, "token_estimator": "heuristic-v1", "text": "## Response Format\n\nAll responses follow the standard JSON-RPC 2.0 format:\n\n```json\n{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"result\": ... // The return value varies by method\n}\n```"}
{"page_id": "smart-contracts-for-eth-devs-json-rpc-apis", "page_title": "JSON-RPC APIs", "index": 34, "depth": 2, "title": "Error Handling", "anchor": "error-handling", "start_char": 31507, "end_char": 31726, "estimated_token_count": 64, "token_estimator": "heuristic-v1", "text": "## Error Handling\n\nIf an error occurs, the response will include an error object:\n\n```json\n{\n \"jsonrpc\": \"2.0\",\n \"id\": 1,\n \"error\": {\n \"code\": -32000,\n \"message\": \"Error message here\"\n }\n}\n```"}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 0, "depth": 2, "title": "Introduction", "anchor": "introduction", "start_char": 37, "end_char": 303, "estimated_token_count": 40, "token_estimator": "heuristic-v1", "text": "## Introduction\n\nThis guide helps Ethereum developers migrate their smart contracts to Polkadot Hub. Most contracts work without modifications on the REVM backend, while the PolkaVM backend offers enhanced performance with minimal adaptation for standard patterns."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 1, "depth": 2, "title": "Migration Considerations", "anchor": "migration-considerations", "start_char": 303, "end_char": 645, "estimated_token_count": 62, "token_estimator": "heuristic-v1", "text": "## Migration Considerations\n\nTake into account the following considerations before migrating your contracts:\n\n- Standard ERC-20, ERC-721, ERC-1155 tokens work without changes.\n- DeFi protocols, DEXs, and AMMs migrate seamlessly.\n- DAOs and governance contracts are fully compatible.\n- Most Solidity contracts deploy identically to Ethereum."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 2, "depth": 2, "title": "Migration Checklist", "anchor": "migration-checklist", "start_char": 645, "end_char": 1058, "estimated_token_count": 81, "token_estimator": "heuristic-v1", "text": "## Migration Checklist\n\nBefore migrating your contracts, review this checklist:\n\n- Factory contracts using PVM bytecode need pre-uploaded dependencies.\n- Contracts using `EXTCODECOPY` for runtime manipulation require review (for projects that will use PVM bytecode, not EVM bytecode).\n- Replace `transfer()` and `send()` with proper reentrancy guards (for projects that will use PVM bytecode, not EVM bytecode)."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 3, "depth": 2, "title": "Migration FAQs", "anchor": "migration-faqs", "start_char": 1058, "end_char": 1077, "estimated_token_count": 4, "token_estimator": "heuristic-v1", "text": "## Migration FAQs"}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 4, "depth": 3, "title": "Which backend should I choose?", "anchor": "which-backend-should-i-choose", "start_char": 1077, "end_char": 1706, "estimated_token_count": 107, "token_estimator": "heuristic-v1", "text": "### Which backend should I choose?\n\n- Choose REVM if you want:\n\n - Zero-modification deployment of existing Ethereum contracts.\n - Exact EVM behavior for audited code.\n - Compatibility with tools that inspect EVM bytecode.\n - Rapid deployment without optimization.\n\n- Choose PolkaVM if you want:\n\n - Better performance for computation-heavy applications.\n - Lower execution costs for intensive operations.\n - Access to next-generation smart contract features.\n\nIf you are unsure which to choose, start with REVM for immediate compatibility, then consider PolkaVM for performance optimization once deployed."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 5, "depth": 3, "title": "Do I need to rewrite my Solidity code?", "anchor": "do-i-need-to-rewrite-my-solidity-code", "start_char": 1706, "end_char": 1825, "estimated_token_count": 26, "token_estimator": "heuristic-v1", "text": "### Do I need to rewrite my Solidity code?\n\nNo, for most contracts. Standard Solidity patterns work on both backends."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 6, "depth": 3, "title": "What about factory contracts?", "anchor": "what-about-factory-contracts", "start_char": 1825, "end_char": 3177, "estimated_token_count": 244, "token_estimator": "heuristic-v1", "text": "### What about factory contracts?\n\n- **REVM**: Factory contracts work identically to Ethereum with no changes needed. \n \n The original factory pattern is:\n\n ```solidity\n contract TokenFactory {\n function createToken(string memory name) public returns (address) {\n // Creates new contract at runtime\n Token newToken = new Token(name);\n return address(newToken);\n }\n }\n ```\n\n- **PolkaVM**: Factory contracts require pre-uploading dependent contracts. \n\n Here's how to adapt the original factory pattern:\n\n ```solidity\n contract TokenFactory {\n // Reference pre-uploaded Token contract by hash\n bytes32 public tokenCodeHash;\n \n constructor(bytes32 _tokenCodeHash) {\n tokenCodeHash = _tokenCodeHash;\n }\n \n function createToken(string memory name) public returns (address) {\n // Instantiate from pre-uploaded code\n Token newToken = new Token{salt: keccak256(abi.encode(name))}(name);\n return address(newToken);\n }\n }\n ```\n\nThe deployment steps for PolkaVM factories are:\n\n1. Upload the contract code to the chain.\n2. Note the returned code hash.\n3. Deploy the Factory contract with the contract code hash.\n4. Factory can now instantiate contracts using the pre-uploaded code."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 7, "depth": 3, "title": "How do gas costs compare?", "anchor": "how-do-gas-costs-compare", "start_char": 3177, "end_char": 3328, "estimated_token_count": 47, "token_estimator": "heuristic-v1", "text": "### How do gas costs compare?\n\nFor more information on gas costs, see the [Gas Model](/smart-contracts/for-eth-devs/gas-model/){target=\\_blank} page."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 8, "depth": 3, "title": "Which Solidity features are not supported?", "anchor": "which-solidity-features-are-not-supported", "start_char": 3328, "end_char": 3915, "estimated_token_count": 133, "token_estimator": "heuristic-v1", "text": "### Which Solidity features are not supported?\n\nFor REVM, any Solidity feature will function smoothly without requiring changes or adaptations. For PVM, there are considerations, as was mentioned above. \n\nFor PolkaVM, there are some considerations:\n\n- `EXTCODECOPY`: Only works in constructor code.\n- Runtime code modification: Use on-chain constructors instead.\n- **Gas stipends**: `address.send()` and `address.transfer()` don't provide reentrancy protection.\n- **Unsupported operations**: `pc`, `extcodecopy`, `selfdestruct`, `blobhash`, and `blobbasefee` (blob-related operations)."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 9, "depth": 3, "title": "How do I handle the existential deposit?", "anchor": "how-do-i-handle-the-existential-deposit", "start_char": 3915, "end_char": 4518, "estimated_token_count": 121, "token_estimator": "heuristic-v1", "text": "### How do I handle the existential deposit?\n\nPolkadot requires accounts to maintain a minimum balance (existential deposit or ED) to remain active.\n\nThis is handled automatically for you:\n\n- Balance queries via Ethereum RPC automatically deduct the ED.\n- New account transfers include ED in transaction fees.\n- Contract-to-contract transfers draw ED from the transaction signer.\n\nYou typically don't need to do anything special, but be aware:\n\n- Accounts below ED threshold are automatically deleted.\n- ED is around 0.01 DOT (varies by network).\n- Your contracts don't need to manage this explicitly."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 10, "depth": 3, "title": "Can I use my existing development tools?", "anchor": "can-i-use-my-existing-development-tools", "start_char": 4518, "end_char": 5499, "estimated_token_count": 304, "token_estimator": "heuristic-v1", "text": "### Can I use my existing development tools?\n\nYes. Both backends support:\n\n- **Wallets**: [MetaMask](https://metamask.io/){target=\\_blank}, [Talisman](https://talisman.xyz/){target=\\_blank}, [SubWallet](https://www.subwallet.app/){target=\\_blank}\n- **Development frameworks**: [Hardhat](/smart-contracts/cookbook/smart-contracts/deploy-basic/hardhat/){target=\\_blank}, [Foundry](/smart-contracts/cookbook/smart-contracts/deploy-basic/foundry/){target=\\_blank}, [Remix](/smart-contracts/cookbook/smart-contracts/deploy-basic/remix/){target=\\_blank} (just consider that for PVM bytecode, you will use the Polkadot version of the tooling)\n- **Libraries**: [ethers.js](/smart-contracts/libraries/ethers-js/){target=\\_blank}, [web3.js](/smart-contracts/libraries/web3-js/){target=\\_blank}, [viem](/smart-contracts/libraries/viem/){target=\\_blank}\n- **Testing tools**: Your existing test suites work\n\nConnect to Polkadot Hub's Ethereum JSON-RPC endpoint and use your familiar workflow."}
+{"page_id": "smart-contracts-for-eth-devs-migration", "page_title": "Migration FAQs and Considerations", "index": 11, "depth": 2, "title": "Conclusion", "anchor": "conclusion", "start_char": 5499, "end_char": 6247, "estimated_token_count": 153, "token_estimator": "heuristic-v1", "text": "## Conclusion\n\nMost Ethereum contracts migrate to Polkadot Hub with minimal or no changes. Use REVM for seamless compatibility or PolkaVM for enhanced performance.\n\nThere are a few key points to keep in mind during migration:\n\n- Replace `transfer()` and `send()` with `.call{value}(\"\")` and use reentrancy guards (for projects that will use PVM bytecode, not EVM bytecode).\n- PolkaVM factory contracts using PVM bytecode need pre-uploaded dependencies.\n- Don't hardcode gas values.\n- Test thoroughly on [TestNet](/smart-contracts/connect/#__tabbed_1_1){target=\\_blank} before mainnet deployment.\n\nYour existing Solidity knowledge and tooling transfer directly to Polkadot Hub, making migration straightforward for standard smart contract patterns."}
{"page_id": "smart-contracts-get-started", "page_title": "Get Started with Smart Contracts", "index": 0, "depth": 2, "title": "Quick Starts", "anchor": "quick-starts", "start_char": 173, "end_char": 1843, "estimated_token_count": 456, "token_estimator": "heuristic-v1", "text": "## Quick Starts\n\nKick off development fast with curated links for connecting, funding, exploring, and deploying your first contract.\n\n| Quick Start | Tools | Description |\n| :-------------------------------------------------------------------------------------------------: | :-------------------: | :-------------------------------------------------------------: |\n| [Connect to Polkadot](/smart-contracts/connect/){target=\\_blank} | Polkadot.js, MetaMask | Add the network, configure RPC, verify activity in the explorer |\n| [Get Test Tokens](/smart-contracts/faucets/){target=\\_blank} | - | Request test funds to deploy and interact with contracts |\n| [Explore Transactions](/smart-contracts/explorers/){target=\\_blank} | Subscan | Inspect transactions, logs, token transfers, and contract state |\n| [Deploy with Remix](/smart-contracts/dev-environments/remix/deploy-a-contract/){target=\\_blank} | Remix | One‑click browser deployment to Polkadot Hub |\n| [Deploy with Foundry](/smart-contracts/dev-environments/foundry/deploy-a-contract/){target=\\_blank} | Foundry | Scripted deployments and testing from the CLI |\n| [Deploy with Hardhat](/smart-contracts/dev-environments/hardhat/deploy-a-contract/){target=\\_blank} | Hardhat | Project scaffolding, testing, and deployments |"}
{"page_id": "smart-contracts-get-started", "page_title": "Get Started with Smart Contracts", "index": 1, "depth": 2, "title": "Build and Test Locally", "anchor": "build-and-test-locally", "start_char": 1843, "end_char": 4050, "estimated_token_count": 596, "token_estimator": "heuristic-v1", "text": "## Build and Test Locally\n\nSet up local environments and CI-friendly workflows to iterate quickly and validate changes before deploying.\n\n| Build and Test Locally | Tools | Description |\n| :--------------------------------------------------------------------------------------------------------: | :---------------: | :--------------------------------------------------: |\n| [Run a Local Dev Node](/smart-contracts/dev-environments/local-dev-node/){target=\\_blank} | Polkadot SDK node | Spin up a local node for iterative development |\n| [Remix: Get Started](/smart-contracts/dev-environments/remix/get-started/){target=\\_blank} | Remix | Connect Remix to Polkadot Hub and configure accounts |\n| [Remix: Verify a Contract](/smart-contracts/dev-environments/remix/verify-a-contract/){target=\\_blank} | Remix | Publish verified source on explorers |\n| [Foundry: Install and Config](/smart-contracts/dev-environments/foundry/install-and-config/){target=\\_blank} | Foundry | Install toolchain and configure networks |\n| [Foundry: Compile and Test](/smart-contracts/dev-environments/foundry/compile-and-test/){target=\\_blank} | Foundry | Write and run Solidity tests locally |\n| [Foundry: Verify a Contract](/smart-contracts/dev-environments/foundry/verify-a-contract/){target=\\_blank} | Foundry | Verify deployed bytecode and metadata |\n| [Hardhat: Install and Config](/smart-contracts/dev-environments/hardhat/install-and-config/){target=\\_blank} | Hardhat | Initialize a project and configure networks |\n| [Hardhat: Compile and Test](/smart-contracts/dev-environments/hardhat/compile-and-test/){target=\\_blank} | Hardhat | Unit test contracts and run scripts |\n| [Hardhat: Verify a Contract](/smart-contracts/dev-environments/hardhat/verify-a-contract/){target=\\_blank} | Hardhat | Verify deployments on explorers |"}
{"page_id": "smart-contracts-get-started", "page_title": "Get Started with Smart Contracts", "index": 2, "depth": 2, "title": "Ethereum Developer Resources", "anchor": "ethereum-developer-resources", "start_char": 4050, "end_char": 5794, "estimated_token_count": 488, "token_estimator": "heuristic-v1", "text": "## Ethereum Developer Resources\n\nBridge your Ethereum knowledge with Polkadot Hub specifics: account mapping, fees, JSON‑RPC, and deployment.\n\n| Ethereum Developer Guides | Description |\n| :-------------------------------------------------------------------------------------------------------: | :-------------------------------------------------------------: |\n| [Accounts](/smart-contracts/for-eth-devs/accounts/){target=\\_blank} | How 20‑byte Ethereum addresses map to 32‑byte Polkadot accounts |\n| [Blocks, Transactions, and Fees](/smart-contracts/for-eth-devs/blocks-transactions-fees/){target=\\_blank} | Transaction types, fees, and multi‑dimensional metering |\n| [Gas Model](/smart-contracts/for-eth-devs/gas-model/){target=\\_blank} | Gas vs. weight, proof size, and storage deposits |\n| [Contract Deployment](/smart-contracts/for-eth-devs/contract-deployment/){target=\\_blank} | Deployment patterns and best practices on Polkadot Hub |\n| [JSON‑RPC APIs](/smart-contracts/for-eth-devs/json-rpc-apis/){target=\\_blank} | Supported Ethereum JSON‑RPC methods and examples |\n| [Migration](/smart-contracts/for-eth-devs/migration/){target=\\_blank} | Port existing apps and tooling to Polkadot Hub |\n| [Dual VM Stack](/smart-contracts/for-eth-devs/dual-vm-stack/){target=\\_blank} | Overview of EVM and native execution on the Hub |"}
diff --git a/llms.txt b/llms.txt
index 3ba08e18f..82be529cf 100644
--- a/llms.txt
+++ b/llms.txt
@@ -6,10 +6,11 @@
This directory lists URLs for raw Markdown pages that complement the rendered pages on the documentation site. Use these Markdown files to retain semantic context when prompting models while avoiding passing HTML elements.
## Metadata
-- Documentation pages: 269
+- Documentation pages: 271
- Categories: 12
## Docs
+This section lists documentation pages by category. Each entry links to a raw markdown version of the page and includes a short description. A page may appear in multiple categories.
Docs: Basics
- [Register a Local Asset](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/chain-interactions-token-operations-register-local-asset.md): Comprehensive guide to registering a local asset on the Asset Hub system parachain, including step-by-step instructions.
@@ -95,6 +96,7 @@ Docs: Smart Contracts
- [Block Explorers](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-explorers.md): Access PolkaVM explorers like Subscan, BlockScout, and Routescan to track transactions, analyze contracts, and view on-chain data from smart contracts.
- [Faucet](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-faucet.md): Learn how to obtain test tokens from Polkadot faucets for development and testing purposes across different networks.
- [Contract Deployment](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-for-eth-devs-contract-deployment.md): Compare deployment flows for REVM and PVM-based smart contracts on the Polkadot Hub. Includes single-step REVM flows and PVM’s two-step deployment model.
+- [Migration FAQs and Considerations](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-for-eth-devs-migration.md): Learn how to migrate your existing Ethereum contracts to the Polkadot Hub using REVM and PolkaVM by following these considerations.
- [Get Started with Smart Contracts](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-get-started.md): Practical examples for building and deploying smart contracts on Polkadot Hub, from connecting and tooling to deployment, integrations, and precompiles.
- [Wallets for Polkadot Hub](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-integrations-wallets.md): Comprehensive guide to connecting and managing wallets for Polkadot Hub, covering step-by-step instructions for interacting with the ecosystem.
- [Deploy Contracts to Polkadot Hub with Ethers.js](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-libraries-ethers-js.md): Learn how to interact with Polkadot Hub using Ethers.js, from compiling and deploying Solidity contracts to interacting with deployed smart contracts.
@@ -194,12 +196,14 @@ Docs: Polkadot Protocol
- [Node and Runtime](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-node-and-runtime.md): Learn how Polkadot SDK-based nodes function, how the client and runtime are separated, and how they communicate using SCALE-encoded data.
- [Randomness](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-randomness.md): Explore the importance of randomness in PoS blockchains, focusing on Polkadot’s VRF-based approach to ensure fairness and security in validator selection.
- [Asset Hub](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-assets-and-smart-contracts.md): Learn about Asset Hub in Polkadot, managing on-chain assets, foreign asset integration, and using XCM for cross-chain asset transfers.
+- [Polkadot Hub Assets](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-assets.md): Learn about asset management on Polkadot Hub, including on-chain assets, foreign asset integration, and XCM for cross-chain asset transfers.
- [Bridge Hub](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-bridging.md): Learn about the Bridge Hub system parachain, a parachain that facilitates the interactions from Polkadot to the rest of Web3.
- [Collectives Chain](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-collectives-and-daos.md): Learn how the Collectives chain provides infrastructure for governance organizations, enabling decentralized network stewardship and decision-making.
- [Agile Coretime](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-consensus-and-security-agile-coretime.md): Explore the efficient scheduling mechanisms to access Polkadot cores to produce blockspace continuously or on-demand.
- [Proof of Stake Consensus](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-consensus-and-security-pos-consensus.md): Explore Polkadot's consensus protocols for secure, scalable, and decentralized network operation, including NPoS, BABE, GRANDPA, and BEEFY.
- [Overview of the Polkadot Relay Chain](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-consensus-and-security-relay-chain.md): Explore Polkadot's core architecture, including its multi-chain vision, shared security, and the DOT token's governance and staking roles.
- [People Chain](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-people-and-identity.md): Learn how People chain secures decentralized identity management, empowering users to control and verify digital identities without central authorities.
+- [Polkadot Hub Smart Contracts](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub-smart-contracts.md): Learn how Polkadot Hub supports smart contracts through the REVM, a Rust-based Ethereum Virtual Machine compatible runtime.
- [Accounts in Asset Hub Smart Contracts](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-for-eth-devs-accounts.md): Bridges Ethereum's 20-byte addresses with Polkadot's 32-byte accounts, enabling seamless interaction while maintaining compatibility with Ethereum tooling.
- [Transactions and Fees on Asset Hub](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-for-eth-devs-blocks-transactions-fees.md): Explore how Asset Hub smart contracts handle blocks, transactions, and fees with EVM compatibility, supporting various Ethereum transaction types.
- [Dual Virtual Machine Stack](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-for-eth-devs-dual-vm-stack.md): Compare Polkadot’s dual smart contract VMs—REVM for EVM compatibility and PolkaVM for RISC-V performance, flexibility, and efficiency.
@@ -353,7 +357,6 @@ Docs: Uncategorized
- [ParaSpell XCM SDK](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-tools-paraspell.md): A powerful open-source library that simplifies XCM integration, enabling developers to easily build interoperable dApps on Polkadot.
- [reference-tools-zombienet](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-tools-zombienet.md): No description available.
- [reference](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference.md): No description available.
-- [smart-contracts-cookbook-dapps-zero-to-hero](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-dapps-zero-to-hero.md): No description available.
- [smart-contracts-cookbook-smart-contracts-deploy-basic](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-basic.md): No description available.
- [smart-contracts-dev-environments-foundry-compile-and-test](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-dev-environments-foundry-compile-and-test.md): No description available.
- [smart-contracts-dev-environments-foundry-deploy-a-contract](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-dev-environments-foundry-deploy-a-contract.md): No description available.
@@ -370,7 +373,6 @@ Docs: Uncategorized
- [smart-contracts-dev-environments-remix-troubleshooting](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-dev-environments-remix-troubleshooting.md): No description available.
- [smart-contracts-dev-environments-remix-verify-a-contract](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-dev-environments-remix-verify-a-contract.md): No description available.
- [Gas Model on the Polkadot Hub](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-for-eth-devs-gas-model.md): Learn how gas estimation, pricing, and weight mapping work in the Polkadot Hub.
-- [smart-contracts-for-eth-devs-migration](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-for-eth-devs-migration.md): No description available.
- [smart-contracts-integrations-indexers](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-integrations-indexers.md): No description available.
- [smart-contracts-integrations-oracles](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-integrations-oracles.md): No description available.
- [Advanced Functionalities via Precompiles](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-precompiles.md): Explores how Polkadot integrates precompiles to run essential functions natively, improving the speed and efficiency of smart contracts on the Hub.
diff --git a/reference/polkadot-hub/.nav.yml b/reference/polkadot-hub/.nav.yml
index 51b83e908..61dfe09e4 100644
--- a/reference/polkadot-hub/.nav.yml
+++ b/reference/polkadot-hub/.nav.yml
@@ -1,7 +1,8 @@
nav:
- 'Overview': index.md
+ - 'Smart Contracts': smart-contracts.md
- 'Consensus and Security': consensus-and-security
- - 'Assets and Smart Contracts': assets-and-smart-contracts
+ - 'Asset Management': assets.md
- 'Bridging': bridging.md
- 'People and Identity': people-and-identity.md
- 'Collectives and DAOs': collectives-and-daos.md
diff --git a/reference/polkadot-hub/assets-and-smart-contracts.md b/reference/polkadot-hub/assets-and-smart-contracts.md
deleted file mode 100644
index a8b5bb112..000000000
--- a/reference/polkadot-hub/assets-and-smart-contracts.md
+++ /dev/null
@@ -1,235 +0,0 @@
----
-title: Asset Hub
-description: Learn about Asset Hub in Polkadot, managing on-chain assets, foreign asset integration, and using XCM for cross-chain asset transfers.
-categories: Polkadot Protocol
----
-
-# Asset Hub
-
-## Introduction
-
-The Asset Hub is a critical component in the Polkadot ecosystem, enabling the management of fungible and non-fungible assets across the network. Since the relay chain focuses on maintaining security and consensus without direct asset management, Asset Hub provides a streamlined platform for creating, managing, and using on-chain assets in a fee-efficient manner. This guide outlines the core features of Asset Hub, including how it handles asset operations, cross-chain transfers, and asset integration using XCM, as well as essential tools like [API Sidecar](#api-sidecar) and [`TxWrapper`](#txwrapper) for developers working with on-chain assets.
-
-## Assets Basics
-
-In the Polkadot ecosystem, the relay chain does not natively support additional assets beyond its native token (DOT for Polkadot, KSM for Kusama). The Asset Hub parachain on Polkadot and Kusama provides a fungible and non-fungible assets framework. Asset Hub allows developers and users to create, manage, and use assets across the ecosystem.
-
-Asset creators can use Asset Hub to track their asset issuance across multiple parachains and manage assets through operations such as minting, burning, and transferring. Projects that need a standardized method of handling on-chain assets will find this particularly useful. The fungible asset interface provided by Asset Hub closely resembles Ethereum's ERC-20 standard but is directly integrated into Polkadot's runtime, making it more efficient in terms of speed and transaction fees.
-
-Integrating with Asset Hub offers several key benefits, particularly for infrastructure providers and users:
-
-- **Support for non-native on-chain assets**: Asset Hub enables seamless asset creation and management, allowing projects to develop tokens or assets that can interact with the broader ecosystem.
-- **Lower transaction fees**: Asset Hub offers significantly lower transaction costs—approximately one-tenth of the fees on the relay chain, providing cost-efficiency for regular operations.
-- **Reduced deposit requirements**: Depositing assets in Asset Hub is more accessible, with deposit requirements that are around one one-hundredth of those on the relay chain.
-- **Payment of transaction fees with non-native assets**: Users can pay transaction fees in assets other than the native token (DOT or KSM), offering more flexibility for developers and users.
-
-Assets created on the Asset Hub are stored as part of a map, where each asset has a unique ID that links to information about the asset, including details like:
-
-- The management team.
-- The total supply.
-- The number of accounts holding the asset.
-- **Sufficiency for account existence**: Whether the asset alone is enough to maintain an account without a native token balance.
-- The metadata of the asset, including its name, symbol, and the number of decimals for representation.
-
-Some assets can be regarded as sufficient to maintain an account's existence, meaning that users can create accounts on the network without needing a native token balance (i.e., no existential deposit required). Developers can also set minimum balances for their assets. If an account's balance drops below the minimum, the balance is considered dust and may be cleared.
-
-## Assets Pallet
-
-The Polkadot SDK's Assets pallet is a powerful module designated for creating and managing fungible asset classes with a fixed supply. It offers a secure and flexible way to issue, transfer, freeze, and destroy assets. The pallet supports various operations and includes permissioned and non-permissioned functions to cater to simple and advanced use cases.
-
-Visit the [Assets Pallet Rust docs](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/index.html){target=\_blank} for more in-depth information.
-
-### Key Features
-
-Key features of the Assets pallet include:
-
-- **Asset issuance**: Allows the creation of a new asset, where the total supply is assigned to the creator's account.
-- **Asset transfer**: Enables transferring assets between accounts while maintaining a balance in both accounts.
-- **Asset freezing**: Prevents transfers of a specific asset from one account, locking it from further transactions.
-- **Asset destruction**: Allows accounts to burn or destroy their holdings, removing those assets from circulation.
-- **Non-custodial transfers**: A non-custodial mechanism to enable one account to approve a transfer of assets on behalf of another.
-
-### Main Functions
-
-The Assets pallet provides a broad interface for managing fungible assets. Some of the main dispatchable functions include:
-
-- **`create()`**: Create a new asset class by placing a deposit, applicable when asset creation is permissionless.
-- **`issue()`**: Mint a fixed supply of a new asset and assign it to the creator's account.
-- **`transfer()`**: Transfer a specified amount of an asset between two accounts.
-- **`approve_transfer()`**: Approve a non-custodial transfer, allowing a third party to move assets between accounts.
-- **`destroy()`**: Destroy an entire asset class, removing it permanently from the chain.
-- **`freeze()` and `thaw()`**: Administrators or privileged users can lock or unlock assets from being transferred.
-
-For a full list of dispatchable and privileged functions, see the [dispatchables Rust docs](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/enum.Call.html){target=\_blank}.
-
-### Querying Functions
-
-The Assets pallet exposes several key querying functions that developers can interact with programmatically. These functions allow you to query asset information and perform operations essential for managing assets across accounts. The two main querying functions are:
-
-- **`balance(asset_id, account)`**: Retrieves the balance of a given asset for a specified account. Useful for checking the holdings of an asset class across different accounts.
-
-- **`total_supply(asset_id)`**: Returns the total supply of the asset identified by `asset_id`. Allows users to verify how much of the asset exists on-chain.
-
-In addition to these basic functions, other utility functions are available for querying asset metadata and performing asset transfers. You can view the complete list of querying functions in the [Struct Pallet Rust docs](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/struct.Pallet.html){target=\_blank}.
-
-### Permission Models and Roles
-
-The Assets pallet incorporates a robust permission model, enabling control over who can perform specific operations like minting, transferring, or freezing assets. The key roles within the permission model are:
-
-- **Admin**: Can freeze (preventing transfers) and forcibly transfer assets between accounts. Admins also have the power to reduce the balance of an asset class across arbitrary accounts. They manage the more sensitive and administrative aspects of the asset class.
-- **Issuer**: Responsible for minting new tokens. When new assets are created, the Issuer is the account that controls their distribution to other accounts.
-- **Freezer**: Can lock the transfer of assets from an account, preventing the account holder from moving their balance. This function is useful for freezing accounts involved in disputes or fraud.
-- **Owner**: Has overarching control, including destroying an entire asset class. Owners can also set or update the Issuer, Freezer, and Admin roles.
-
-These permissions provide fine-grained control over assets, enabling developers and asset managers to ensure secure, controlled operations. Each of these roles is crucial for managing asset lifecycles and ensuring that assets are used appropriately across the network.
-
-### Asset Freezing
-
-The Assets pallet allows you to freeze assets. This feature prevents transfers or spending from a specific account, effectively locking the balance of an asset class until it is explicitly unfrozen. Asset freezing is beneficial when assets are restricted due to security concerns or disputes.
-
-Freezing assets is controlled by the Freezer role, as mentioned earlier. Only the account with the Freezer privilege can perform these operations. Here are the key freezing functions:
-
-- **`freeze(asset_id, account)`**: Locks the specified asset of the account. While the asset is frozen, no transfers can be made from the frozen account.
-- **`thaw(asset_id, account)`**: Corresponding function for unfreezing, allowing the asset to be transferred again.
-
-This approach enables secure and flexible asset management, providing administrators the tools to control asset movement in special circumstances.
-
-### Non-Custodial Transfers (Approval API)
-
-The Assets pallet also supports non-custodial transfers through the Approval API. This feature allows one account to approve another account to transfer a specific amount of its assets to a third-party recipient without granting full control over the account's balance. Non-custodial transfers enable secure transactions where trust is required between multiple parties.
-
-Here's a brief overview of the key functions for non-custodial asset transfers:
-
-- **`approve_transfer(asset_id, delegate, amount)`**: Approves a delegate to transfer up to a certain amount of the asset on behalf of the original account holder.
-- **`cancel_approval(asset_id, delegate)`**: Cancels a previous approval for the delegate. Once canceled, the delegate no longer has permission to transfer the approved amount.
-- **`transfer_approved(asset_id, owner, recipient, amount)`**: Executes the approved asset transfer from the owner’s account to the recipient. The delegate account can call this function once approval is granted.
-
-These delegated operations make it easier to manage multi-step transactions and dApps that require complex asset flows between participants.
-
-## Foreign Assets
-
-Foreign assets in Asset Hub refer to assets originating from external blockchains or parachains that are registered in the Asset Hub. These assets are typically native tokens from other parachains within the Polkadot ecosystem or bridged tokens from external blockchains such as Ethereum.
-
-Once a foreign asset is registered in the Asset Hub by its originating blockchain's root origin, users are able to send these tokens to the Asset Hub and interact with them as they would any other asset within the Polkadot ecosystem.
-
-### Handling Foreign Assets
-
-The Foreign Assets pallet, an instance of the Assets pallet, manages these assets. Since foreign assets are integrated into the same interface as native assets, developers can use the same functionalities, such as transferring and querying balances. However, there are important distinctions when dealing with foreign assets.
-
-- **Asset identifier**: Unlike native assets, foreign assets are identified using an XCM Multilocation rather than a simple numeric `AssetId`. This multilocation identifier represents the cross-chain location of the asset and provides a standardized way to reference it across different parachains and relay chains.
-
-- **Transfers**: Once registered in the Asset Hub, foreign assets can be transferred between accounts, just like native assets. Users can also send these assets back to their originating blockchain if supported by the relevant cross-chain messaging mechanisms.
-
-## Integration
-
-Asset Hub supports a variety of integration tools that make it easy for developers to manage assets and interact with the blockchain in their applications. The tools and libraries provided by Parity Technologies enable streamlined operations, such as querying asset information, building transactions, and monitoring cross-chain asset transfers.
-
-Developers can integrate Asset Hub into their projects using these core tools:
-
-### API Sidecar
-
-[API Sidecar](https://github.com/paritytech/substrate-api-sidecar){target=\_blank} is a RESTful service that can be deployed alongside Polkadot and Kusama nodes. It provides endpoints to retrieve real-time blockchain data, including asset information. When used with Asset Hub, Sidecar allows querying:
-
-- **Asset look-ups**: Retrieve specific assets using `AssetId`.
-- **Asset balances**: View the balance of a particular asset on Asset Hub.
-
-Public instances of API Sidecar connected to Asset Hub are available, such as:
-
-- [Polkadot Asset Hub Sidecar](https://polkadot-asset-hub-public-sidecar.parity-chains.parity.io/){target=\_blank}
-- [Kusama Asset Hub Sidecar](https://kusama-asset-hub-public-sidecar.parity-chains.parity.io/){target=\_blank}
-
-These public instances are primarily for ad-hoc testing and quick checks.
-
-### TxWrapper
-
-[`TxWrapper`](https://github.com/paritytech/txwrapper-core){target=\_blank} is a library that simplifies constructing and signing transactions for Polkadot SDK-based chains, including Polkadot and Kusama. This tool includes support for working with Asset Hub, enabling developers to:
-
-- Construct offline transactions.
-- Leverage asset-specific functions such as minting, burning, and transferring assets.
-
-`TxWrapper` provides the flexibility needed to integrate asset operations into custom applications while maintaining the security and efficiency of Polkadot's transaction model.
-
-### ParaSpell
-
-[ParaSpell](https://paraspell.xyz/){target=\_blank} is a collection of open-source XCM tools designed to streamline cross-chain asset transfers and interactions within the Polkadot and Kusama ecosystems. It equips developers with an intuitive interface to manage and optimize XCM-based functionalities. Some key points included by ParaSpell are:
-
-- **[XCM SDK](https://paraspell.xyz/#xcm-sdk){target=\_blank}**: Provides a unified layer to incorporate XCM into decentralized applications, simplifying complex cross-chain interactions.
-- **[XCM API](https://paraspell.xyz/#xcm-api){target=\_blank}**: Offers an efficient, package-free approach to integrating XCM functionality while offloading heavy computing tasks, minimizing costs and improving application performance.
-- **[XCM router](https://paraspell.xyz/#xcm-router){target=\_blank}**: Enables cross-chain asset swaps in a single command, allowing developers to send one asset type (such as DOT on Polkadot) and receive a different asset on another chain (like ASTR on Astar).
-- **[XCM analyser](https://paraspell.xyz/#xcm-analyser){target=\_blank}**: Decodes and translates complex XCM multilocation data into readable information, supporting easier troubleshooting and debugging.
-- **[XCM visualizator](https://paraspell.xyz/#xcm-visualizator){target=\_blank}**: A tool designed to give developers a clear, interactive view of XCM activity across the Polkadot ecosystem, providing insights into cross-chain communication flow.
-
-ParaSpell's tools make it simple for developers to build, test, and deploy cross-chain solutions without needing extensive knowledge of the XCM protocol. With features like message composition, decoding, and practical utility functions for parachain interactions, ParaSpell is especially useful for debugging and optimizing cross-chain communications.
-
-### Parachain Node
-
-To fully leverage the Asset Hub's functionality, developers will need to run a system parachain node. Setting up an Asset Hub node allows users to interact with the parachain in real time, syncing data and participating in the broader Polkadot ecosystem. Guidelines for setting up an [Asset Hub node](https://github.com/paritytech/polkadot-sdk/tree/{{dependencies.repositories.polkadot_sdk.version}}/cumulus#asset-hub-){target=\_blank} are available in the Parity documentation.
-
-Using these integration tools, developers can manage assets seamlessly and integrate Asset Hub functionality into their applications, leveraging Polkadot's powerful infrastructure.
-
-## XCM Transfer Monitoring
-
-Since Asset Hub facilitates cross-chain asset transfers across the Polkadot ecosystem, XCM transfer monitoring becomes an essential practice for developers and infrastructure providers. This section outlines how to monitor the cross-chain movement of assets between parachains, the relay chain, and other systems.
-
-### Monitor XCM Deposits
-
-As assets move between chains, tracking the cross-chain transfers in real time is crucial. Whether assets are transferred via a teleport from system parachains or through a reserve-backed transfer from any other parachain, each transfer emits a relevant event (such as the `balances.minted` event).
-
-To ensure accurate monitoring of these events:
-
-- **Track XCM deposits**: Query every new block created in the relay chain or Asset Hub, loop through the events array, and filter for any `balances.minted` events which confirm the asset was successfully transferred to the account.
-- **Track event origins**: Each `balances.minted` event points to a specific address. By monitoring this, service providers can verify that assets have arrived in the correct account.
-
-### Track XCM Information Back to the Source
-
-While the `balances.minted` event confirms the arrival of assets, there may be instances where you need to trace the origin of the cross-chain message that triggered the event. In such cases, you can:
-
-1. Query the relevant chain at the block where the `balances.minted` event was emitted.
-2. Look for a `messageQueue(Processed)` event within that block's initialization. This event contains a parameter (`Id`) that identifies the cross-chain message received by the relay chain or Asset Hub. You can use this `Id` to trace the message back to its origin chain, offering full visibility of the asset transfer's journey.
-
-### Practical Monitoring Examples
-
-The preceding sections outline the process of monitoring XCM deposits to specific accounts and then tracing back the origin of these deposits. The process of tracking an XCM transfer and the specific events to monitor may vary based on the direction of the XCM message. Here are some examples to showcase the slight differences:
-
-- **Transfer from parachain to relay chain**: Track `parachainsystem(UpwardMessageSent)` on the parachain and `messagequeue(Processed)` on the relay chain.
-- **Transfer from relay chain to parachain**: Track `xcmPallet(sent)` on the relay chain and `dmpqueue(ExecutedDownward)` on the parachain.
-- **Transfer between parachains**: Track `xcmpqueue(XcmpMessageSent)` on the system parachain and `xcmpqueue(Success)` on the destination parachain.
-
-### Monitor for Failed XCM Transfers
-
-Sometimes, XCM transfers may fail due to liquidity or other errors. Failed transfers emit specific error events, which are key to resolving issues in asset transfers. Monitoring for these failure events helps catch issues before they affect asset balances.
-
-- **Relay chain to system parachain**: Look for the `dmpqueue(ExecutedDownward)` event on the parachain with an `Incomplete` outcome and an error type such as `UntrustedReserveLocation`.
-- **Parachain to parachain**: Monitor for `xcmpqueue(Fail)` on the destination parachain with error types like `TooExpensive`.
-
-For detailed error management in XCM, see Gavin Wood's blog post on [XCM Execution and Error Management](https://polkadot.com/blog/xcm-part-three-execution-and-error-management/){target=\_blank}.
-
-## Where to Go Next
-
-
-
-- Tutorial __Register a Local Asset__
-
- ---
-
- Comprehensive guide to registering a local asset on the Asset Hub system parachain, including step-by-step instructions.
-
- [:octicons-arrow-right-24: Reference](/chain-interactions/token-operations/register-local-asset/)
-
-- Tutorial __Register a Foreign Asset__
-
- ---
-
- An in-depth guide to registering a foreign asset on the Asset Hub parachain, providing clear, step-by-step instructions.
-
- [:octicons-arrow-right-24: Reference](/chain-interactions/token-operations/register-foreign-asset/)
-
-- Tutorial __Convert Assets__
-
- ---
-
- A guide detailing the step-by-step process of converting assets on Asset Hub, helping users efficiently navigate asset management on the platform.
-
- [:octicons-arrow-right-24: Reference](/chain-interactions/token-operations/convert-assets/)
-
-
\ No newline at end of file
diff --git a/reference/polkadot-hub/assets.md b/reference/polkadot-hub/assets.md
new file mode 100644
index 000000000..453385dee
--- /dev/null
+++ b/reference/polkadot-hub/assets.md
@@ -0,0 +1,132 @@
+---
+title: Polkadot Hub Assets
+description: Learn about asset management on Polkadot Hub, including on-chain assets, foreign asset integration, and XCM for cross-chain asset transfers.
+categories: Polkadot Protocol
+---
+
+# Assets on Polkadot Hub
+
+## Introduction
+
+Polkadot Hub is Polkadot's system parachain for issuing and managing on-chain assets. While the relay chain provides security, Polkadot Hub handles asset logic—minting, burning, transfers, and metadata—efficiently and cost-effectively.
+
+Polkadot Hub supports native assets issued on the parachain and foreign assets from other chains, both of which can move seamlessly across the network via XCM.
+
+This guide explains how assets are created, managed, and moved across chains, including key operations, roles, and the differences between native and foreign assets.
+
+## Why Use Polkadot Hub?
+
+Polkadot Hub provides a standardized framework for creating and managing fungible and non-fungible assets. Projects can issue tokens, manage supply, and transfer assets across parachains, extending the functionality of the Polkadot relay chain, which only supports its native token (DOT).
+
+**Key features**:
+
+- **Built-in asset operations**: Mint, burn, and transfer like ERC-20 on Ethereum, but native to Polkadot's runtime.
+- **Custom asset creation**: Issue tokens or NFTs with configurable permissions and metadata.
+- **Low fees**: Transactions cost roughly one-tenth of relay chain fees.
+- **Lower deposits**: Minimal on-chain storage costs for asset data.
+- **Pay fees in any asset**: Users don’t need DOT to transact; supported assets can cover fees.
+- **Cross-chain ready**: Assets can be transferred to other parachains using XCM.
+
+## Types of Assets
+
+Polkadot Hub supports two types of assets:
+
+- **Native assets**: Tokens and NFTs issued directly on Polkadot Hub using the Assets pallet. These assets benefit from the platform's custom features, such as configurable permissions and low fees
+- **Foreign assets**: Tokens originating from other Polkadot parachains or external networks (like Ethereum, via bridges). Once registered on Polkadot Hub, they are treated similarly to native assets.
+
+## Asset Structure
+
+Each asset is identified by a unique ID and stores:
+
+- Asset administrators
+- Total supply and holder count
+- Minimum balance configuration
+- Sufficiency–whether the asset can keep an account alive without DOT
+- Metadata (name, symbol, decimals)
+
+If a balance falls below the configured minimum, called the [existential deposit](/reference/glossary/#existential-deposit){target=\_blank}, it may be removed as “dust.” This ensures efficient storage while giving developers control over asset economics.
+
+## How Native Assets Work
+
+Native assets on Polkadot Hub are created and managed via the Assets pallet from the Polkadot SDK. This pallet defines the runtime logic for issuing, configuring, and administering fungible assets with customizable permissions.
+
+It supports both permissioned and permissionless asset creation, enabling everything from simple user-issued tokens to governed assets controlled by teams or DAOs.
+
+For implementation details, see the [Assets Pallet Rust docs](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/index.html){target=\_blank}.
+
+### Asset Operations
+
+The Assets pallet provides both state-changing operations and read-only queries for full lifecycle management of assets.
+
+Core operations include:
+
+- **Asset issuance**: Create new assets and assign initial supply.
+- **Transfers**: Move assets between accounts with balance tracking.
+- **Burning**: Reduce total supply by destroying tokens.
+- **Delegated transfers**: Approve transfers on behalf of another account without giving up custody.
+- **Freezing and thawing**: Temporarily lock and unlock an account's balance.
+
+For a complete list of extrinsics, see the [`pallet-assets` dispatchable functions reference](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/enum.Call.html){target=\_blank}.
+
+Data queries make it possible to:
+
+- Check account balances and total supply.
+- Retrieve asset metadata and configuration details.
+- Inspect account and asset status on-chain.
+
+For a full list of queries, see the [Pallet reference](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/struct.Pallet.html){target=\_blank}.
+
+### Roles and Permissions
+
+The Assets pallet uses role-based permissions to control who can manage different parts of an asset’s lifecycle:
+
+- **Owner**: Overarching control, including destroying an asset class; can set or update Issuer, Freezer, and Admin roles.
+- **Admin**: Can freeze assets and forcibly transfer balances between accounts. Admins can also reduce the balance of an asset class across arbitrary accounts.
+- **Issuer**: Responsible for minting new tokens. When new assets are created, the Issuer is the account that controls their distribution to other accounts.
+- **Freezer**: Can lock the transfer of assets from an account, preventing the account holder from moving their balance.
+
+These roles allow projects to enforce governance and security policies around their assets.
+
+### Freezing Assets
+
+Assets can be temporarily locked to prevent transfers from specific accounts. This is useful for dispute resolution, fraud prevention, or compliance controls.
+
+**How it works**:
+
+- Only authorized parties can freeze or unfreeze (thaw) assets.
+- Freezing pauses the movement of the asset without burning or removing it.
+- Once thawed, the asset can be transferred normally.
+
+Freezing provides a safe way to control asset flow while maintaining full ownership.
+
+**Key functions**: `freeze` and `thaw`.
+
+### Delegated Transfers
+
+Polkadot Hub supports delegated asset transfers, allowing one account to authorize another to move a limited amount of its assets—without giving up full control. This is useful for escrow logic, automated payments, and multi-party applications.
+
+**How it works**:
+
+- An account can grant permission to another account to transfer a specific amount of its assets.
+- Permissions can be revoked at any time, preventing further transfers.
+- Authorized accounts can execute transfers on behalf of the original owner within the approved limits.
+
+Delegated transfers simplify multi-step transactions and enable complex asset flows.
+
+**Key functions**: `approve_transfer`, `cancel_approval`, and `transfer_approved`.
+
+## How Foreign Assets Work
+
+Foreign assets are assets originating from other chains and are managed on Polkadot Hub via an instance of the Assets pallet that is configured specifically for foreign assets. It enables transfers, balance checks, and other standard asset operations, while handling foreign-asset specifics such as:
+
+- **Asset identifiers**: Foreign assets use an XCM multilocation as their identifier, rather than a numeric AssetId. This ensures assets from different chains can be referenced and moved safely across parachains.
+
+- **Transfers**: Once registered on Polkadot Hub, foreign assets can be transferred between accounts just like native assets. If supported, they can also be returned to their original blockchain using cross-chain messaging.
+
+This unified interface makes it easy for dApps to handle both native and cross-chain assets.
+
+## Moving Assets Across Chains
+
+Polkadot Hub enables assets to move safely between parachains and the relay chain using XCM (Cross-Consensus Messaging). XCM ensures assets can move securely between chains while preserving ownership and traceability
+
+To learn more about asset transfers with XCM, please refer to the [Introduction to XCM](/parachains/interoperability/get-started/) page.
diff --git a/reference/polkadot-hub/smart-contracts.md b/reference/polkadot-hub/smart-contracts.md
new file mode 100644
index 000000000..ef77ba020
--- /dev/null
+++ b/reference/polkadot-hub/smart-contracts.md
@@ -0,0 +1,40 @@
+---
+title: Polkadot Hub Smart Contracts
+description: Learn how Polkadot Hub supports smart contracts through the REVM, a Rust-based Ethereum Virtual Machine compatible runtime.
+categories: Polkadot Protocol
+---
+
+# Smart Contracts on Polkadot Hub
+
+## Introduction
+
+Polkadot Hub enables developers to deploy and interact with Solidity contracts through REVM, a high-performance, Rust-based Ethereum Virtual Machine implementation. This brings Ethereum compatibility to Polkadot Hub, letting teams use familiar Solidity tooling, integrate with on-chain features like governance and XCM, and take advantage of cross-chain interoperability.
+
+For projects that require maximum computational performance, Polkadot Hub also supports PolkaVM (PVM), a native RISC-V execution engine. PVM is optional and designed for high-throughput, performance-intensive smart contracts.
+
+### REVM Smart Contracts
+
+[REVM](https://github.com/bluealloy/revm){target=_blank} brings full EVM compatibility to Polkadot Hub through a fast, memory-safe Rust implementation of the Ethereum Virtual Machine. Unlike PolkaVM, which compiles contracts to RISC-V for native execution, REVM executes standard Ethereum bytecode directly—making it ideal for teams who want to migrate existing Solidity projects to Polkadot with minimal changes.
+
+With REVM, developers can:
+
+- Deploy existing Solidity contracts without rewriting them.
+- Use familiar Ethereum tooling like Hardhat, Foundry, Remix, and MetaMask.
+- Interact with other parachains and on-chain assets using XCM and Polkadot Hub features.
+
+REVM builds on Rust’s safety guarantees and performance optimizations while retaining full opcode compatibility with the EVM. This provides a reliable path for Ethereum-native developers to access Polkadot’s native features—such as governance, treasury, multisig, and XCM—within a unified, interoperable runtime environment.
+
+### PVM Smart Contracts
+
+PVM is Polkadot Hub’s native, high-performance smart contract engine. Instead of emulating EVM bytecode, it runs contracts compiled to a [RISC-V](https://en.wikipedia.org/wiki/RISC-V){target=_blank} instruction set, unlocking higher performance and parallel execution while staying friendly to Ethereum-style development.
+
+With PVM, developers can:
+
+- Write Solidity contracts and use familiar tooling (e.g., Hardhat, Foundry) targeting PVM
+- Benefit from fast, predictable execution with carefully metered gas/weight.
+- Access detailed observability through Substrate events and contract logs for indexing and debugging.
+
+PolkaVM delivers maximum performance for computationally intensive contracts, offering a native, high-throughput option for Ethereum-style developers on Polkadot Hub.
+
+--8<-- 'text/smart-contracts/polkaVM-warning.md'
+