Skip to content

Commit e949d01

Browse files
committed
fresh llms
1 parent 3913277 commit e949d01

File tree

2 files changed

+203
-1
lines changed

2 files changed

+203
-1
lines changed

llms-full.txt

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/re
9191
Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/polkadot-omni-node.md
9292
Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/quickstart/index.md
9393
Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/quickstart/pop-cli.md
94+
Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/remote-proxies.md
9495
Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/rpc-calls.md
9596
Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/spawn-chains/index.md
9697
Doc-Page: https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/spawn-chains/zombienet/get-started.md
@@ -18141,6 +18142,206 @@ For a comprehensive guide to all Pop CLI features and advanced usage, see the of
1814118142
Pop CLI also offers powerful solutions for smart contract developers. If you're interested in that path, check out the [Pop CLI Smart Contracts](https://learn.onpop.io/contracts) documentation.
1814218143
--- END CONTENT ---
1814318144

18145+
Doc-Content: https://docs.polkadot.com/develop/toolkit/parachains/remote-proxies/
18146+
--- BEGIN CONTENT ---
18147+
---
18148+
title: Remote Proxies
18149+
description: Remote proxies enable cross-chain proxy functionality within the Polkadot ecosystem, allowing proxy accounts defined on one chain to execute transactions on different chains through cryptographic storage proofs.
18150+
---
18151+
18152+
# Remote Proxies
18153+
18154+
!!!warning "Kusama Implementation Only"
18155+
Remote proxies are currently only available on Kusama and its parachains (such as Kusama Asset Hub). This feature is not yet deployed on Polkadot MainNet. The examples and implementations described in this guide are specific to the Kusama ecosystem.
18156+
18157+
## Introduction
18158+
18159+
Remote proxies enable cross-chain proxy functionality within the Polkadot ecosystem, allowing proxy accounts defined on one chain to execute transactions on different chains through cryptographic storage proofs. This functionality extends the traditional [proxy system](https://wiki.polkadot.com/learn/learn-proxies/){target=\_blank} beyond single-chain boundaries.
18160+
18161+
This guide covers:
18162+
18163+
- Understanding remote proxy mechanics and architecture.
18164+
- Implementation workflow and timing constraints.
18165+
- Practical examples using Polkadot.js.
18166+
- Advanced use cases and security considerations.
18167+
18168+
Remote proxies are particularly valuable for maintaining unified security models across multiple parachains while avoiding the complexity of managing separate proxy setups on each chain.
18169+
18170+
!!!note "Traditional vs Remote Proxies"
18171+
Traditional proxies work within a single chain, where both the proxy and proxied accounts exist on the same blockchain. Remote proxies extend this concept across chains, using cryptographic proofs to verify proxy relationships without requiring account replication.
18172+
18173+
## Remote Proxy Architecture
18174+
18175+
Remote proxies operate through a trust and verification model using storage proofs. The target chain verifies the existence of proxy relationships on the source chain without requiring direct replication of proxy data.
18176+
18177+
```mermaid
18178+
flowchart LR
18179+
RC([Relay Chain])-- Proxy Definition -->AH([Asset Hub])
18180+
RC -- Storage Proof --> AH
18181+
AH -- Verify Proof --> TX([Execute Transaction])
18182+
AH -- Trust Relationship --> RC
18183+
```
18184+
18185+
In this architecture, Asset Hub trusts proxy definitions from the Relay Chain. When a remote proxy transaction is initiated, Asset Hub verifies the storage proof against its stored block roots from the Relay Chain, ensuring the proxy relationship is authentic and current.
18186+
18187+
The verification process utilizes [Merkle proofs](/polkadot-protocol/glossary/#trie-patricia-merkle-tree){target=\_blank} to confirm proxy permissions exist on the source chain at a specific block height.
18188+
18189+
!!!note "What makes remote proxies secure?"
18190+
Remote proxies maintain security through cryptographic storage proofs that cannot be forged. The target chain verifies these proofs against trusted block roots, ensuring proxy relationships are authentic without requiring blind trust in external nodes.
18191+
18192+
## Implementation Workflow
18193+
18194+
Remote proxy execution follows a time-constrained workflow requiring coordination between multiple chains. The remote proxy workflow consists of several critical steps that must be completed within a narrow time window.
18195+
18196+
1. **Block Synchronization**: Query the target chain for recognized source chain blocks.
18197+
2. **Storage Proof Creation**: Generate cryptographic proof of proxy relationship.
18198+
3. **Transaction Construction**: Build the wrapped transaction with proof data.
18199+
4. **Execution**: Submit the transaction before proof expiration.
18200+
18201+
Remote proxies operate under strict timing limitations.
18202+
18203+
- **Proof Validity**: Storage proofs expire after approximately **1 minute**.
18204+
- **Block Recognition**: Target chains maintain only recent source chain block roots.
18205+
- **Execution Window**: Transactions must be submitted immediately after proof generation.
18206+
18207+
These constraints exist to prevent replay attacks and ensure proof freshness while maintaining system security.
18208+
18209+
| Constraint Type | Duration | Purpose |
18210+
| :-------------: | :------: | :-----: |
18211+
| Proof Validity | ~1 minute | Prevent replay attacks |
18212+
| Block Storage | ~10 minutes | Balance security and usability |
18213+
| Execution Window | Immediate | Ensure proof freshness |
18214+
18215+
## Practical Implementation
18216+
18217+
### Prerequisites
18218+
18219+
Before implementing remote proxies, ensure you have:
18220+
18221+
- Active proxy relationship on the source chain (Kusama).
18222+
- Access to both source and target chain RPC endpoints.
18223+
- Compatible proxy types between chains.
18224+
- Node.js environment for script execution.
18225+
18226+
### Installation and Setup
18227+
18228+
To implement remote proxies, you need to install the [`@polkadot/api`](/develop/toolkit/api-libraries/polkadot-js-api/){target=\_blank} package and create a script to execute the remote proxy transaction:
18229+
18230+
```bash
18231+
pnpm add @polkadot/api
18232+
```
18233+
18234+
Create your implementation script:
18235+
18236+
```bash
18237+
touch remote-proxy-example.js
18238+
```
18239+
18240+
### Implementation Example
18241+
18242+
Here is a complete implementation example of a remote proxy transaction:
18243+
18244+
```javascript title="remote-proxy-example.js"
18245+
import { ApiPromise, WsProvider } from '@polkadot/api';
18246+
18247+
// Account configuration - replace with your addresses
18248+
const RECIPIENT_ACCOUNT = 'INSERT_RECIPIENT_ACCOUNT';
18249+
const PROXIED_ACCOUNT = 'INSERT_PROXIED_ACCOUNT';
18250+
18251+
async function executeRemoteProxyTransaction() {
18252+
try {
18253+
// Establish connections to both chains
18254+
console.log('Connecting to Kusama relay chain...');
18255+
const kusamaProvider = new WsProvider(
18256+
'wss://kusama.public.curie.radiumblock.co/ws',
18257+
);
18258+
const kusamaApi = await ApiPromise.create({ provider: kusamaProvider });
18259+
18260+
console.log('Connecting to Kusama Asset Hub...');
18261+
const assetHubProvider = new WsProvider(
18262+
'wss://kusama-asset-hub-rpc.polkadot.io',
18263+
);
18264+
const assetHubApi = await ApiPromise.create({ provider: assetHubProvider });
18265+
18266+
// Step 1: Generate storage key for proxy definition
18267+
const proxyStorageKey = kusamaApi.query.proxy.proxies.key(PROXIED_ACCOUNT);
18268+
console.log(`Proxy storage key: ${proxyStorageKey}`);
18269+
18270+
// Step 2: Identify latest recognized block
18271+
const blockToRootMapping = JSON.parse(
18272+
await assetHubApi.query.remoteProxyRelayChain.blockToRoot(),
18273+
);
18274+
const latestRecognizedBlock =
18275+
blockToRootMapping[blockToRootMapping.length - 1][0];
18276+
const blockHash = await kusamaApi.rpc.chain.getBlockHash(
18277+
latestRecognizedBlock,
18278+
);
18279+
18280+
console.log(`Generating proof for block ${latestRecognizedBlock}`);
18281+
18282+
// Step 3: Create storage proof
18283+
const storageProof = JSON.parse(
18284+
await kusamaApi.rpc.state.getReadProof([proxyStorageKey], blockHash),
18285+
);
18286+
18287+
// Step 4: Define target transaction
18288+
const targetTransaction = assetHubApi.tx.balances.transferAll(
18289+
RECIPIENT_ACCOUNT,
18290+
false,
18291+
);
18292+
18293+
// Step 5: Construct remote proxy call
18294+
const remoteProxyCall = assetHubApi.tx.remoteProxyRelayChain.remoteProxy(
18295+
PROXIED_ACCOUNT,
18296+
null, // Proxy type filter (null accepts any compatible type)
18297+
targetTransaction.method,
18298+
{
18299+
RelayChain: {
18300+
proof: storageProof.proof,
18301+
block: latestRecognizedBlock,
18302+
},
18303+
},
18304+
);
18305+
18306+
console.log('\n✅ Remote proxy transaction constructed successfully!');
18307+
console.log('\n📋 Next steps:');
18308+
console.log('1. Copy the URL below');
18309+
console.log('2. Open in Polkadot.js Apps');
18310+
console.log('3. Submit the transaction within 1 minute');
18311+
console.log('\n🔗 Polkadot.js Apps URL:');
18312+
console.log(
18313+
`https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-asset-hub-rpc.polkadot.io#/extrinsics/decode/${remoteProxyCall.method.toHex()}`,
18314+
);
18315+
18316+
// Cleanup connections
18317+
await kusamaApi.disconnect();
18318+
await assetHubApi.disconnect();
18319+
} catch (error) {
18320+
console.error('❌ Remote proxy execution failed:', error.message);
18321+
}
18322+
}
18323+
18324+
// Execute the remote proxy workflow
18325+
executeRemoteProxyTransaction();
18326+
```
18327+
18328+
Ensure to replace the `RECIPIENT_ACCOUNT` and `PROXIED_ACCOUNT` with your accounts. For a concrete example, check out the [Sending a remote proxy transaction via Polkadot-JS](https://blog.kchr.de/polkadot/guides/remote-proxies-for-the-braves/#sending-a-remote-proxy-transaction-via-polkadot-js){target=\_blank} section in the Remote Proxies article.
18329+
18330+
The code snippet above is a complete implementation example of a remote proxy transaction. It demonstrates how to:
18331+
18332+
- **Storage Key Generation**: The `proxyStorageKey` identifies where proxy relationship data is stored on Kusama. This key is used to create a proof that the relationship exists.
18333+
- **Block Synchronization**: Asset Hub maintains a mapping of recent Kusama block numbers to their storage roots to enable proof verification without requiring full blockchain synchronization.
18334+
- **Proof Creation**: The `getReadProof` RPC call generates a cryptographic proof that specific data exists in Kusama's state at a given block height.
18335+
- **Transaction Wrapping**: The target transaction is wrapped within a `remoteProxy` call that includes both the proof data and the block anchor.
18336+
18337+
## Resources
18338+
18339+
- **[Remote Proxies for Braves](https://blog.kchr.de/polkadot/guides/remote-proxies-for-the-braves){target=\_blank}**
18340+
- **[Ecosystem Proxy](https://blog.kchr.de/ecosystem-proxy/){target=\_blank}**
18341+
- **[RFC: Pure Proxy Replication](https://github.com/polkadot-fellows/RFCs/pull/111){target=\_blank}**
18342+
- **[Learn Proxies](https://wiki.polkadot.com/learn/learn-proxies/){target=\_blank}**
18343+
--- END CONTENT ---
18344+
1814418345
Doc-Content: https://docs.polkadot.com/develop/toolkit/parachains/rpc-calls/
1814518346
--- BEGIN CONTENT ---
1814618347
---

llms.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@
8989
- [Polkadot Omni Node](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/polkadot-omni-node.md): Run parachain nodes easily with the polkadot-omni-node, a white-labeled binary that can run parachain nodes using a single pre-built solution.
9090
- [Quickstart Parachain Development](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/quickstart/index.md): Bootstrap your development environment, scaffold template-based projects, deploy local networks, and simplify your workflow with tools for parachain developers.
9191
- [Quickstart Parachain Development with Pop CLI](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/quickstart/pop-cli.md): Quickly bootstrap parachain projects, scaffold templates, deploy local networks, and streamline development workflows using Pop CLI.
92+
- [Remote Proxies](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/remote-proxies.md): Remote proxies enable cross-chain proxy functionality within the Polkadot ecosystem, allowing proxy accounts defined on one chain to execute transactions on different chains through cryptographic storage proofs.
9293
- [RPC Calls to Polkadot SDK chains.](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/rpc-calls.md): Learn how to interact with Polkadot SDK-based chains using RPC calls. This guide covers essential methods and usage via curl.
9394
- [Spawn Networks for Testing](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/spawn-chains/index.md): Discover tools that enable you to spawn blockchains for testing, allowing for debugging, and validation of your blockchain setups in a controlled environment.
9495
- [Get Started](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/develop/toolkit/parachains/spawn-chains/zombienet/get-started.md): Quickly install and configure Zombienet to deploy and test Polkadot-based blockchain networks with this comprehensive getting-started guide.
@@ -200,4 +201,4 @@
200201
- [Create a dApp With Ethers.js](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/smart-contracts/launch-your-first-project/create-dapp-ethers-js.md): Learn how to build a decentralized application on Polkadot Hub using Ethers.js and Next.js by creating a simple dApp that interacts with a smart contract.
201202
- [Create a dApp With Viem](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/smart-contracts/launch-your-first-project/create-dapp-viem.md): Learn how to build a decentralized application on Polkadot Hub using Viem and Next.js by creating a simple dApp that interacts with a smart contract.
202203
- [Launch Your First Project](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/smart-contracts/launch-your-first-project/index.md): Follow a step-by-step guide to creating, deploying, and managing your first smart contract project on Polkadot, from coding to execution.
203-
- [Test and Deploy with Hardhat](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/smart-contracts/launch-your-first-project/test-and-deploy-with-hardhat.md): Learn how to set up a Hardhat development environment, write comprehensive tests for Solidity smart contracts, and deploy to local and Polkadot Hub networks.
204+
- [Test and Deploy with Hardhat](https://raw.githubusercontent.com/polkadot-developers/polkadot-docs/refs/heads/master/tutorials/smart-contracts/launch-your-first-project/test-and-deploy-with-hardhat.md): Learn how to set up a Hardhat development environment, write comprehensive tests for Solidity smart contracts, and deploy to local and Polkadot Hub networks.

0 commit comments

Comments
 (0)