diff --git a/.ai/categories/polkadot-protocol.md b/.ai/categories/polkadot-protocol.md
index b8ac4e161..fce9245ea 100644
--- a/.ai/categories/polkadot-protocol.md
+++ b/.ai/categories/polkadot-protocol.md
@@ -757,6 +757,179 @@ For detailed error management in XCM, see Gavin Wood's blog post on [XCM Executi
+---
+
+Page Title: Asynchronous Backing
+
+- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-async-backing.md
+- Canonical (HTML): https://docs.polkadot.com/reference/parachains/consensus/async-backing/
+- Summary: Understand how asynchronous backing pipelines parachain block production, the protocol changes it introduces on the Relay Chain, and how parachains participate safely and efficiently.
+
+Asynchronous backing (often shortened to ***Async Backing***) is a parachain [configuration](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L43) set by on-chain governance. It allows collators and validators to build *some* number of blocks ahead of the relay chain during the **generation** and **backing** stages of the [Inclusion Pipeline](/reference/parachains/consensus/inclusion-pipeline).
+
+Async Backing improves throughput of the overall Polkadot Network by using coretime more efficiently, and enables the parallel processing needed for parachains to further scale throughput via [Elastic Scaling](/reference/parachains/consensus/elastic-scaling).
+
+## Configurations
+The following configurations can be set by on-chain governance, dictating how many blocks ahead of the relay chain a given parachain's collators can run:
+
+* [`max_candidate_depth`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L49): the number of parablocks a collator can produce that are not yet included in the relay chain. A value of `2` means that there can be a maximum of 3 unincluded parablocks at any given time.
+* [`allowed_ancestry_len`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L54): the oldest relay parent a parablock can be built on top of. A value of `1` means collators can start building blocks 6 seconds in advance.
+
+## Synchronous VS. Asynchronous Processing
+
+
+
+The Polkadot-parachain protocol originally operated in synchronous mode, where both collators and validators drew context exclusively from the relay parent of the prior parablock, which lives on the relay chain. This made the Backing and Generation steps tightly coupled to the prior parablock completing the entire inclusion pipeline. As a result, one parablock could only be processed every other relay block, with just 0.5 seconds assigned for execution.
+
+```mermaid
+---
+ displayMode: compact
+ config:
+ themeCSS: "
+ #item1 { fill: #450693; stroke: #450693; } \n
+ #item2 { fill: #8C00FF; stroke: #8C00FF; } \n
+ #item3 { fill: #FFC400; stroke: #FFC400; } \n
+ #r { fill: #eb4172; stroke:none; font-size: 20px; } \n
+ svg text { font-size: 20px !important; } \n
+ svg .sectionTitle { font-size: 20px !important; } \n #p1padTop { display: none; } \n
+
+ /* Hide ALL task labels by default */
+ text.taskText,
+ text.taskTextOutside,
+ [class*='taskText'] tspan { display: none !important; } \n
+
+ /* Show labels for the 'r' group (inside or outside, incl. tspans) */
+ text.taskText[id^='r'],
+ text.taskTextOutside[id^='r'],
+ text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \n
+
+ /* Keep section titles styled */
+ .sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \n
+
+ /* Hide the first two section titles (F1, F2). Change indexes if needed. */
+ .sectionTitle:nth-of-type(1),
+ .sectionTitle:nth-of-type(2) { display: none !important; } \n
+
+ /* Also hide SPACING row labels on the left */
+ text.taskTextOutside[id^='p1padTop'] { display: none !important; } \n
+ "
+ themeVariables:
+ sectionBkgColor: '#fff'
+ gantt:
+ numberSectionStyles: 1
+ barHeight: 70
+ gridLineStartPadding: 100
+---
+%%{init: {"gantt": {"barHeight": 70 }}}%%
+gantt
+ dateFormat YYYY
+ axisFormat %y
+ tickInterval '10year'
+
+ section F1
+ R1 : r, 1905, 1907
+ R2 : r, 1911, 1913
+ R3 : r, 1917, 1919
+ R4 : r, 1923, 1925
+
+ section F2
+ SPACING : p1padTop, 1901, 1924
+
+ section P1
+ X : item1, 1900, 1901
+ Backing : item2, 1901, 1906
+ Inclusion : item3, 1906, 1912
+
+ section P2
+ X : item1, 1912, 1913
+ Backing : item2, 1913, 1918
+ Inclusion : item3, 1918, 1924
+
+
+```
+
+
+
+The modern protocol now uses asynchronous backing, where both collators and validators have access to [Unincluded Segments](/reference/parachains/consensus/inclusion-pipeline) as an additional context source. The Backing and Generation steps are no longer coupled to the prior block completing the full inclusion pipeline. Instead, the prior parablock only needs to complete the generation step and be added to the Unincluded Segments before the next parablock can begin the Backing and Generation steps.
+
+This results in one parablock being processed every relay block (instead of every other relay block), and allows for more time to execute during the Generation step (0.5s → 2s).
+
+```mermaid
+---
+ displayMode: compact
+ config:
+ themeCSS: "
+ #item1 { fill: #450693; stroke: #450693; } \n
+ #item2 { fill: #8C00FF; stroke: #8C00FF; } \n
+ #item3 { fill: #FFC400; stroke: #FFC400; } \n
+ #r { fill: #eb4172; stroke:none; font-size: 20px; } \n
+ svg text { font-size: 20px !important; } \n
+ svg .sectionTitle { font-size: 20px !important; } \n #p1padTop { display: none; } \n
+
+ /* Hide ALL task labels by default */
+ text.taskText,
+ text.taskTextOutside,
+ [class*='taskText'] tspan { display: none !important; } \n
+
+ /* Show labels for the 'r' group (inside or outside, incl. tspans) */
+ text.taskText[id^='r'],
+ text.taskTextOutside[id^='r'],
+ text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \n
+
+ /* Keep section titles styled */
+ .sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \n
+
+ /* Hide the first two section titles (F1, F2). Change indexes if needed. */
+ .sectionTitle:nth-of-type(1),
+ .sectionTitle:nth-of-type(2) { display: none !important; } \n
+
+ /* Also hide SPACING row labels on the left */
+ text.taskTextOutside[id^='p1padTop'] { display: none !important; } \n
+ "
+ themeVariables:
+ sectionBkgColor: '#fff'
+ gantt:
+ numberSectionStyles: 1
+ barHeight: 70
+ gridLineStartPadding: 100
+---
+%%{init: {"gantt": {"barHeight": 70 }}}%%
+gantt
+ dateFormat YYYY
+ axisFormat %y
+ tickInterval '10year'
+
+ section F1
+ R1 : r, 1905, 1907
+ R2 : r, 1911, 1913
+ R3 : r, 1917, 1919
+ R4 : r, 1923, 1925
+ R5 : r, 1929, 1931
+
+ section F2
+ SPACING : p1padTop, 1901, 1930
+
+ section P1
+ X : item1, 1900, 1902
+ Backing : item2, 1902, 1912
+ Inclusion : item3, 1912, 1918
+
+ section P2
+ X : item1, 1906, 1908
+ Backing : item2, 1908, 1918
+ Inclusion : item3, 1918, 1924
+
+ section P3
+ X : item1, 1912, 1914
+ Backing : item2, 1914, 1924
+ Inclusion : item3, 1924, 1930
+
+ section P4
+ X : item1, 1918, 1920
+ Backing : item2, 1920, 1930
+```
+
+
---
Page Title: Blocks
@@ -5071,6 +5244,59 @@ By defining weights, you can trade-off the number of transactions per second and
Westend is a Parity-maintained, Polkadot SDK-based blockchain that serves as a test network for the [Polkadot](#polkadot) network.
+---
+
+Page Title: Inclusion Pipeline
+
+- Source (raw): https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-inclusion-pipeline.md
+- Canonical (HTML): https://docs.polkadot.com/reference/parachains/consensus/inclusion-pipeline/
+- Summary: Understand each of the core components of the Inclusion Pipeline.
+
+The inclusion pipeline is the multi-stage process through which every parachain block (parablock) is **validated** and **secured** before being finalized in the Polkadot relay chain.
+
+This pipeline ensures that all parablocks meet Polkadot's security guarantees through progressive verification: each parablock passes through multiple validation stages with different validator sets, ensuring that invalid parablocks cannot be finalized even if some validators *or collators* are malicious/compromised.
+
+By configuring [Async Backing](/reference/parachains/consensus/async-backing), a parachin can run this pipeline in parallel for many blocks, allowing for high throughput.
+
+## Pipeline Stages
+
+The inclusion pipeline consists of three main stages:
+
+```mermaid
+%%{init: {"flowchart": {"nodeSpacing": 40, "rankSpacing": 60}}}%%
+flowchart LR
+ %% Keep the pipeline on one row (container is hidden)
+ subgraph Row[" "]
+ direction LR
+ G["Generation"] --> B["Backing"] --> I["Inclusion"]
+ end
+ style Row fill:none,stroke:none
+
+ %% Context: plain text (no box) pointing to both G and B
+ C["Context"]:::nobox
+ C -.-> G
+ C -.-> B
+
+ classDef nobox fill:none,stroke:none,color:inherit;
+```
+**Context**: Context of state is provided as input in order for collators and validators to build a parablock during the generation and backing stages, respectively. This context is provided by two sources:
+
+* **Relay Parent**: The relay chain block which a given parablock is anchored to. Note that the relay parent of a parablock and the relay block including that parablock are always different. This context source lives on the relay chain.
+
+* **Unincluded Segments**: Chains of candidate parablocks that have yet to be included in the relay chain, i.e. they can contain blocks at any stage pre-inclusion. The core functionality that [Async Backing](/reference/parachains/consensus/async-backing) brings is the ability to build on these unincluded segments of block ancestors rather than building only on ancestors included in the relay chain state. This context source lives on the collators.
+
+**Generation**: Collators *execute* their blockchain's core functionality to generate a new block, producing a [proof-of-validity](https://paritytech.github.io/polkadot-sdk/book/types/availability.html?#proof-of-validity) (PoV), which is passed to validators selected for backing. The PoV is composed of:
+
+- A list of state transitions called the **block candidate**
+- The values in the parachain's database that the block modifies
+- The hashes of the unaffected points in the Merkle tree
+
+
+**Backing**: A subset of active validators verify that the parablock follows the state transition rules of the parachain and sign a [validity statement](https://paritytech.github.io/polkadot-sdk/book/types/backing.html?#validity-attestation) about the PoV which can have a positive or negative outcome. With enough positive statements (at least 2/3 of assigned validators), the candidate is considered backable. It is then noted in a fork on the relay chain, at which point it is considered backed, ready for the next stage of the pipeline.
+
+**Inclusion**: Validators gossip [erasure code chunks](https://paritytech.github.io/polkadot-sdk/book/types/availability.html#erasure-chunk) and put the parablock through the final [approval process](https://paritytech.github.io/polkadot-sdk/book/protocol-approval.html) before it is considered *included* in the relay chain.
+
+
---
Page Title: Install Polkadot SDK Dependencies
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-parachains-consensus-async-backing.md b/.ai/pages/reference-parachains-consensus-async-backing.md
index adabf852a..3c0063967 100644
--- a/.ai/pages/reference-parachains-consensus-async-backing.md
+++ b/.ai/pages/reference-parachains-consensus-async-backing.md
@@ -1,5 +1,170 @@
---
+title: Asynchronous Backing
+description: Understand how asynchronous backing pipelines parachain block production, the protocol changes it introduces on the Relay Chain, and how parachains participate safely and efficiently.
+categories: Polkadot Protocol
url: https://docs.polkadot.com/reference/parachains/consensus/async-backing/
---
-TODO
+Asynchronous backing (often shortened to ***Async Backing***) is a parachain [configuration](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L43) set by on-chain governance. It allows collators and validators to build *some* number of blocks ahead of the relay chain during the **generation** and **backing** stages of the [Inclusion Pipeline](/reference/parachains/consensus/inclusion-pipeline).
+
+Async Backing improves throughput of the overall Polkadot Network by using coretime more efficiently, and enables the parallel processing needed for parachains to further scale throughput via [Elastic Scaling](/reference/parachains/consensus/elastic-scaling).
+
+## Configurations
+The following configurations can be set by on-chain governance, dictating how many blocks ahead of the relay chain a given parachain's collators can run:
+
+* [`max_candidate_depth`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L49): the number of parablocks a collator can produce that are not yet included in the relay chain. A value of `2` means that there can be a maximum of 3 unincluded parablocks at any given time.
+* [`allowed_ancestry_len`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L54): the oldest relay parent a parablock can be built on top of. A value of `1` means collators can start building blocks 6 seconds in advance.
+
+## Synchronous VS. Asynchronous Processing
+
+
+
+The Polkadot-parachain protocol originally operated in synchronous mode, where both collators and validators drew context exclusively from the relay parent of the prior parablock, which lives on the relay chain. This made the Backing and Generation steps tightly coupled to the prior parablock completing the entire inclusion pipeline. As a result, one parablock could only be processed every other relay block, with just 0.5 seconds assigned for execution.
+
+```mermaid
+---
+ displayMode: compact
+ config:
+ themeCSS: "
+ #item1 { fill: #450693; stroke: #450693; } \n
+ #item2 { fill: #8C00FF; stroke: #8C00FF; } \n
+ #item3 { fill: #FFC400; stroke: #FFC400; } \n
+ #r { fill: #eb4172; stroke:none; font-size: 20px; } \n
+ svg text { font-size: 20px !important; } \n
+ svg .sectionTitle { font-size: 20px !important; } \n #p1padTop { display: none; } \n
+
+ /* Hide ALL task labels by default */
+ text.taskText,
+ text.taskTextOutside,
+ [class*='taskText'] tspan { display: none !important; } \n
+
+ /* Show labels for the 'r' group (inside or outside, incl. tspans) */
+ text.taskText[id^='r'],
+ text.taskTextOutside[id^='r'],
+ text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \n
+
+ /* Keep section titles styled */
+ .sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \n
+
+ /* Hide the first two section titles (F1, F2). Change indexes if needed. */
+ .sectionTitle:nth-of-type(1),
+ .sectionTitle:nth-of-type(2) { display: none !important; } \n
+
+ /* Also hide SPACING row labels on the left */
+ text.taskTextOutside[id^='p1padTop'] { display: none !important; } \n
+ "
+ themeVariables:
+ sectionBkgColor: '#fff'
+ gantt:
+ numberSectionStyles: 1
+ barHeight: 70
+ gridLineStartPadding: 100
+---
+%%{init: {"gantt": {"barHeight": 70 }}}%%
+gantt
+ dateFormat YYYY
+ axisFormat %y
+ tickInterval '10year'
+
+ section F1
+ R1 : r, 1905, 1907
+ R2 : r, 1911, 1913
+ R3 : r, 1917, 1919
+ R4 : r, 1923, 1925
+
+ section F2
+ SPACING : p1padTop, 1901, 1924
+
+ section P1
+ X : item1, 1900, 1901
+ Backing : item2, 1901, 1906
+ Inclusion : item3, 1906, 1912
+
+ section P2
+ X : item1, 1912, 1913
+ Backing : item2, 1913, 1918
+ Inclusion : item3, 1918, 1924
+
+
+```
+
+
+
+The modern protocol now uses asynchronous backing, where both collators and validators have access to [Unincluded Segments](/reference/parachains/consensus/inclusion-pipeline) as an additional context source. The Backing and Generation steps are no longer coupled to the prior block completing the full inclusion pipeline. Instead, the prior parablock only needs to complete the generation step and be added to the Unincluded Segments before the next parablock can begin the Backing and Generation steps.
+
+This results in one parablock being processed every relay block (instead of every other relay block), and allows for more time to execute during the Generation step (0.5s → 2s).
+
+```mermaid
+---
+ displayMode: compact
+ config:
+ themeCSS: "
+ #item1 { fill: #450693; stroke: #450693; } \n
+ #item2 { fill: #8C00FF; stroke: #8C00FF; } \n
+ #item3 { fill: #FFC400; stroke: #FFC400; } \n
+ #r { fill: #eb4172; stroke:none; font-size: 20px; } \n
+ svg text { font-size: 20px !important; } \n
+ svg .sectionTitle { font-size: 20px !important; } \n #p1padTop { display: none; } \n
+
+ /* Hide ALL task labels by default */
+ text.taskText,
+ text.taskTextOutside,
+ [class*='taskText'] tspan { display: none !important; } \n
+
+ /* Show labels for the 'r' group (inside or outside, incl. tspans) */
+ text.taskText[id^='r'],
+ text.taskTextOutside[id^='r'],
+ text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \n
+
+ /* Keep section titles styled */
+ .sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \n
+
+ /* Hide the first two section titles (F1, F2). Change indexes if needed. */
+ .sectionTitle:nth-of-type(1),
+ .sectionTitle:nth-of-type(2) { display: none !important; } \n
+
+ /* Also hide SPACING row labels on the left */
+ text.taskTextOutside[id^='p1padTop'] { display: none !important; } \n
+ "
+ themeVariables:
+ sectionBkgColor: '#fff'
+ gantt:
+ numberSectionStyles: 1
+ barHeight: 70
+ gridLineStartPadding: 100
+---
+%%{init: {"gantt": {"barHeight": 70 }}}%%
+gantt
+ dateFormat YYYY
+ axisFormat %y
+ tickInterval '10year'
+
+ section F1
+ R1 : r, 1905, 1907
+ R2 : r, 1911, 1913
+ R3 : r, 1917, 1919
+ R4 : r, 1923, 1925
+ R5 : r, 1929, 1931
+
+ section F2
+ SPACING : p1padTop, 1901, 1930
+
+ section P1
+ X : item1, 1900, 1902
+ Backing : item2, 1902, 1912
+ Inclusion : item3, 1912, 1918
+
+ section P2
+ X : item1, 1906, 1908
+ Backing : item2, 1908, 1918
+ Inclusion : item3, 1918, 1924
+
+ section P3
+ X : item1, 1912, 1914
+ Backing : item2, 1914, 1924
+ Inclusion : item3, 1924, 1930
+
+ section P4
+ X : item1, 1918, 1920
+ Backing : item2, 1920, 1930
+```
diff --git a/.ai/pages/reference-parachains-consensus-inclusion-pipeline.md b/.ai/pages/reference-parachains-consensus-inclusion-pipeline.md
new file mode 100644
index 000000000..ca464b33c
--- /dev/null
+++ b/.ai/pages/reference-parachains-consensus-inclusion-pipeline.md
@@ -0,0 +1,50 @@
+---
+title: Inclusion Pipeline
+description: Understand each of the core components of the Inclusion Pipeline.
+categories: Polkadot Protocol
+url: https://docs.polkadot.com/reference/parachains/consensus/inclusion-pipeline/
+---
+
+The inclusion pipeline is the multi-stage process through which every parachain block (parablock) is **validated** and **secured** before being finalized in the Polkadot relay chain.
+
+This pipeline ensures that all parablocks meet Polkadot's security guarantees through progressive verification: each parablock passes through multiple validation stages with different validator sets, ensuring that invalid parablocks cannot be finalized even if some validators *or collators* are malicious/compromised.
+
+By configuring [Async Backing](/reference/parachains/consensus/async-backing), a parachin can run this pipeline in parallel for many blocks, allowing for high throughput.
+
+## Pipeline Stages
+
+The inclusion pipeline consists of three main stages:
+
+```mermaid
+%%{init: {"flowchart": {"nodeSpacing": 40, "rankSpacing": 60}}}%%
+flowchart LR
+ %% Keep the pipeline on one row (container is hidden)
+ subgraph Row[" "]
+ direction LR
+ G["Generation"] --> B["Backing"] --> I["Inclusion"]
+ end
+ style Row fill:none,stroke:none
+
+ %% Context: plain text (no box) pointing to both G and B
+ C["Context"]:::nobox
+ C -.-> G
+ C -.-> B
+
+ classDef nobox fill:none,stroke:none,color:inherit;
+```
+**Context**: Context of state is provided as input in order for collators and validators to build a parablock during the generation and backing stages, respectively. This context is provided by two sources:
+
+* **Relay Parent**: The relay chain block which a given parablock is anchored to. Note that the relay parent of a parablock and the relay block including that parablock are always different. This context source lives on the relay chain.
+
+* **Unincluded Segments**: Chains of candidate parablocks that have yet to be included in the relay chain, i.e. they can contain blocks at any stage pre-inclusion. The core functionality that [Async Backing](/reference/parachains/consensus/async-backing) brings is the ability to build on these unincluded segments of block ancestors rather than building only on ancestors included in the relay chain state. This context source lives on the collators.
+
+**Generation**: Collators *execute* their blockchain's core functionality to generate a new block, producing a [proof-of-validity](https://paritytech.github.io/polkadot-sdk/book/types/availability.html?#proof-of-validity) (PoV), which is passed to validators selected for backing. The PoV is composed of:
+
+- A list of state transitions called the **block candidate**
+- The values in the parachain's database that the block modifies
+- The hashes of the unaffected points in the Merkle tree
+
+
+**Backing**: A subset of active validators verify that the parablock follows the state transition rules of the parachain and sign a [validity statement](https://paritytech.github.io/polkadot-sdk/book/types/backing.html?#validity-attestation) about the PoV which can have a positive or negative outcome. With enough positive statements (at least 2/3 of assigned validators), the candidate is considered backable. It is then noted in a fork on the relay chain, at which point it is considered backed, ready for the next stage of the pipeline.
+
+**Inclusion**: Validators gossip [erasure code chunks](https://paritytech.github.io/polkadot-sdk/book/types/availability.html#erasure-chunk) and put the parablock through the final [approval process](https://paritytech.github.io/polkadot-sdk/book/protocol-approval.html) before it is considered *included* in the relay chain.
diff --git a/.ai/pages/reference-parachains-consensus-old-notes.md b/.ai/pages/reference-parachains-consensus-old-notes.md
new file mode 100644
index 000000000..b9847f902
--- /dev/null
+++ b/.ai/pages/reference-parachains-consensus-old-notes.md
@@ -0,0 +1,12 @@
+---
+url: https://docs.polkadot.com/reference/parachains/consensus/old-notes/
+---
+
+### Compute Advantage
+Below is a table showing the main advantages of asynchronous over synchronous backing.
+
+| | Sync Backing | Async Backing | Async Backing Advantage |
+| ------------------------------------ | ------------ | ------------ | ----------------------------------------- |
+| **Parablocks included every** | 12 seconds | 6 seconds | **2x** more parablocks included |
+| **Parablock maximum execution time** | 0.5 seconds | 2 seconds | **4x** more execution time in a parablock |
+| **Total Computer Gain (per core)** | | | **8x Compute Throughput** |
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..31529b9a4 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,3278 +2329,761 @@
"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**.
",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-erc20-erc20-remix.md",
+ "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/smart-contracts/deploy-erc20/erc20-remix/",
+ "preview": "[ERC-20](https://eips.ethereum.org/EIPS/eip-20){target=\\_blank} tokens are fungible tokens commonly used for creating cryptocurrencies, governance tokens, and staking mechanisms. Polkadot Hub enables easy token deployment with Ethereum-compatible smart contracts and tools via the EVM backend.",
"outline": [
{
"depth": 2,
- "title": "Networks Details",
- "anchor": "networks-details"
+ "title": "Introduction",
+ "anchor": "introduction"
},
{
"depth": 2,
- "title": "Test Tokens",
- "anchor": "test-tokens"
+ "title": "Prerequisites",
+ "anchor": "prerequisites"
+ },
+ {
+ "depth": 2,
+ "title": "Create Your Contract",
+ "anchor": "create-your-contract"
+ },
+ {
+ "depth": 2,
+ "title": "Compile",
+ "anchor": "compile"
+ },
+ {
+ "depth": 2,
+ "title": "Deploy",
+ "anchor": "deploy"
+ },
+ {
+ "depth": 2,
+ "title": "Interact with Your Contract",
+ "anchor": "interact-with-your-contract"
},
{
"depth": 2,
@@ -13165,131 +10989,108 @@
}
],
"stats": {
- "chars": 3459,
- "words": 476,
- "headings": 3,
- "estimated_token_count_total": 558
+ "chars": 9109,
+ "words": 1260,
+ "headings": 7,
+ "estimated_token_count_total": 2182
},
- "hash": "sha256:a2490223926957381913ae0ed22e2df3611a6713ec9d77a3015d1cd6a578b3f6",
- "last_modified": "2025-10-28T14:42:15+00:00",
+ "hash": "sha256:0cb418d465a51230ece5d3a56d64754f979bc6c4ad78f2cc3df537b99739e627",
"token_estimator": "heuristic-v1"
},
{
- "id": "smart-contracts-cookbook-dapps-zero-to-hero",
- "title": "Zero to Hero Smart Contract DApp",
- "slug": "smart-contracts-cookbook-dapps-zero-to-hero",
+ "id": "smart-contracts-cookbook-smart-contracts-deploy-erc20",
+ "title": "Deploy an ERC-20 to Polkadot Hub",
+ "slug": "smart-contracts-cookbook-smart-contracts-deploy-erc20",
"categories": [
- "dApp",
- "Tooling"
+ "Basics",
+ "dApps",
+ "Smart Contracts"
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-dapps-zero-to-hero.md",
- "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/dapps/zero-to-hero/",
- "preview": "Decentralized applications (dApps) are a key component of the Web3 ecosystem, enabling developers to build applications that communicate directly with blockchain networks. Polkadot Hub, a blockchain with smart contract support, serves as a robust platform for deploying and interacting with dApps.",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-erc20.md",
+ "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/smart-contracts/deploy-erc20/",
+ "preview": "!!! smartcontract \"PolkaVM Preview Release\" PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**. ## Introduction",
"outline": [
{
"depth": 2,
- "title": "Prerequisites",
- "anchor": "prerequisites"
+ "title": "Introduction",
+ "anchor": "introduction"
},
{
"depth": 2,
- "title": "Project Overview",
- "anchor": "project-overview"
+ "title": "Prerequisites",
+ "anchor": "prerequisites"
},
{
"depth": 2,
- "title": "Create and Deploy the Storage Contract",
- "anchor": "create-and-deploy-the-storage-contract"
- },
- {
- "depth": 3,
- "title": "Set Up Hardhat Project",
- "anchor": "set-up-hardhat-project"
- },
- {
- "depth": 3,
- "title": "Create the Storage Contract",
- "anchor": "create-the-storage-contract"
- },
- {
- "depth": 3,
- "title": "Configure Hardhat for Polkadot Hub",
- "anchor": "configure-hardhat-for-polkadot-hub"
+ "title": "Create the ERC-20 Contract",
+ "anchor": "create-the-erc-20-contract"
},
{
- "depth": 3,
+ "depth": 2,
"title": "Compile the Contract",
"anchor": "compile-the-contract"
},
{
- "depth": 3,
+ "depth": 2,
"title": "Deploy the Contract",
"anchor": "deploy-the-contract"
},
- {
- "depth": 3,
- "title": "Export the Contract ABI",
- "anchor": "export-the-contract-abi"
- },
- {
- "depth": 2,
- "title": "Set Up the dApp Project",
- "anchor": "set-up-the-dapp-project"
- },
- {
- "depth": 2,
- "title": "Install Dependencies",
- "anchor": "install-dependencies"
- },
{
"depth": 2,
- "title": "Connect to Polkadot Hub",
- "anchor": "connect-to-polkadot-hub"
- },
+ "title": "Interact with Your ERC-20 Contract",
+ "anchor": "interact-with-your-erc-20-contract"
+ }
+ ],
+ "stats": {
+ "chars": 8926,
+ "words": 1207,
+ "headings": 6,
+ "estimated_token_count_total": 2107
+ },
+ "hash": "sha256:296cba75b1d49aefa1b8636ba95ca20c3431b7eb0e93b0658add671ef5801732",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "smart-contracts-cookbook-smart-contracts-deploy-nft-ethers",
+ "title": "Deploy an NFT to Polkadot Hub with Ethers.js",
+ "slug": "smart-contracts-cookbook-smart-contracts-deploy-nft-ethers",
+ "categories": [
+ "Basics",
+ "Smart Contracts"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-nft-ethers.md",
+ "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/smart-contracts/deploy-nft/ethers/",
+ "preview": "Non-Fungible Tokens (NFTs) represent unique digital assets commonly used for digital art, collectibles, gaming, and identity verification.",
+ "outline": [
{
"depth": 2,
- "title": "Set Up the Smart Contract Interface",
- "anchor": "set-up-the-smart-contract-interface"
+ "title": "Introduction",
+ "anchor": "introduction"
},
{
"depth": 2,
- "title": "Create the Wallet Connection Component",
- "anchor": "create-the-wallet-connection-component"
+ "title": "Prerequisites",
+ "anchor": "prerequisites"
},
{
"depth": 2,
- "title": "Create the Read Contract Component",
- "anchor": "create-the-read-contract-component"
+ "title": "Set Up Your Project",
+ "anchor": "set-up-your-project"
},
{
"depth": 2,
- "title": "Create the Write Contract Component",
- "anchor": "create-the-write-contract-component"
+ "title": "Create Your Contract",
+ "anchor": "create-your-contract"
},
{
"depth": 2,
- "title": "How It Works",
- "anchor": "how-it-works"
- },
- {
- "depth": 3,
- "title": "Wallet Connection",
- "anchor": "wallet-connection"
- },
- {
- "depth": 3,
- "title": "Data Reads",
- "anchor": "data-reads"
- },
- {
- "depth": 3,
- "title": "Data Writes",
- "anchor": "data-writes"
+ "title": "Compile",
+ "anchor": "compile"
},
{
"depth": 2,
- "title": "Conclusion",
- "anchor": "conclusion"
+ "title": "Deploy",
+ "anchor": "deploy"
},
{
"depth": 2,
@@ -13298,26 +11099,25 @@
}
],
"stats": {
- "chars": 31203,
- "words": 3688,
- "headings": 22,
- "estimated_token_count_total": 6967
+ "chars": 8114,
+ "words": 912,
+ "headings": 7,
+ "estimated_token_count_total": 2015
},
- "hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:15+00:00",
+ "hash": "sha256:fdd65f6fe6d109043f11a26f1477e2bbbce1a440dbcb2b191eacfa79a28766e9",
"token_estimator": "heuristic-v1"
},
{
- "id": "smart-contracts-cookbook-eth-dapps-uniswap-v2",
- "title": "Deploying Uniswap V2 on Polkadot",
- "slug": "smart-contracts-cookbook-eth-dapps-uniswap-v2",
+ "id": "smart-contracts-cookbook-smart-contracts-deploy-nft-foundry",
+ "title": "Deploy an NFT to Polkadot Hub with Foundry",
+ "slug": "smart-contracts-cookbook-smart-contracts-deploy-nft-foundry",
"categories": [
- "dApps",
- "Tooling"
+ "Basics",
+ "Smart Contracts"
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-eth-dapps-uniswap-v2.md",
- "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/eth-dapps/uniswap-v2/",
- "preview": "!!! smartcontract \"PolkaVM Preview Release\" PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**. ## Introduction",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-nft-foundry.md",
+ "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/smart-contracts/deploy-nft/foundry/",
+ "preview": "Non-Fungible Tokens (NFTs) represent unique digital assets commonly used for digital art, collectibles, gaming, and identity verification.",
"outline": [
{
"depth": 2,
@@ -13331,73 +11131,55 @@
},
{
"depth": 2,
- "title": "Set Up the Project",
- "anchor": "set-up-the-project"
+ "title": "Set Up Your Project",
+ "anchor": "set-up-your-project"
},
{
"depth": 2,
- "title": "Understanding Uniswap V2 Architecture",
- "anchor": "understanding-uniswap-v2-architecture"
+ "title": "Configure Foundry",
+ "anchor": "configure-foundry"
},
{
"depth": 2,
- "title": "Test the Contracts",
- "anchor": "test-the-contracts"
+ "title": "Create Your Contract",
+ "anchor": "create-your-contract"
},
{
"depth": 2,
- "title": "Deploy the Contracts",
- "anchor": "deploy-the-contracts"
+ "title": "Compile",
+ "anchor": "compile"
},
{
"depth": 2,
- "title": "Conclusion",
- "anchor": "conclusion"
+ "title": "Deploy",
+ "anchor": "deploy"
+ },
+ {
+ "depth": 2,
+ "title": "Where to Go Next",
+ "anchor": "where-to-go-next"
}
],
"stats": {
- "chars": 11280,
- "words": 1560,
- "headings": 7,
- "estimated_token_count_total": 2671
- },
- "hash": "sha256:2a42198668c759f63aa602115bf2d290ec7d03bbc3a3df20e30e85027e1b1cc3",
- "last_modified": "2025-10-28T14:42:15+00:00",
- "token_estimator": "heuristic-v1"
- },
- {
- "id": "smart-contracts-cookbook-smart-contracts-deploy-basic",
- "title": "smart-contracts-cookbook-smart-contracts-deploy-basic",
- "slug": "smart-contracts-cookbook-smart-contracts-deploy-basic",
- "categories": [
- "Uncategorized"
- ],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-basic.md",
- "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/smart-contracts/deploy-basic/",
- "preview": "TODO",
- "outline": [],
- "stats": {
- "chars": 5,
- "words": 1,
- "headings": 0,
- "estimated_token_count_total": 0
+ "chars": 3489,
+ "words": 438,
+ "headings": 8,
+ "estimated_token_count_total": 847
},
- "hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:15+00:00",
+ "hash": "sha256:c4b410125946db479b9c262a5132a31bb7730a778501c3a95910ad9d38007cf4",
"token_estimator": "heuristic-v1"
},
{
- "id": "smart-contracts-cookbook-smart-contracts-deploy-erc20",
- "title": "Deploy an ERC-20 to Polkadot Hub",
- "slug": "smart-contracts-cookbook-smart-contracts-deploy-erc20",
+ "id": "smart-contracts-cookbook-smart-contracts-deploy-nft-hardhat",
+ "title": "Deploy an NFT to Polkadot Hub with Hardhat",
+ "slug": "smart-contracts-cookbook-smart-contracts-deploy-nft-hardhat",
"categories": [
"Basics",
- "dApps",
"Smart Contracts"
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-erc20.md",
- "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/smart-contracts/deploy-erc20/",
- "preview": "!!! smartcontract \"PolkaVM Preview Release\" PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**. ## Introduction",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-nft-hardhat.md",
+ "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/smart-contracts/deploy-nft/hardhat/",
+ "preview": "Non-Fungible Tokens (NFTs) represent unique digital assets commonly used for digital art, collectibles, gaming, and identity verification.",
"outline": [
{
"depth": 2,
@@ -13411,45 +11193,59 @@
},
{
"depth": 2,
- "title": "Create the ERC-20 Contract",
- "anchor": "create-the-erc-20-contract"
+ "title": "Set Up Your Project",
+ "anchor": "set-up-your-project"
},
{
"depth": 2,
- "title": "Compile the Contract",
- "anchor": "compile-the-contract"
+ "title": "Configure Hardhat",
+ "anchor": "configure-hardhat"
},
{
"depth": 2,
- "title": "Deploy the Contract",
- "anchor": "deploy-the-contract"
+ "title": "Create Your Contract",
+ "anchor": "create-your-contract"
},
{
"depth": 2,
- "title": "Interact with Your ERC-20 Contract",
- "anchor": "interact-with-your-erc-20-contract"
+ "title": "Compile",
+ "anchor": "compile"
+ },
+ {
+ "depth": 2,
+ "title": "Set Up Deployment",
+ "anchor": "set-up-deployment"
+ },
+ {
+ "depth": 2,
+ "title": "Deploy",
+ "anchor": "deploy"
+ },
+ {
+ "depth": 2,
+ "title": "Where to Go Next",
+ "anchor": "where-to-go-next"
}
],
"stats": {
- "chars": 8926,
- "words": 1207,
- "headings": 6,
- "estimated_token_count_total": 2107
+ "chars": 4745,
+ "words": 550,
+ "headings": 9,
+ "estimated_token_count_total": 1137
},
- "hash": "sha256:296cba75b1d49aefa1b8636ba95ca20c3431b7eb0e93b0658add671ef5801732",
- "last_modified": "2025-10-28T14:42:15+00:00",
+ "hash": "sha256:f787f9c66787c53aa5c6fccf30d622b2b617794d1292641ea256e0896d418b28",
"token_estimator": "heuristic-v1"
},
{
- "id": "smart-contracts-cookbook-smart-contracts-deploy-nft-ethers",
- "title": "Deploy an NFT to Polkadot Hub with Ethers.js",
- "slug": "smart-contracts-cookbook-smart-contracts-deploy-nft-ethers",
+ "id": "smart-contracts-cookbook-smart-contracts-deploy-nft-remix",
+ "title": "Deploy an NFT to Polkadot Hub with Remix",
+ "slug": "smart-contracts-cookbook-smart-contracts-deploy-nft-remix",
"categories": [
"Basics",
"Smart Contracts"
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-nft-ethers.md",
- "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/smart-contracts/deploy-nft/ethers/",
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook-smart-contracts-deploy-nft-remix.md",
+ "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/smart-contracts/deploy-nft/remix/",
"preview": "Non-Fungible Tokens (NFTs) represent unique digital assets commonly used for digital art, collectibles, gaming, and identity verification.",
"outline": [
{
@@ -13464,8 +11260,8 @@
},
{
"depth": 2,
- "title": "Set Up Your Project",
- "anchor": "set-up-your-project"
+ "title": "Access Remix",
+ "anchor": "access-remix"
},
{
"depth": 2,
@@ -13489,13 +11285,50 @@
}
],
"stats": {
- "chars": 8114,
- "words": 912,
+ "chars": 3754,
+ "words": 505,
"headings": 7,
- "estimated_token_count_total": 2015
+ "estimated_token_count_total": 928
+ },
+ "hash": "sha256:12a8debfbc05c5ac0e2c94daa40167adab837dc4e1b2731f5b48ae8bc9bc2c93",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "smart-contracts-cookbook",
+ "title": "Smart Contracts Cookbook Index",
+ "slug": "smart-contracts-cookbook",
+ "categories": [
+ "Basics",
+ "dApps",
+ "Smart Contracts"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-cookbook.md",
+ "html_url": "https://docs.polkadot.com/smart-contracts/cookbook/",
+ "preview": "Welcome to the Polkadot smart contracts cookbook index.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "Get Tokens from the Faucet",
+ "anchor": "get-tokens-from-the-faucet"
+ },
+ {
+ "depth": 2,
+ "title": "EVM/PVM Smart Contracts",
+ "anchor": "evmpvm-smart-contracts"
+ },
+ {
+ "depth": 2,
+ "title": "Port Ethereum DApps",
+ "anchor": "port-ethereum-dapps"
+ }
+ ],
+ "stats": {
+ "chars": 1586,
+ "words": 204,
+ "headings": 3,
+ "estimated_token_count_total": 406
},
- "hash": "sha256:4e3ac6affdbe93ce9d132cbb838be1dfaf7a629b0e1f10ce4d90cc3899d656cb",
- "last_modified": "2025-10-28T14:42:16+00:00",
+ "hash": "sha256:ea0d085c376117436a9cf68e786da942cf88993651d4e06550f9ee03d2e810f4",
"token_estimator": "heuristic-v1"
},
{
@@ -13516,7 +11349,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13537,7 +11369,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13614,7 +11445,6 @@
"estimated_token_count_total": 6228
},
"hash": "sha256:72e41f816f07026d96c803f399c71852aa1151c464e79cec3e1746b282d5eaae",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13635,7 +11465,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13656,7 +11485,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13677,7 +11505,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13698,7 +11525,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13719,7 +11545,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13797,7 +11622,6 @@
"estimated_token_count_total": 4190
},
"hash": "sha256:1729ad83ad381a90752540644d400c60add3555e5da296ab455442be81d32f8c",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13818,7 +11642,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13839,7 +11662,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13860,7 +11682,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13902,7 +11723,6 @@
"estimated_token_count_total": 2430
},
"hash": "sha256:e3d8b84cb2cee7010978582998b2269296a042aec53fb016388690ab6adf355e",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13923,7 +11743,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -13986,7 +11805,6 @@
"estimated_token_count_total": 1347
},
"hash": "sha256:7589fa1dbdbf5748892ab6d42fc784d833f33e254bd3f95ee58424effcd38323",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14007,7 +11825,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14028,7 +11845,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14071,7 +11887,6 @@
"estimated_token_count_total": 309
},
"hash": "sha256:93e8a3043d65583e3d66f8f5f0ed6f4ef89a908ef85da2b6ca906a1100b7dded",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14108,7 +11923,6 @@
"estimated_token_count_total": 313
},
"hash": "sha256:c609bc98cba5efa2d2a808548cf93ad9d0a06455b35a8fd9f534daf52824f506",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14176,7 +11990,6 @@
"estimated_token_count_total": 1818
},
"hash": "sha256:f50cd1177dd4aff8eb031d6f21cb640f8187a7f2dd0edcaef5c73354a378e44d",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14239,7 +12052,6 @@
"estimated_token_count_total": 1182
},
"hash": "sha256:9542f40acae725e628f4c3155ad1e7e0e18b2eb518484856ad439a1d9f86d1f3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14322,7 +12134,6 @@
"estimated_token_count_total": 1133
},
"hash": "sha256:0792e3956242eb8e08ab82e2d73964c381074cc8b1ea46f396d136856fa6cc07",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14436,7 +12247,6 @@
"estimated_token_count_total": 1046
},
"hash": "sha256:dd29fab6e3c00d720b10effa4e50373a6fe9ab4b7bfd3aea892c7fa9c84318a2",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14633,28 +12443,87 @@
"estimated_token_count_total": 9750
},
"hash": "sha256:1fb7a20bc4a799a771954720428029419ec73afa640e589590c43dd041a7e307",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
"id": "smart-contracts-for-eth-devs-migration",
- "title": "smart-contracts-for-eth-devs-migration",
+ "title": "Migration FAQs and Considerations",
"slug": "smart-contracts-for-eth-devs-migration",
"categories": [
- "Uncategorized"
+ "Smart Contracts"
],
"raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-for-eth-devs-migration.md",
"html_url": "https://docs.polkadot.com/smart-contracts/for-eth-devs/migration/",
- "preview": "TODO",
- "outline": [],
+ "preview": "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.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "Introduction",
+ "anchor": "introduction"
+ },
+ {
+ "depth": 2,
+ "title": "Migration Considerations",
+ "anchor": "migration-considerations"
+ },
+ {
+ "depth": 2,
+ "title": "Migration Checklist",
+ "anchor": "migration-checklist"
+ },
+ {
+ "depth": 2,
+ "title": "Migration FAQs",
+ "anchor": "migration-faqs"
+ },
+ {
+ "depth": 3,
+ "title": "Which backend should I choose?",
+ "anchor": "which-backend-should-i-choose"
+ },
+ {
+ "depth": 3,
+ "title": "Do I need to rewrite my Solidity code?",
+ "anchor": "do-i-need-to-rewrite-my-solidity-code"
+ },
+ {
+ "depth": 3,
+ "title": "What about factory contracts?",
+ "anchor": "what-about-factory-contracts"
+ },
+ {
+ "depth": 3,
+ "title": "How do gas costs compare?",
+ "anchor": "how-do-gas-costs-compare"
+ },
+ {
+ "depth": 3,
+ "title": "Which Solidity features are not supported?",
+ "anchor": "which-solidity-features-are-not-supported"
+ },
+ {
+ "depth": 3,
+ "title": "How do I handle the existential deposit?",
+ "anchor": "how-do-i-handle-the-existential-deposit"
+ },
+ {
+ "depth": 3,
+ "title": "Can I use my existing development tools?",
+ "anchor": "can-i-use-my-existing-development-tools"
+ },
+ {
+ "depth": 2,
+ "title": "Conclusion",
+ "anchor": "conclusion"
+ }
+ ],
"stats": {
- "chars": 5,
- "words": 1,
- "headings": 0,
- "estimated_token_count_total": 0
+ "chars": 6247,
+ "words": 803,
+ "headings": 12,
+ "estimated_token_count_total": 1322
},
- "hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
+ "hash": "sha256:bf9b21750158389c387b92f2165947e5f5cff752f5d163680ee37493710e81d7",
"token_estimator": "heuristic-v1"
},
{
@@ -14712,7 +12581,6 @@
"estimated_token_count_total": 2840
},
"hash": "sha256:224a9f69d4613a5f1afdbc1f05379add8321fe159e32c71db003bbe08ff8e976",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14733,7 +12601,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14754,7 +12621,6 @@
"estimated_token_count_total": 0
},
"hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14807,7 +12673,6 @@
"estimated_token_count_total": 1627
},
"hash": "sha256:65809486f62f60c6a6ac8109f9f027361683c23f639991a045ec5c057b665026",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14895,7 +12760,6 @@
"estimated_token_count_total": 4474
},
"hash": "sha256:c74a28d8d62369591c5734535136508db3d1f7380e486fd214f98d433cafd6e7",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -14988,7 +12852,6 @@
"estimated_token_count_total": 3891
},
"hash": "sha256:e27657e4e4a14fe86f424b96631946ec36fb90d277e6010b6cbd64c4769aba8a",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -15061,7 +12924,6 @@
"estimated_token_count_total": 3250
},
"hash": "sha256:bc771f912627fa09cad64adab1bc81c052f650d6c5a3b4f0c91883a98f6628da",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -15134,7 +12996,6 @@
"estimated_token_count_total": 3035
},
"hash": "sha256:f0d36333d0d3afff7f6374a61d0f6d1fb878c9ef4c4e4c24447745661dbe59d0",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -15187,7 +13048,6 @@
"estimated_token_count_total": 2509
},
"hash": "sha256:205892e350168b3d0da7ccc280c67c3217ad1e45e87a53d124fa1dd69661aa5e",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -15260,7 +13120,6 @@
"estimated_token_count_total": 1122
},
"hash": "sha256:ee87115c828928c82937de26f5f938cecd4c3bb1225fdb61627e8092e6ea5951",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -15272,37 +13131,36 @@
],
"raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-precompiles-eth-native.md",
"html_url": "https://docs.polkadot.com/smart-contracts/precompiles/eth-native/",
- "preview": "TODO",
- "outline": [],
- "stats": {
- "chars": 5,
- "words": 1,
- "headings": 0,
- "estimated_token_count_total": 0
- },
- "hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
- "token_estimator": "heuristic-v1"
- },
- {
- "id": "smart-contracts-precompiles-staking",
- "title": "smart-contracts-precompiles-staking",
- "slug": "smart-contracts-precompiles-staking",
- "categories": [
- "Uncategorized"
+ "preview": "Ethereum-native precompiles are special contract implementations that provide essential cryptographic and utility functions at the runtime level. These precompiles are available at predefined addresses and offer optimized, native implementations of commonly used operations that would be computationally expensive or impractical to implement in pure contract code.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "Introduction",
+ "anchor": "introduction"
+ },
+ {
+ "depth": 2,
+ "title": "How to Use Precompiles",
+ "anchor": "how-to-use-precompiles"
+ },
+ {
+ "depth": 2,
+ "title": "Standard Precompiles in Polkadot Hub",
+ "anchor": "standard-precompiles-in-polkadot-hub"
+ },
+ {
+ "depth": 2,
+ "title": "Conclusion",
+ "anchor": "conclusion"
+ }
],
- "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-precompiles-staking.md",
- "html_url": "https://docs.polkadot.com/smart-contracts/precompiles/staking/",
- "preview": "TODO",
- "outline": [],
"stats": {
"chars": 5232,
"words": 532,
"headings": 4,
"estimated_token_count_total": 1192
},
- "hash": "sha256:56ba36249ea8216ad513b13df3de6c0e490ba214897674d30331f1c7e7edbef3",
- "last_modified": "2025-10-28T14:42:16+00:00",
+ "hash": "sha256:f17db5daca8feae70ce428e03a5a4870ef87dfc8571b07376327cd80d057b759",
"token_estimator": "heuristic-v1"
},
{
@@ -15368,8 +13226,43 @@
"headings": 9,
"estimated_token_count_total": 2325
},
- "hash": "sha256:4856172c6356357818234a3b7f0828716bd32e6192f3609c51de0cafcc5a75e7",
- "last_modified": "2025-10-28T14:42:16+00:00",
+ "hash": "sha256:c084190ea7d676128e7e399e8fe88598ca150f88d684db279a687ee1c3956120",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "smart-contracts-precompiles",
+ "title": "Advanced Functionalities via Precompiles",
+ "slug": "smart-contracts-precompiles",
+ "categories": [
+ "Uncategorized"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/smart-contracts-precompiles.md",
+ "html_url": "https://docs.polkadot.com/smart-contracts/precompiles/",
+ "preview": "!!! smartcontract \"PolkaVM Preview Release\" PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**. ## Introduction",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "Introduction",
+ "anchor": "introduction"
+ },
+ {
+ "depth": 2,
+ "title": "What are Precompiles?",
+ "anchor": "what-are-precompiles"
+ },
+ {
+ "depth": 2,
+ "title": "Conclusion",
+ "anchor": "conclusion"
+ }
+ ],
+ "stats": {
+ "chars": 2525,
+ "words": 328,
+ "headings": 3,
+ "estimated_token_count_total": 412
+ },
+ "hash": "sha256:a40e3f34f70db22bfe39e40d68dc5a53a726ce47cb73b602d8605355c61ffd22",
"token_estimator": "heuristic-v1"
},
{
@@ -15436,7 +13329,6 @@
"estimated_token_count_total": 2249
},
"hash": "sha256:1368f6d49bccb7ba0e642cc58ea2c97ca95ae45e390cb9fa2ab11b0b41de52f4",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -15467,9 +13359,7 @@
"headings": 2,
"estimated_token_count_total": 198
},
- "hash": "sha256:96acff10be56dea76acdb5c915c1dde0eb15eb12eb95e7871eef56bab6cda273",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:467765777cace42ab4e3f1bb36c94f97e655c5d2cd570e00dd747c6a3db043f7",
"token_estimator": "heuristic-v1"
},
{
@@ -15505,9 +13395,7 @@
"headings": 3,
"estimated_token_count_total": 208
},
- "hash": "sha256:61bc251929352f2299ca1d413d05aa9c3672b914575a285d73c7ba53dbd75bff",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:3a6704a6330c6e35aa98fe8d615e2e27beb870a48c68bda02c217e6ae77274d2",
"token_estimator": "heuristic-v1"
},
{
@@ -15568,9 +13456,7 @@
"headings": 8,
"estimated_token_count_total": 2764
},
- "hash": "sha256:370ed10155cee84889a6d230d0bc3476597448f88a2a271ab87ef893a3268c18",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:a2bba0ba575bd7e3f7199282ea5994087acf2c62e828f316e6eb62c9a43449e1",
"token_estimator": "heuristic-v1"
},
{
@@ -15596,9 +13482,7 @@
"headings": 1,
"estimated_token_count_total": 12
},
- "hash": "sha256:086a87823ab67ceac102358030e316583cd733c0ec326316e7f29061fe7f6934",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:917ce0777f8ac5a4288e54ce4086432d320b127a7fc753ade5392d766a1f3c33",
"token_estimator": "heuristic-v1"
},
{
@@ -15639,8 +13523,7 @@
"headings": 4,
"estimated_token_count_total": 339
},
- "hash": "sha256:a2bba0ba575bd7e3f7199282ea5994087acf2c62e828f316e6eb62c9a43449e1",
- "last_modified": "2025-10-28T14:42:16+00:00",
+ "hash": "sha256:9559f240b9433b496bfea92b57394a75c28bc743bb756c231f0137dfdf077e4a",
"token_estimator": "heuristic-v1"
},
{
@@ -15722,7 +13605,6 @@
"estimated_token_count_total": 34492
},
"hash": "sha256:bef820acfe429d4a847a8de82de6c70155ac6b3ad5ebdd574a2157923b45f688",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -15753,9 +13635,7 @@
"headings": 2,
"estimated_token_count_total": 125
},
- "hash": "sha256:d2f3ab658ab29514ac161b17df23e0e7c1f63a7fa4fefcef451ef80b413ab757",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:c675e4231537732f24d1dd93f2b248398248a77c9877860fe53926e255ed0710",
"token_estimator": "heuristic-v1"
},
{
@@ -15848,7 +13728,6 @@
"estimated_token_count_total": 5338
},
"hash": "sha256:b3530f5fc5c9e916181dbc259a7fbae9c60100cb0450fc6d47bbb0d140afa075",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -15920,7 +13799,6 @@
"estimated_token_count_total": 4358
},
"hash": "sha256:87b19f6e881611329b7015e8d8187d7d85b2b2ef14b01e832c8b8e20897e3b40",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -15977,7 +13855,6 @@
"estimated_token_count_total": 2138
},
"hash": "sha256:ff2c267284959711782c0d6ecb4b439c3a6cc31f763d5e1ff2cc3b1f6efb62b2",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16029,7 +13906,6 @@
"estimated_token_count_total": 2929
},
"hash": "sha256:df60044893f48dd7f37a11de275a16bf32adb31317ed70a789fd7fac64150e1a",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16121,7 +13997,6 @@
"estimated_token_count_total": 4789
},
"hash": "sha256:81750202081ff24447f4e129c49230eedb315d1b44c740b677c3495a8f7adb9a",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16203,7 +14078,6 @@
"estimated_token_count_total": 2452
},
"hash": "sha256:1eb463c6b2732ebed0d16165425cde438688d21cc302f759b40250850c2a5e83",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16266,7 +14140,6 @@
"estimated_token_count_total": 3255
},
"hash": "sha256:fe94de6f97fb588552f6cbc6b1a4c7399e91f5f31585f61a0dee66f5f50ff8a0",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16292,9 +14165,7 @@
"headings": 1,
"estimated_token_count_total": 42
},
- "hash": "sha256:2f11054e0d31c003ebae5d990b559bd56741d190ca409f6ad060216245fa2d17",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:06acc146698c1d3224544987d7ee52da498e3179228f98a494e385c5786a3a2c",
"token_estimator": "heuristic-v1"
},
{
@@ -16330,9 +14201,7 @@
"headings": 3,
"estimated_token_count_total": 107
},
- "hash": "sha256:a6a535f4f5e145d3e2a7518739f752ee3ed37b7745483f414e21c97792331d18",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:fdd391227992c966de25b9240f5492135a9993859ec42b77952c1aa3d2e39ed9",
"token_estimator": "heuristic-v1"
},
{
@@ -16373,9 +14242,7 @@
"headings": 4,
"estimated_token_count_total": 400
},
- "hash": "sha256:3ad540d8ad636304705cccb08bc1fdf21fe2fc7dc0f99bd509b23ae96d20e0ba",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:2fc6f513fd8b269e586b754b2bdbd2af9df5178624a028fab940a385f3fee577",
"token_estimator": "heuristic-v1"
},
{
@@ -16411,8 +14278,7 @@
"headings": 3,
"estimated_token_count_total": 211
},
- "hash": "sha256:388c988338ed84589c546bb1606d08641fb931dae307d3df92aeccd2e4986080",
- "last_modified": "2025-10-28T14:15:59+00:00",
+ "hash": "sha256:5d45ec9f8efda8c4bc2d0c21399a036d017a03540e7efab60d4710cb7eb33eb3",
"token_estimator": "heuristic-v1"
},
{
@@ -16481,7 +14347,6 @@
"estimated_token_count_total": 2702
},
"hash": "sha256:1f8ab387f721d865a7ca75eaa2528f1f2ebd4528a7d65ffeb27c68953100a3cb",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16550,7 +14415,6 @@
"estimated_token_count_total": 2564
},
"hash": "sha256:97dadddf4c27f469f552875461fc54d331fa151e4656401e15d6d4173115eecf",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16581,9 +14445,7 @@
"headings": 2,
"estimated_token_count_total": 80
},
- "hash": "sha256:07629376480e74afc7fe4d91df539b6ab22453df0f8143df11cc51ef9a78f736",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:1dfbb8c3cfa27f92e982b4ce705415e117c50eb38f641691129863b474741da7",
"token_estimator": "heuristic-v1"
},
{
@@ -16619,9 +14481,7 @@
"headings": 3,
"estimated_token_count_total": 256
},
- "hash": "sha256:cf9197d6909dd8865e8838cad95e3692fefaecc3d2f4773b26809a02051d620f",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:d63121126e51c785f0dfd4ae4ecd49cb71640515d39df69a0689f30a7ab8122f",
"token_estimator": "heuristic-v1"
},
{
@@ -16647,9 +14507,7 @@
"headings": 1,
"estimated_token_count_total": 12
},
- "hash": "sha256:aa6371024bb78c3eeedb6820a37859670046fd0e4f756ad417b20c39fb2983b9",
- "last_modified": "2025-10-27T18:04:05+00:00",
- "last_modified": "2025-10-27T18:04:05+00:00",
+ "hash": "sha256:94dbafb2d78b87d5f0f0c75de002501b8210ac8d66072bc07989f685837cbac5",
"token_estimator": "heuristic-v1"
},
{
@@ -16702,7 +14560,6 @@
"estimated_token_count_total": 1760
},
"hash": "sha256:9cf70459e921b8b231a3f2e7a7c1d47a4917e45f0c4d0fe873ad4062fd540a9a",
- "last_modified": "2025-10-28T14:42:16+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16775,7 +14632,6 @@
"estimated_token_count_total": 5118
},
"hash": "sha256:de7fde61d4cac9c28634ee496dcabe116fe44b1b87408f202103290d78247c05",
- "last_modified": "2025-10-28T14:42:18+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16858,7 +14714,6 @@
"estimated_token_count_total": 6206
},
"hash": "sha256:cb8ddb4a61f6a62182420b69382f1c7ab2adc2f4ae643f7f68c6867680afe81f",
- "last_modified": "2025-10-28T14:42:19+00:00",
"token_estimator": "heuristic-v1"
},
{
@@ -16921,7 +14776,114 @@
"estimated_token_count_total": 4135
},
"hash": "sha256:ca1d65d450f086a0eb7b81e9589e9894e04b217fe9709a1b464f09beb3ca9dc2",
- "last_modified": "2025-10-28T14:42:20+00:00",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "tutorials-smart-contracts-launch-your-first-project",
+ "title": "Launch Your First Project",
+ "slug": "tutorials-smart-contracts-launch-your-first-project",
+ "categories": [
+ "Uncategorized"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/tutorials-smart-contracts-launch-your-first-project.md",
+ "html_url": "https://docs.polkadot.com/tutorials/smart-contracts/launch-your-first-project/",
+ "preview": "!!! smartcontract \"PolkaVM Preview Release\" PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**. Kickstart your journey into smart contract development with this comprehensive guide. Learn how to create, deploy, and interact with contracts on Polkadot. Whether you're new to smart contracts or refining your skills, these guides provide a structured approach to launching your project.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "Development Pathway",
+ "anchor": "development-pathway"
+ },
+ {
+ "depth": 2,
+ "title": "In This Section",
+ "anchor": "in-this-section"
+ }
+ ],
+ "stats": {
+ "chars": 1211,
+ "words": 161,
+ "headings": 2,
+ "estimated_token_count_total": 77
+ },
+ "hash": "sha256:8d8fc5f794d4c793586cd3d412627f5e2fe76f182c75c3687abcf33deed5d65e",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "tutorials-smart-contracts",
+ "title": "Smart Contracts",
+ "slug": "tutorials-smart-contracts",
+ "categories": [
+ "Uncategorized"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/tutorials-smart-contracts.md",
+ "html_url": "https://docs.polkadot.com/tutorials/smart-contracts/",
+ "preview": "!!! smartcontract \"PolkaVM Preview Release\" PolkaVM smart contracts with Ethereum compatibility are in **early-stage development and may be unstable or incomplete**. Get started with deploying and interacting with smart contracts on Polkadot through practical, hands-on tutorials. Whether you're a beginner or an experienced developer, these guides will help you navigate the entire development lifecycle.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "What to Expect from These Tutorials",
+ "anchor": "what-to-expect-from-these-tutorials"
+ },
+ {
+ "depth": 2,
+ "title": "Start Building",
+ "anchor": "start-building"
+ },
+ {
+ "depth": 2,
+ "title": "In This Section",
+ "anchor": "in-this-section"
+ }
+ ],
+ "stats": {
+ "chars": 1057,
+ "words": 145,
+ "headings": 3,
+ "estimated_token_count_total": 130
+ },
+ "hash": "sha256:66bc34a12c50539dde2ffc69fe66891f73d3e1a2da5833ada15e26744ff32209",
+ "token_estimator": "heuristic-v1"
+ },
+ {
+ "id": "tutorials",
+ "title": "Tutorials",
+ "slug": "tutorials",
+ "categories": [
+ "Uncategorized"
+ ],
+ "raw_md_url": "https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/tutorials.md",
+ "html_url": "https://docs.polkadot.com/tutorials/",
+ "preview": "Welcome to the Polkadot Tutorials hub! Whether you’re building parachains, integrating system chains, or developing decentralized applications, these step-by-step guides are designed to help you achieve your goals efficiently and effectively.",
+ "outline": [
+ {
+ "depth": 2,
+ "title": "Polkadot Zero to Hero",
+ "anchor": "polkadot-zero-to-hero"
+ },
+ {
+ "depth": 3,
+ "title": "Parachain Developers",
+ "anchor": "parachain-developers"
+ },
+ {
+ "depth": 2,
+ "title": "Featured Tutorials",
+ "anchor": "featured-tutorials"
+ },
+ {
+ "depth": 2,
+ "title": "In This Section",
+ "anchor": "in-this-section"
+ }
+ ],
+ "stats": {
+ "chars": 2501,
+ "words": 355,
+ "headings": 4,
+ "estimated_token_count_total": 590
+ },
+ "hash": "sha256:a1d7789d44e4653e98ed41b8a13ea69e7733803c598ca850c9e2fc8f27a2b410",
"token_estimator": "heuristic-v1"
}
]
\ No newline at end of file
diff --git a/llms-full.jsonl b/llms-full.jsonl
index e7b3d0dd6..4effc69e0 100644
--- a/llms-full.jsonl
+++ b/llms-full.jsonl
@@ -977,6 +977,8 @@
{"page_id": "reference-parachains-chain-data", "page_title": "Chain Data", "index": 12, "depth": 3, "title": "Extrinsic", "anchor": "extrinsic", "start_char": 15081, "end_char": 17205, "estimated_token_count": 384, "token_estimator": "heuristic-v1", "text": "### Extrinsic\n\nThe runtime generates extrinsic metadata and provides useful information about transaction format. When decoded, the metadata contains the transaction version and the list of signed extensions.\n\nFor example:\n\n```json\n{\n \"extrinsic\": {\n \"ty\": 126,\n \"version\": 4,\n \"signed_extensions\": [\n {\n \"identifier\": \"CheckNonZeroSender\",\n \"ty\": 132,\n \"additional_signed\": 41\n },\n {\n \"identifier\": \"CheckSpecVersion\",\n \"ty\": 133,\n \"additional_signed\": 4\n },\n {\n \"identifier\": \"CheckTxVersion\",\n \"ty\": 134,\n \"additional_signed\": 4\n },\n {\n \"identifier\": \"CheckGenesis\",\n \"ty\": 135,\n \"additional_signed\": 11\n },\n {\n \"identifier\": \"CheckMortality\",\n \"ty\": 136,\n \"additional_signed\": 11\n },\n {\n \"identifier\": \"CheckNonce\",\n \"ty\": 138,\n \"additional_signed\": 41\n },\n {\n \"identifier\": \"CheckWeight\",\n \"ty\": 139,\n \"additional_signed\": 41\n },\n {\n \"identifier\": \"ChargeTransactionPayment\",\n \"ty\": 140,\n \"additional_signed\": 41\n }\n ]\n },\n \"ty\": 141\n}\n\n```\n\nThe type system is [composite](https://paritytech.github.io/polkadot-sdk/master/polkadot_sdk_docs/reference_docs/frame_runtime_types/index.html){target=\\_blank}, meaning each type identifier contains a reference to a specific type or to another type identifier that provides information about the associated primitive types.\n\nFor example, you can encode the `BitVec` type, but to decode it properly, you must know the types used for the `Order` and `Store` types. To find type information for `Order` and `Store`, you can use the path in the decoded JSON to locate their type identifiers."}
{"page_id": "reference-parachains-chain-data", "page_title": "Chain Data", "index": 13, "depth": 2, "title": "Included RPC APIs", "anchor": "included-rpc-apis", "start_char": 17205, "end_char": 18317, "estimated_token_count": 302, "token_estimator": "heuristic-v1", "text": "## Included RPC APIs\n\nA standard node comes with the following APIs to interact with a node:\n\n- **[`AuthorApiServer`](https://paritytech.github.io/polkadot-sdk/master/sc_rpc/author/trait.AuthorApiServer.html){target=\\_blank}**: Make calls into a full node, including authoring extrinsics and verifying session keys.\n- **[`ChainApiServer`](https://paritytech.github.io/polkadot-sdk/master/sc_rpc/chain/trait.ChainApiServer.html){target=\\_blank}**: Retrieve block header and finality information.\n- **[`OffchainApiServer`](https://paritytech.github.io/polkadot-sdk/master/sc_rpc/offchain/trait.OffchainApiServer.html){target=\\_blank}**: Make RPC calls for off-chain workers.\n- **[`StateApiServer`](https://paritytech.github.io/polkadot-sdk/master/sc_rpc/state/trait.StateApiServer.html){target=\\_blank}**: Query information about on-chain state such as runtime version, storage items, and proofs.\n- **[`SystemApiServer`](https://paritytech.github.io/polkadot-sdk/master/sc_rpc/system/trait.SystemApiServer.html){target=\\_blank}**: Retrieve information about network state, such as connected peers and node roles."}
{"page_id": "reference-parachains-chain-data", "page_title": "Chain Data", "index": 14, "depth": 2, "title": "Additional Resources", "anchor": "additional-resources", "start_char": 18317, "end_char": 18650, "estimated_token_count": 101, "token_estimator": "heuristic-v1", "text": "## Additional Resources\n\nThe following tools can help you locate and decode metadata:\n\n- [Subxt Explorer](https://paritytech.github.io/subxt-explorer/#/){target=\\_blank}\n- [Metadata Portal 🌗](https://github.com/paritytech/metadata-portal){target=\\_blank}\n- [De[code] Sub[strate]](https://github.com/paritytech/desub){target=\\_blank}"}
+{"page_id": "reference-parachains-consensus-async-backing", "page_title": "Asynchronous Backing", "index": 0, "depth": 2, "title": "Configurations", "anchor": "configurations", "start_char": 740, "end_char": 1565, "estimated_token_count": 183, "token_estimator": "heuristic-v1", "text": "## Configurations\nThe following configurations can be set by on-chain governance, dictating how many blocks ahead of the relay chain a given parachain's collators can run:\n\n* [`max_candidate_depth`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L49): the number of parablocks a collator can produce that are not yet included in the relay chain. A value of `2` means that there can be a maximum of 3 unincluded parablocks at any given time.\n* [`allowed_ancestry_len`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L54): the oldest relay parent a parablock can be built on top of. A value of `1` means collators can start building blocks 6 seconds in advance."}
+{"page_id": "reference-parachains-consensus-async-backing", "page_title": "Asynchronous Backing", "index": 1, "depth": 2, "title": "Synchronous VS. Asynchronous Processing", "anchor": "synchronous-vs-asynchronous-processing", "start_char": 1565, "end_char": 7217, "estimated_token_count": 1258, "token_estimator": "heuristic-v1", "text": "## Synchronous VS. Asynchronous Processing\n\n\n\nThe Polkadot-parachain protocol originally operated in synchronous mode, where both collators and validators drew context exclusively from the relay parent of the prior parablock, which lives on the relay chain. This made the Backing and Generation steps tightly coupled to the prior parablock completing the entire inclusion pipeline. As a result, one parablock could only be processed every other relay block, with just 0.5 seconds assigned for execution.\n\n```mermaid\n---\n displayMode: compact\n config:\n themeCSS: \"\n #item1 { fill: #450693; stroke: #450693; } \\n\n #item2 { fill: #8C00FF; stroke: #8C00FF; } \\n\n #item3 { fill: #FFC400; stroke: #FFC400; } \\n\n #r { fill: #eb4172; stroke:none; font-size: 20px; } \\n\n svg text { font-size: 20px !important; } \\n\n svg .sectionTitle { font-size: 20px !important; } \\n #p1padTop { display: none; } \\n\n\n /* Hide ALL task labels by default */\n text.taskText,\n text.taskTextOutside,\n [class*='taskText'] tspan { display: none !important; } \\n\n\n /* Show labels for the 'r' group (inside or outside, incl. tspans) */\n text.taskText[id^='r'],\n text.taskTextOutside[id^='r'],\n text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \\n\n\n /* Keep section titles styled */\n .sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \\n\n\n /* Hide the first two section titles (F1, F2). Change indexes if needed. */\n .sectionTitle:nth-of-type(1),\n .sectionTitle:nth-of-type(2) { display: none !important; } \\n\n\n /* Also hide SPACING row labels on the left */\n text.taskTextOutside[id^='p1padTop'] { display: none !important; } \\n\n \"\n themeVariables:\n sectionBkgColor: '#fff'\n gantt:\n numberSectionStyles: 1\n barHeight: 70\n gridLineStartPadding: 100\n---\n%%{init: {\"gantt\": {\"barHeight\": 70 }}}%%\ngantt\n dateFormat YYYY\n axisFormat %y\n tickInterval '10year'\n\n section F1\n R1 : r, 1905, 1907\n R2 : r, 1911, 1913\n R3 : r, 1917, 1919\n R4 : r, 1923, 1925\n\n section F2\n SPACING : p1padTop, 1901, 1924\n\n section P1\n X : item1, 1900, 1901\n Backing : item2, 1901, 1906\n Inclusion : item3, 1906, 1912\n\n section P2\n X : item1, 1912, 1913\n Backing : item2, 1913, 1918\n Inclusion : item3, 1918, 1924\n \n\n```\n\n\n\nThe modern protocol now uses asynchronous backing, where both collators and validators have access to [Unincluded Segments](/reference/parachains/consensus/inclusion-pipeline) as an additional context source. The Backing and Generation steps are no longer coupled to the prior block completing the full inclusion pipeline. Instead, the prior parablock only needs to complete the generation step and be added to the Unincluded Segments before the next parablock can begin the Backing and Generation steps.\n\nThis results in one parablock being processed every relay block (instead of every other relay block), and allows for more time to execute during the Generation step (0.5s → 2s).\n\n```mermaid\n---\n displayMode: compact\n config:\n themeCSS: \"\n #item1 { fill: #450693; stroke: #450693; } \\n\n #item2 { fill: #8C00FF; stroke: #8C00FF; } \\n\n #item3 { fill: #FFC400; stroke: #FFC400; } \\n\n #r { fill: #eb4172; stroke:none; font-size: 20px; } \\n\n svg text { font-size: 20px !important; } \\n\n svg .sectionTitle { font-size: 20px !important; } \\n #p1padTop { display: none; } \\n\n\n /* Hide ALL task labels by default */\n text.taskText,\n text.taskTextOutside,\n [class*='taskText'] tspan { display: none !important; } \\n\n\n /* Show labels for the 'r' group (inside or outside, incl. tspans) */\n text.taskText[id^='r'],\n text.taskTextOutside[id^='r'],\n text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \\n\n\n /* Keep section titles styled */\n .sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \\n\n\n /* Hide the first two section titles (F1, F2). Change indexes if needed. */\n .sectionTitle:nth-of-type(1),\n .sectionTitle:nth-of-type(2) { display: none !important; } \\n\n\n /* Also hide SPACING row labels on the left */\n text.taskTextOutside[id^='p1padTop'] { display: none !important; } \\n\n \"\n themeVariables:\n sectionBkgColor: '#fff'\n gantt:\n numberSectionStyles: 1\n barHeight: 70\n gridLineStartPadding: 100\n---\n%%{init: {\"gantt\": {\"barHeight\": 70 }}}%%\ngantt\n dateFormat YYYY\n axisFormat %y\n tickInterval '10year'\n\n section F1\n R1 : r, 1905, 1907\n R2 : r, 1911, 1913\n R3 : r, 1917, 1919\n R4 : r, 1923, 1925\n R5 : r, 1929, 1931\n\n section F2\n SPACING : p1padTop, 1901, 1930\n\n section P1\n X : item1, 1900, 1902\n Backing : item2, 1902, 1912\n Inclusion : item3, 1912, 1918\n\n section P2\n X : item1, 1906, 1908\n Backing : item2, 1908, 1918\n Inclusion : item3, 1918, 1924\n \n section P3\n X : item1, 1912, 1914\n Backing : item2, 1914, 1924\n Inclusion : item3, 1924, 1930\n\n section P4\n X : item1, 1918, 1920\n Backing : item2, 1920, 1930\n```"}
{"page_id": "reference-parachains-consensus-elastic-scaling", "page_title": "Elastic Scaling", "index": 0, "depth": 2, "title": "Introduction", "anchor": "introduction", "start_char": 19, "end_char": 842, "estimated_token_count": 130, "token_estimator": "heuristic-v1", "text": "## Introduction\n\nPolkadot's architecture delivers scalability and security through its shared security model, where the relay chain coordinates and validates multiple parallel chains. \n\nElastic scaling enhances this architecture by allowing parachains to utilize multiple computational cores simultaneously, breaking the previous 1:1 relationship between parachain and relay chain blocks.\n\nThis technical advancement enables parachains to process multiple blocks within a single relay chain block, significantly increasing throughput capabilities. By leveraging [Agile Coretime](/polkadot-protocol/architecture/polkadot-chain/agile-coretime){target=\\_blank}, parachains can dynamically adjust their processing capacity based on demand, creating an efficient and responsive infrastructure for high-throughput applications."}
{"page_id": "reference-parachains-consensus-elastic-scaling", "page_title": "Elastic Scaling", "index": 1, "depth": 2, "title": "How Elastic Scaling Works", "anchor": "how-elastic-scaling-works", "start_char": 842, "end_char": 4212, "estimated_token_count": 710, "token_estimator": "heuristic-v1", "text": "## How Elastic Scaling Works\n\nElastic scaling enables parachains to process multiple blocks in parallel by utilizing additional cores on the relay chain. This section provides a technical analysis of the performance advantages and details of the implementation.\n\nConsider a parachain that needs to process four consecutive parablocks. With traditional single-core allocation, the validation process follows a strictly sequential pattern. Each parablock undergoes a two-phase process on the relay chain:\n\n1. **Backing phase**: Validators create and distribute validity statements.\n2. **Inclusion phase**: The parablock is included in the relay chain after availability verification.\n\nThroughout the following diagrams, specific notation is used to represent different components of the system:\n\n- **R1, R2, ...**: Relay chain blocks (produced at ~6-second intervals).\n- **P1, P2, ...**: Parachain blocks that need validation and inclusion.\n- **C1, C2, ...**: Cores on the relay chain.\n\nIn the single-core scenario (assuming a 6-second relay chain block time), processing four parablocks requires approximately 30 seconds:\n\n```mermaid\nsequenceDiagram\n participant R1 as R1\n participant R2 as R2\n participant R3 as R3\n participant R4 as R4\n participant R5 as R5\n \n Note over R1,R5: Single Core Scenario\n \n rect rgb(200, 220, 240)\n Note right of R1: Core C1\n R1->>R1: Back P1\n R2->>R2: Include P1\n R2->>R2: Back P2\n R3->>R3: Include P2\n R3->>R3: Back P3\n R4->>R4: Include P3\n R4->>R4: Back P4\n R5->>R5: Include P4\n end\n```\n\nWith elastic scaling utilizing two cores simultaneously, the same four parablocks can be processed in approximately 18 seconds:\n\n```mermaid\nsequenceDiagram\n participant R1 as R1\n participant R2 as R2\n participant R3 as R3\n participant R4 as R4\n participant R5 as R5\n \n Note over R1,R3: Multi-Core Scenario\n \n rect rgb(200, 220, 240)\n Note right of R1: Core C1\n R1->>R1: Back P1\n R2->>R2: Include P1\n R2->>R2: Back P2\n R3->>R3: Include P2\n end\n \n rect rgb(220, 200, 240)\n Note right of R1: Core C2\n R1->>R1: Back P3\n R2->>R2: Include P3\n R2->>R2: Back P4\n R3->>R3: Include P4\n end\n```\n\nTo help interpret the sequence diagrams above, note the following key elements:\n\n- The horizontal axis represents time progression through relay chain blocks (R1-R5).\n- Each colored rectangle shows processing on a specific core (C1 or C2).\n- In the single-core scenario, all blocks must be processed sequentially on one core.\n- In the multi-core scenario, blocks are processed in parallel across multiple cores, reducing total time.\n\nThe relay chain processes these multiple parablocks as independent validation units during the backing, availability, and approval phases. However, during inclusion, it verifies that their state roots align properly to maintain chain consistency.\n\nFrom an implementation perspective:\n\n- **Parachain side**: Collators must increase their block production rate to utilize multiple cores fully.\n- **Validation process**: Each core operates independently, but with coordinated state verification.\n- **Resource management**: Cores are dynamically allocated based on parachain requirements.\n- **State consistency**: While backed and processed in parallel, the parablocks maintain sequential state transitions."}
{"page_id": "reference-parachains-consensus-elastic-scaling", "page_title": "Elastic Scaling", "index": 2, "depth": 2, "title": "Benefits of Elastic Scaling", "anchor": "benefits-of-elastic-scaling", "start_char": 4212, "end_char": 6001, "estimated_token_count": 288, "token_estimator": "heuristic-v1", "text": "## Benefits of Elastic Scaling\n\n- **Increased throughput**: Multiple concurrent cores enable parachains to process transactions at multiples of their previous capacity. By allowing multiple parachain blocks to be validated within each relay chain block cycle, applications can achieve significantly higher transaction volumes.\n\n- **Lower latency**: Transaction finality improves substantially with multi-core processing. Parachains currently achieve 2-second latency with three cores, with projected improvements to 500ms using 12 cores, enabling near-real-time application responsiveness.\n\n- **Resource efficiency**: Applications acquire computational resources precisely matched to their needs, eliminating wasteful over-provisioning. Coretime can be purchased at granular intervals (blocks, hours, days), creating cost-effective operations, particularly for applications with variable transaction patterns.\n\n- **Scalable growth**: New applications can launch with minimal initial resource commitment and scale dynamically as adoption increases. This eliminates the traditional paradox of either over-allocating resources (increasing costs) or under-allocating (degrading performance) during growth phases.\n\n- **Workload distribution**: Parachains intelligently distribute workloads across cores during peak demand periods and release resources when traffic subsides. Paired with secondary coretime markets, this ensures maximum resource utilization across the entire network ecosystem.\n\n- **Reliable performance**: End-users experience reliable application performance regardless of network congestion levels. Applications maintain responsiveness even during traffic spikes, eliminating performance degradation that commonly impacts blockchain applications during high-demand periods."}
@@ -985,6 +987,8 @@
{"page_id": "reference-parachains-consensus-elastic-scaling", "page_title": "Elastic Scaling", "index": 5, "depth": 3, "title": "Supporting Early-Stage Growth", "anchor": "supporting-early-stage-growth", "start_char": 6786, "end_char": 7168, "estimated_token_count": 69, "token_estimator": "heuristic-v1", "text": "### Supporting Early-Stage Growth\n\nStartups and new projects often begin with uncertain or volatile demand. With elastic scaling, teams can launch with minimal compute resources (e.g., a single core) and gradually scale as adoption increases. This prevents overprovisioning and enables cost-efficient growth until the application is ready for more permanent or horizontal scaling."}
{"page_id": "reference-parachains-consensus-elastic-scaling", "page_title": "Elastic Scaling", "index": 6, "depth": 3, "title": "Scaling Massive IoT Networks", "anchor": "scaling-massive-iot-networks", "start_char": 7168, "end_char": 7556, "estimated_token_count": 67, "token_estimator": "heuristic-v1", "text": "### Scaling Massive IoT Networks\n\nInternet of Things (IoT) applications often involve processing data from millions of devices in real time. Elastic scaling supports this need by enabling high-throughput transaction processing as demand fluctuates. Combined with Polkadot’s shared security model, it provides a reliable and privacy-preserving foundation for large-scale IoT deployments."}
{"page_id": "reference-parachains-consensus-elastic-scaling", "page_title": "Elastic Scaling", "index": 7, "depth": 3, "title": "Powering Real-Time, Low-Latency Systems", "anchor": "powering-real-time-low-latency-systems", "start_char": 7556, "end_char": 7871, "estimated_token_count": 58, "token_estimator": "heuristic-v1", "text": "### Powering Real-Time, Low-Latency Systems\n\nApplications like payment processors, trading platforms, gaming engines, or real-time data feeds require fast, consistent performance. Elastic scaling can reduce execution latency during demand spikes, helping ensure low-latency, reliable service even under heavy load."}
+{"page_id": "reference-parachains-consensus-inclusion-pipeline", "page_title": "Inclusion Pipeline", "index": 0, "depth": 2, "title": "Pipeline Stages", "anchor": "pipeline-stages", "start_char": 676, "end_char": 3452, "estimated_token_count": 660, "token_estimator": "heuristic-v1", "text": "## Pipeline Stages\n\nThe inclusion pipeline consists of three main stages:\n\n```mermaid\n%%{init: {\"flowchart\": {\"nodeSpacing\": 40, \"rankSpacing\": 60}}}%%\nflowchart LR\n %% Keep the pipeline on one row (container is hidden)\n subgraph Row[\" \"]\n direction LR\n G[\"Generation\"] --> B[\"Backing\"] --> I[\"Inclusion\"]\n end\n style Row fill:none,stroke:none\n\n %% Context: plain text (no box) pointing to both G and B\n C[\"Context\"]:::nobox\n C -.-> G\n C -.-> B\n\n classDef nobox fill:none,stroke:none,color:inherit;\n```\n**Context**: Context of state is provided as input in order for collators and validators to build a parablock during the generation and backing stages, respectively. This context is provided by two sources:\n\n* **Relay Parent**: The relay chain block which a given parablock is anchored to. Note that the relay parent of a parablock and the relay block including that parablock are always different. This context source lives on the relay chain.\n\n* **Unincluded Segments**: Chains of candidate parablocks that have yet to be included in the relay chain, i.e. they can contain blocks at any stage pre-inclusion. The core functionality that [Async Backing](/reference/parachains/consensus/async-backing) brings is the ability to build on these unincluded segments of block ancestors rather than building only on ancestors included in the relay chain state. This context source lives on the collators.\n\n**Generation**: Collators *execute* their blockchain's core functionality to generate a new block, producing a [proof-of-validity](https://paritytech.github.io/polkadot-sdk/book/types/availability.html?#proof-of-validity) (PoV), which is passed to validators selected for backing. The PoV is composed of:\n\n- A list of state transitions called the **block candidate**\n- The values in the parachain's database that the block modifies\n- The hashes of the unaffected points in the Merkle tree\n\n\n**Backing**: A subset of active validators verify that the parablock follows the state transition rules of the parachain and sign a [validity statement](https://paritytech.github.io/polkadot-sdk/book/types/backing.html?#validity-attestation) about the PoV which can have a positive or negative outcome. With enough positive statements (at least 2/3 of assigned validators), the candidate is considered backable. It is then noted in a fork on the relay chain, at which point it is considered backed, ready for the next stage of the pipeline.\n\n**Inclusion**: Validators gossip [erasure code chunks](https://paritytech.github.io/polkadot-sdk/book/types/availability.html#erasure-chunk) and put the parablock through the final [approval process](https://paritytech.github.io/polkadot-sdk/book/protocol-approval.html) before it is considered *included* in the relay chain."}
+{"page_id": "reference-parachains-consensus-old-notes", "page_title": "reference-parachains-consensus-old-notes", "index": 0, "depth": 3, "title": "Compute Advantage", "anchor": "compute-advantage", "start_char": 0, "end_char": 690, "estimated_token_count": 214, "token_estimator": "heuristic-v1", "text": "### Compute Advantage\nBelow is a table showing the main advantages of asynchronous over synchronous backing.\n\n| | Sync Backing | Async Backing | Async Backing Advantage |\n| ------------------------------------ | ------------ | ------------ | ----------------------------------------- |\n| **Parablocks included every** | 12 seconds | 6 seconds | **2x** more parablocks included |\n| **Parablock maximum execution time** | 0.5 seconds | 2 seconds | **4x** more execution time in a parablock |\n| **Total Computer Gain (per core)** | | | **8x Compute Throughput** |"}
{"page_id": "reference-parachains-cryptography", "page_title": "Cryptography", "index": 0, "depth": 2, "title": "Introduction", "anchor": "introduction", "start_char": 16, "end_char": 525, "estimated_token_count": 73, "token_estimator": "heuristic-v1", "text": "## Introduction\n\nCryptography forms the backbone of blockchain technology, providing the mathematical verifiability crucial for consensus systems, data integrity, and user security. While a deep understanding of the underlying mathematical processes isn't necessary for most blockchain developers, grasping the fundamental applications of cryptography is essential. This page comprehensively overviews cryptographic implementations used across Polkadot SDK-based chains and the broader blockchain ecosystem."}
{"page_id": "reference-parachains-cryptography", "page_title": "Cryptography", "index": 1, "depth": 2, "title": "Hash Functions", "anchor": "hash-functions", "start_char": 525, "end_char": 1170, "estimated_token_count": 130, "token_estimator": "heuristic-v1", "text": "## Hash Functions\n\nHash functions are fundamental to blockchain technology, creating a unique digital fingerprint for any piece of data, including simple text, images, or any other form of file. They map input data of any size to a fixed-size output (typically 32 bytes) using complex mathematical operations. Hashing is used to verify data integrity, create digital signatures, and provide a secure way to store passwords. This form of mapping is known as the [\"pigeonhole principle,\"](https://en.wikipedia.org/wiki/Pigeonhole_principle){target=\\_blank} it is primarily implemented to efficiently and verifiably identify data from large sets."}
{"page_id": "reference-parachains-cryptography", "page_title": "Cryptography", "index": 2, "depth": 3, "title": "Key Properties of Hash Functions", "anchor": "key-properties-of-hash-functions", "start_char": 1170, "end_char": 1720, "estimated_token_count": 138, "token_estimator": "heuristic-v1", "text": "### Key Properties of Hash Functions\n\n- **Deterministic**: The same input always produces the same output.\n- **Quick computation**: It's easy to calculate the hash value for any given input.\n- **Pre-image resistance**: It's infeasible to generate the input data from its hash.\n- **Small changes in input yield large changes in output**: Known as the [\"avalanche effect\"](https://en.wikipedia.org/wiki/Avalanche_effect){target=\\_blank}.\n- **Collision resistance**: The probabilities are extremely low to find two different inputs with the same hash."}
@@ -1214,21 +1218,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 +1529,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..cfdd92a42 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.
@@ -186,7 +188,9 @@ Docs: Polkadot Protocol
- [Transactions Weights and Fees](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-blocks-transactions-fees-fees.md): Overview of transaction weights and fees in Polkadot SDK chains, detailing how fees are calculated using a defined formula and runtime specifics.
- [Transactions](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-blocks-transactions-fees-transactions.md): Learn how to construct, submit, and validate transactions in the Polkadot SDK, covering signed, unsigned, and inherent types of transactions.
- [Chain Data](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-chain-data.md): Learn how to expose and utilize chain data for blockchain applications. Discover runtime metadata, RPC APIs, and tools for efficient development.
+- [Asynchronous Backing](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-async-backing.md): Understand how asynchronous backing pipelines parachain block production, the protocol changes it introduces on the Relay Chain, and how parachains participate safely and efficiently.
- [Elastic Scaling](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-elastic-scaling.md): Learn how elastic scaling in Polkadot boosts parachain throughput, reduces latency, and supports dynamic, cost-efficient resource allocation.
+- [Inclusion Pipeline](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-inclusion-pipeline.md): Understand each of the core components of the Inclusion Pipeline.
- [Cryptography](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-cryptography.md): A concise guide to cryptography in blockchain, covering hash functions, encryption types, digital signatures, and elliptic curve applications.
- [Data Encoding](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-data-encoding.md): SCALE codec enables fast, efficient data encoding, ideal for resource-constrained environments like Wasm, supporting custom types and compact encoding.
- [Interoperability](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-interoperability.md): Explore the importance of interoperability in the Polkadot ecosystem, covering XCM, bridges, and cross-chain communication.
@@ -346,14 +350,13 @@ Docs: Uncategorized
- [Parachain Basics](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/polkadot-protocol-parachain-basics.md): Discover Polkadot’s technical foundations, from blockchain basics and cryptography to network features like interoperability and randomness.
- [Smart Contract Basics](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/polkadot-protocol-smart-contract-basics.md): Learn the fundamental concepts of smart contracts on Polkadot, including PolkaVM, account management, networks, and transaction mechanics.
- [Learn About the Polkadot Protocol](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/polkadot-protocol.md): Gain a comprehensive understanding of Polkadot through this technical overview, exploring its architecture, fundamental concepts, and essential components.
-- [reference-parachains-consensus-async-backing](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-async-backing.md): No description available.
+- [reference-parachains-consensus-old-notes](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus-old-notes.md): No description available.
- [reference-parachains-consensus](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-parachains-consensus.md): No description available.
- [reference-polkadot-hub](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-polkadot-hub.md): No description available.
- [reference-tools-chopsticks](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/master/.ai/pages/reference-tools-chopsticks.md): No description available.
- [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/parachains/consensus/async-backing.md b/reference/parachains/consensus/async-backing.md
index 30404ce4c..0898c80f9 100644
--- a/reference/parachains/consensus/async-backing.md
+++ b/reference/parachains/consensus/async-backing.md
@@ -1 +1,267 @@
-TODO
\ No newline at end of file
+---
+title: Asynchronous Backing
+description: Understand how asynchronous backing pipelines parachain block production, the protocol changes it introduces on the Relay Chain, and how parachains participate safely and efficiently.
+categories: Polkadot Protocol
+---
+
+Asynchronous backing (often shortened to ***Async Backing***) is a parachain [configuration](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L43) set by on-chain governance. It allows collators and validators to build *some* number of blocks ahead of the relay chain during the **generation** and **backing** stages of the [Inclusion Pipeline](/reference/parachains/consensus/inclusion-pipeline).
+
+Async Backing improves throughput of the overall Polkadot Network by using coretime more efficiently, and enables the parallel processing needed for parachains to further scale throughput via [Elastic Scaling](/reference/parachains/consensus/elastic-scaling).
+
+## Configurations
+The following configurations can be set by on-chain governance, dictating how many blocks ahead of the relay chain a given parachain's collators can run:
+
+* [`max_candidate_depth`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L49): the number of parablocks a collator can produce that are not yet included in the relay chain. A value of `2` means that there can be a maximum of 3 unincluded parablocks at any given time.
+* [`allowed_ancestry_len`](https://github.com/paritytech/polkadot-sdk/blob/f204e3264f945c33b4cea18a49f7232c180b07c5/polkadot/primitives/src/vstaging/mod.rs#L54): the oldest relay parent a parablock can be built on top of. A value of `1` means collators can start building blocks 6 seconds in advance.
+
+## Synchronous VS. Asynchronous Processing
+
+
+
+The Polkadot-parachain protocol originally operated in synchronous mode, where both collators and validators drew context exclusively from the relay parent of the prior parablock, which lives on the relay chain. This made the Backing and Generation steps tightly coupled to the prior parablock completing the entire inclusion pipeline. As a result, one parablock could only be processed every other relay block, with just 0.5 seconds assigned for execution.
+
+```mermaid
+---
+ displayMode: compact
+ config:
+ themeCSS: "
+ #item1 { fill: #450693; stroke: #450693; } \n
+ #item2 { fill: #8C00FF; stroke: #8C00FF; } \n
+ #item3 { fill: #FFC400; stroke: #FFC400; } \n
+ #r { fill: #eb4172; stroke:none; font-size: 20px; } \n
+ svg text { font-size: 20px !important; } \n
+ svg .sectionTitle { font-size: 20px !important; } \n #p1padTop { display: none; } \n
+
+ /* Hide ALL task labels by default */
+ text.taskText,
+ text.taskTextOutside,
+ [class*='taskText'] tspan { display: none !important; } \n
+
+ /* Show labels for the 'r' group (inside or outside, incl. tspans) */
+ text.taskText[id^='r'],
+ text.taskTextOutside[id^='r'],
+ text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \n
+
+ /* Keep section titles styled */
+ .sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \n
+
+ /* Hide the first two section titles (F1, F2). Change indexes if needed. */
+ .sectionTitle:nth-of-type(1),
+ .sectionTitle:nth-of-type(2) { display: none !important; } \n
+
+ /* Also hide SPACING row labels on the left */
+ text.taskTextOutside[id^='p1padTop'] { display: none !important; } \n
+ "
+ themeVariables:
+ sectionBkgColor: '#fff'
+ gantt:
+ numberSectionStyles: 1
+ barHeight: 70
+ gridLineStartPadding: 100
+---
+%%{init: {"gantt": {"barHeight": 70 }}}%%
+gantt
+ dateFormat YYYY
+ axisFormat %y
+ tickInterval '10year'
+
+ section F1
+ R1 : r, 1905, 1907
+ R2 : r, 1911, 1913
+ R3 : r, 1917, 1919
+ R4 : r, 1923, 1925
+
+ section F2
+ SPACING : p1padTop, 1901, 1924
+
+ section P1
+ X : item1, 1900, 1901
+ Backing : item2, 1901, 1906
+ Inclusion : item3, 1906, 1912
+
+ section P2
+ X : item1, 1912, 1913
+ Backing : item2, 1913, 1918
+ Inclusion : item3, 1918, 1924
+
+
+```
+
+
+
+The modern protocol now uses asynchronous backing, where both collators and validators have access to [Unincluded Segments](/reference/parachains/consensus/inclusion-pipeline) as an additional context source. The Backing and Generation steps are no longer coupled to the prior block completing the full inclusion pipeline. Instead, the prior parablock only needs to complete the generation step and be added to the Unincluded Segments before the next parablock can begin the Backing and Generation steps.
+
+This results in one parablock being processed every relay block (instead of every other relay block), and allows for more time to execute during the Generation step (0.5s → 2s).
+
+```mermaid
+---
+ displayMode: compact
+ config:
+ themeCSS: "
+ #item1 { fill: #450693; stroke: #450693; } \n
+ #item2 { fill: #8C00FF; stroke: #8C00FF; } \n
+ #item3 { fill: #FFC400; stroke: #FFC400; } \n
+ #r { fill: #eb4172; stroke:none; font-size: 20px; } \n
+ svg text { font-size: 20px !important; } \n
+ svg .sectionTitle { font-size: 20px !important; } \n #p1padTop { display: none; } \n
+
+ /* Hide ALL task labels by default */
+ text.taskText,
+ text.taskTextOutside,
+ [class*='taskText'] tspan { display: none !important; } \n
+
+ /* Show labels for the 'r' group (inside or outside, incl. tspans) */
+ text.taskText[id^='r'],
+ text.taskTextOutside[id^='r'],
+ text[id^='r'] tspan { display: inline !important; font-size: 20px; color: #000 !important; } \n
+
+ /* Keep section titles styled */
+ .sectionTitle { fill: #000 !important; font-weight: 700; font-size: 18px; } \n
+
+ /* Hide the first two section titles (F1, F2). Change indexes if needed. */
+ .sectionTitle:nth-of-type(1),
+ .sectionTitle:nth-of-type(2) { display: none !important; } \n
+
+ /* Also hide SPACING row labels on the left */
+ text.taskTextOutside[id^='p1padTop'] { display: none !important; } \n
+ "
+ themeVariables:
+ sectionBkgColor: '#fff'
+ gantt:
+ numberSectionStyles: 1
+ barHeight: 70
+ gridLineStartPadding: 100
+---
+%%{init: {"gantt": {"barHeight": 70 }}}%%
+gantt
+ dateFormat YYYY
+ axisFormat %y
+ tickInterval '10year'
+
+ section F1
+ R1 : r, 1905, 1907
+ R2 : r, 1911, 1913
+ R3 : r, 1917, 1919
+ R4 : r, 1923, 1925
+ R5 : r, 1929, 1931
+
+ section F2
+ SPACING : p1padTop, 1901, 1930
+
+ section P1
+ X : item1, 1900, 1902
+ Backing : item2, 1902, 1912
+ Inclusion : item3, 1912, 1918
+
+ section P2
+ X : item1, 1906, 1908
+ Backing : item2, 1908, 1918
+ Inclusion : item3, 1918, 1924
+
+ section P3
+ X : item1, 1912, 1914
+ Backing : item2, 1914, 1924
+ Inclusion : item3, 1924, 1930
+
+ section P4
+ X : item1, 1918, 1920
+ Backing : item2, 1920, 1930
+```
+
+
\ No newline at end of file
diff --git a/reference/parachains/consensus/inclusion-pipeline.md b/reference/parachains/consensus/inclusion-pipeline.md
new file mode 100644
index 000000000..69f0882dd
--- /dev/null
+++ b/reference/parachains/consensus/inclusion-pipeline.md
@@ -0,0 +1,49 @@
+---
+title: Inclusion Pipeline
+description: Understand each of the core components of the Inclusion Pipeline.
+categories: Polkadot Protocol
+---
+
+The inclusion pipeline is the multi-stage process through which every parachain block (parablock) is **validated** and **secured** before being finalized in the Polkadot relay chain.
+
+This pipeline ensures that all parablocks meet Polkadot's security guarantees through progressive verification: each parablock passes through multiple validation stages with different validator sets, ensuring that invalid parablocks cannot be finalized even if some validators *or collators* are malicious/compromised.
+
+By configuring [Async Backing](/reference/parachains/consensus/async-backing), a parachin can run this pipeline in parallel for many blocks, allowing for high throughput.
+
+## Pipeline Stages
+
+The inclusion pipeline consists of three main stages:
+
+```mermaid
+%%{init: {"flowchart": {"nodeSpacing": 40, "rankSpacing": 60}}}%%
+flowchart LR
+ %% Keep the pipeline on one row (container is hidden)
+ subgraph Row[" "]
+ direction LR
+ G["Generation"] --> B["Backing"] --> I["Inclusion"]
+ end
+ style Row fill:none,stroke:none
+
+ %% Context: plain text (no box) pointing to both G and B
+ C["Context"]:::nobox
+ C -.-> G
+ C -.-> B
+
+ classDef nobox fill:none,stroke:none,color:inherit;
+```
+**Context**: Context of state is provided as input in order for collators and validators to build a parablock during the generation and backing stages, respectively. This context is provided by two sources:
+
+* **Relay Parent**: The relay chain block which a given parablock is anchored to. Note that the relay parent of a parablock and the relay block including that parablock are always different. This context source lives on the relay chain.
+
+* **Unincluded Segments**: Chains of candidate parablocks that have yet to be included in the relay chain, i.e. they can contain blocks at any stage pre-inclusion. The core functionality that [Async Backing](/reference/parachains/consensus/async-backing) brings is the ability to build on these unincluded segments of block ancestors rather than building only on ancestors included in the relay chain state. This context source lives on the collators.
+
+**Generation**: Collators *execute* their blockchain's core functionality to generate a new block, producing a [proof-of-validity](https://paritytech.github.io/polkadot-sdk/book/types/availability.html?#proof-of-validity) (PoV), which is passed to validators selected for backing. The PoV is composed of:
+
+- A list of state transitions called the **block candidate**
+- The values in the parachain's database that the block modifies
+- The hashes of the unaffected points in the Merkle tree
+
+
+**Backing**: A subset of active validators verify that the parablock follows the state transition rules of the parachain and sign a [validity statement](https://paritytech.github.io/polkadot-sdk/book/types/backing.html?#validity-attestation) about the PoV which can have a positive or negative outcome. With enough positive statements (at least 2/3 of assigned validators), the candidate is considered backable. It is then noted in a fork on the relay chain, at which point it is considered backed, ready for the next stage of the pipeline.
+
+**Inclusion**: Validators gossip [erasure code chunks](https://paritytech.github.io/polkadot-sdk/book/types/availability.html#erasure-chunk) and put the parablock through the final [approval process](https://paritytech.github.io/polkadot-sdk/book/protocol-approval.html) before it is considered *included* in the relay chain.
\ No newline at end of file