Skip to content

Commit 0b4eba9

Browse files
kapetan3sidCopilotnhussein11eshabenbrunopgalvao
authored
Refactor and improve Technical Reference > Parachain > Consensus > Assets & Smart Contracts (#1129)
* add assets page * add smart contract page * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Apply suggestion from @Copilot Co-authored-by: Copilot <[email protected]> * Update .nav.yml Co-authored-by: Nicolás Hussein <[email protected]> * Update reference/polkadot-hub/smart-contracts.md Co-authored-by: Nicolás Hussein <[email protected]> * merge pages and apply feedback * Apply suggestion from @nhussein11 Co-authored-by: Nicolás Hussein <[email protected]> * Apply suggestion from @nhussein11 Co-authored-by: Nicolás Hussein <[email protected]> * Apply suggestion from @nhussein11 Co-authored-by: Nicolás Hussein <[email protected]> * Apply suggestion from @nhussein11 Co-authored-by: Nicolás Hussein <[email protected]> * Apply suggestion from @nhussein11 Co-authored-by: Nicolás Hussein <[email protected]> * minor edits * split content in two pages * add llms stuff * Update reference/polkadot-hub/assets.md Co-authored-by: Nicolás Hussein <[email protected]> * clean up pages * fix target blank * Update reference/polkadot-hub/smart-contracts.md Co-authored-by: Bruno Galvao <[email protected]> * Update reference/polkadot-hub/smart-contracts.md Co-authored-by: Bruno Galvao <[email protected]> * Update reference/polkadot-hub/smart-contracts.md Co-authored-by: Bruno Galvao <[email protected]> * Update reference/polkadot-hub/smart-contracts.md Co-authored-by: Bruno Galvao <[email protected]> * Update reference/polkadot-hub/smart-contracts.md Co-authored-by: Bruno Galvao <[email protected]> * Update reference/polkadot-hub/smart-contracts.md Co-authored-by: Bruno Galvao <[email protected]> * Update reference/polkadot-hub/smart-contracts.md Co-authored-by: Bruno Galvao <[email protected]> * apply bruno's feedback, remove repetitive text, and update intro based on current content * move warning to bottom of page * apply bruno's feedback * llms * apply feedback and make some minor edits * llms --------- Co-authored-by: Copilot <[email protected]> Co-authored-by: Nicolás Hussein <[email protected]> Co-authored-by: Erin Shaben <[email protected]> Co-authored-by: Bruno Galvao <[email protected]>
1 parent 97429d7 commit 0b4eba9

13 files changed

+725
-785
lines changed

.ai/categories/polkadot-protocol.md

Lines changed: 203 additions & 228 deletions
Large diffs are not rendered by default.

.ai/pages/reference-polkadot-hub-assets-and-smart-contracts.md

Lines changed: 0 additions & 225 deletions
This file was deleted.
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
---
2+
title: Polkadot Hub Assets
3+
description: Learn about asset management on Polkadot Hub, including on-chain assets, foreign asset integration, and XCM for cross-chain asset transfers.
4+
categories: Polkadot Protocol
5+
url: https://docs.polkadot.com/reference/polkadot-hub/assets/
6+
---
7+
8+
# Assets on Polkadot Hub
9+
10+
## Introduction
11+
12+
Polkadot Hub is Polkadot’s system parachain that provides core functionality for the network, including 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.
13+
14+
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.
15+
16+
This guide explains how assets are created, managed, and moved across chains, including key operations, roles, and the differences between native and foreign assets.
17+
18+
## Why Use Polkadot Hub?
19+
20+
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).
21+
22+
**Key features**:
23+
24+
- **Built-in asset operations**: Mint, burn, and transfer like ERC-20 on Ethereum, but native to Polkadot's runtime.
25+
- **Custom asset creation**: Issue tokens or NFTs with configurable permissions and metadata.
26+
- **Low fees**: Transactions cost roughly one-tenth of relay chain fees.
27+
- **Lower deposits**: Minimal on-chain storage costs for asset data.
28+
- **Pay fees in any asset**: Users don’t need DOT to transact; supported assets can cover fees.
29+
- **Cross-chain ready**: Assets can be transferred to other parachains using XCM.
30+
31+
## Types of Assets
32+
33+
Polkadot Hub supports two types of assets:
34+
35+
- **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
36+
- **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.
37+
38+
## Asset Structure
39+
40+
Each asset is identified by a unique ID and stores:
41+
42+
- Asset administrators
43+
- Total supply and holder count
44+
- Minimum balance configuration
45+
- Sufficiency–whether the asset can keep an account alive without DOT
46+
- Metadata (name, symbol, decimals)
47+
48+
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.
49+
50+
## How Native Assets Work
51+
52+
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.
53+
54+
It supports both permissioned and permissionless asset creation, enabling everything from simple user-issued tokens to governed assets controlled by teams or DAOs.
55+
56+
For implementation details, see the [Assets Pallet Rust docs](https://paritytech.github.io/polkadot-sdk/master/pallet_assets/index.html){target=\_blank}.
57+
58+
### Asset Operations
59+
60+
The Assets pallet provides both state-changing operations and read-only queries for full lifecycle management of assets.
61+
62+
Core operations include:
63+
64+
- **Asset issuance**: Create new assets and assign initial supply.
65+
- **Transfers**: Move assets between accounts with balance tracking.
66+
- **Burning**: Reduce total supply by destroying tokens.
67+
- **Delegated transfers**: Approve transfers on behalf of another account without giving up custody.
68+
- **Freezing and thawing**: Temporarily lock and unlock an account's balance.
69+
70+
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}.
71+
72+
Data queries make it possible to:
73+
74+
- Check account balances and total supply.
75+
- Retrieve asset metadata and configuration details.
76+
- Inspect account and asset status on-chain.
77+
78+
For a full list of queries, see the [Pallet reference](https://docs.rs/pallet-assets/latest/pallet_assets/pallet/struct.Pallet.html){target=\_blank}.
79+
80+
### Roles and Permissions
81+
82+
The Assets pallet uses role-based permissions to control who can manage different parts of an asset’s lifecycle:
83+
84+
- **Owner**: Overarching control, including destroying an asset class; can set or update Issuer, Freezer, and Admin roles.
85+
- **Admin**: Can freeze assets and forcibly transfer balances between accounts. Admins can also reduce the balance of an asset class across arbitrary accounts.
86+
- **Issuer**: Responsible for minting new tokens. When new assets are created, the Issuer is the account that controls their distribution to other accounts.
87+
- **Freezer**: Can lock the transfer of assets from an account, preventing the account holder from moving their balance.
88+
89+
These roles allow projects to enforce governance and security policies around their assets.
90+
91+
### Freezing Assets
92+
93+
Assets can be temporarily locked to prevent transfers from specific accounts. This is useful for dispute resolution, fraud prevention, or compliance controls.
94+
95+
**How it works**:
96+
97+
- Only authorized parties can freeze or unfreeze (thaw) assets.
98+
- Freezing pauses the movement of the asset without burning or removing it.
99+
- Once thawed, the asset can be transferred normally.
100+
101+
Freezing provides a safe way to control asset flow while maintaining full ownership.
102+
103+
**Key functions**: `freeze` and `thaw`.
104+
105+
### Delegated Transfers
106+
107+
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.
108+
109+
**How it works**:
110+
111+
- An account can grant permission to another account to transfer a specific amount of its assets.
112+
- Permissions can be revoked at any time, preventing further transfers.
113+
- Authorized accounts can execute transfers on behalf of the original owner within the approved limits.
114+
115+
Delegated transfers simplify multi-step transactions and enable complex asset flows.
116+
117+
**Key functions**: `approve_transfer`, `cancel_approval`, and `transfer_approved`.
118+
119+
## How Foreign Assets Work
120+
121+
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:
122+
123+
- **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.
124+
125+
- **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.
126+
127+
This unified interface makes it easy for dApps to handle both native and cross-chain assets.
128+
129+
## Moving Assets Across Chains
130+
131+
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
132+
133+
To learn more about asset transfers with XCM, please refer to the [Introduction to XCM](/parachains/interoperability/get-started/) page.
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
---
2+
title: Polkadot Hub Smart Contracts
3+
description: Learn how Polkadot Hub supports smart contracts through the REVM, a Rust-based Ethereum Virtual Machine compatible runtime.
4+
categories: Polkadot Protocol
5+
url: https://docs.polkadot.com/reference/polkadot-hub/smart-contracts/
6+
---
7+
8+
# Smart Contracts on Polkadot Hub
9+
10+
## Introduction
11+
12+
Polkadot Hub enables developers to deploy and interact with Solidity contracts through REVM, a high-performance, Rust-based Ethereum Virtual Machine implementation. Polkadot-native precompiles bring 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.
13+
14+
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.
15+
16+
### REVM Smart Contracts
17+
18+
[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.
19+
20+
With REVM, developers can:
21+
22+
- Deploy existing Solidity contracts without rewriting them.
23+
- Use familiar Ethereum tooling like Hardhat, Foundry, Remix, and MetaMask.
24+
- Interact with other parachains and on-chain assets using XCM and Polkadot Hub features.
25+
26+
REVM builds on Rust’s safety guarantees and performance optimizations while retaining full opcode compatibility with the EVM.
27+
28+
Ethereum-native developers can use Polkadot-native precompiles to access Polkadot features—such as governance, treasury, multisig, and XCM—within a unified, interoperable runtime environment.
29+
30+
### PVM Smart Contracts
31+
32+
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.
33+
34+
With PVM, developers can:
35+
36+
- Write Solidity contracts and use familiar tooling (e.g., Hardhat, Foundry) targeting PVM
37+
- Benefit from fast, predictable execution with carefully metered gas/weight.
38+
- Access detailed observability through Substrate events and contract logs for indexing and debugging.
39+
40+
PolkaVM delivers maximum performance for computationally intensive contracts, offering a native, high-throughput option for Ethereum-style developers on Polkadot Hub.
41+
42+
!!! smartcontract "PolkaVM Preview Release"
43+
PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**.
44+
## Where to Go Next
45+
46+
<div class="grid cards" markdown>
47+
48+
- <span class="badge guide">Guide</span> __Deploy a Basic Contract__
49+
50+
---
51+
52+
Learn step-by-step how to deploy a basic Solidity smart contract to Polkadot Hub.
53+
54+
[:octicons-arrow-right-24: Get Started](/smart-contracts/cookbook/smart-contracts/deploy-basic/basic-remix/)
55+
56+
- <span class="badge guide">Guide</span> __Explore Development Environments__
57+
58+
---
59+
60+
Check out the development environments you can use to build, test, and deploy smart contracts.
61+
62+
[:octicons-arrow-right-24: Get Started](/smart-contracts/dev-environments/local-dev-node/)
63+
64+
</div>

0 commit comments

Comments
 (0)