Skip to content

Commit 1d5ac5a

Browse files
authored
Merge pull request #51 from BrianSeong99/main
Agglayer SDK Documentation
2 parents 77e662c + 6469484 commit 1d5ac5a

File tree

31 files changed

+4180
-267
lines changed

31 files changed

+4180
-267
lines changed

docs/agglayer/core-concepts/aggkit/components/aggchain-proof-gen.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ title: AggchainProofGen
1515

1616
## Meet AggchainProofGen: The Security Expert
1717

18-
AggchainProofGen is the **advanced security component** for chains that need mathematical proof of their operations' validity. While basic chains can use simple signature-based verification, some chains require comprehensive **[state transition proofs](../../state-transition-proof/index.md)** that verify both internal chain operations and cross-chain bridge activities.
18+
AggchainProofGen is the **advanced security component** for chains that need mathematical proof of their operations' validity. While basic chains can use simple signature-based verification, some chains require comprehensive **[state transition proofs](/agglayer/core-concepts/state-transition-proof/)** that verify both internal chain operations and cross-chain bridge activities.
1919

2020
**Core Function**: AggchainProofGen generates sophisticated cryptographic proofs that demonstrate a chain's operations are mathematically valid and comply with all bridge security constraints. These proofs enable Agglayer's advanced dual proof system introduced in v0.3.
2121

docs/agglayer/core-concepts/aggkit/components/aggoracle.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ v0.3.5 introduces **multi-party consensus** where multiple independent AggOracle
118118

119119
### What is a Global Exit Root?
120120

121-
A [Global Exit Root (GER)](../../unified-bridge/data-structures.md#global-exit-root) is a **cryptographic hash** that represents the current state of all cross-chain bridge activities across the entire Agglayer ecosystem. It's computed as:
121+
A [Global Exit Root (GER)](/agglayer/core-concepts/unified-bridge/data-structures/#global-exit-root) is a **cryptographic hash** that represents the current state of all cross-chain bridge activities across the entire Agglayer ecosystem. It's computed as:
122122

123123
```
124124
GER = hash(RollupExitRoot, MainnetExitRoot)

docs/agglayer/core-concepts/aggkit/components/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ These two components extend AggKit's capabilities beyond basic synchronization,
128128

129129
### AggchainProofGen: The Security Expert
130130

131-
**What it really does**: AggchainProofGen is the **security expert** of the AggKit team. While basic chains can use simple signature-based verification, some chains need [**state transition proof**](../../state-transition-proof/index.md) that their operations are valid. AggchainProofGen generates these advanced cryptographic proofs.
131+
**What it really does**: AggchainProofGen is the **security expert** of the AggKit team. While basic chains can use simple signature-based verification, some chains need [**state transition proof**](/agglayer/core-concepts/state-transition-proof/) that their operations are valid. AggchainProofGen generates these advanced cryptographic proofs.
132132

133133
**When you need the expert**: If your chain handles high-value transactions, operates in a regulatory environment, or wants the highest possible security guarantees, you'll want AggchainProofGen. It's like having a security specialist who can provide mathematical certainty about your chain's operations.
134134

docs/agglayer/core-concepts/pessimistic-proof/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Agglayer assumes every prover can be unsound. The pessimistic proof guarantees t
5656

5757
The pessimistic proof mechanism implements a safety boundary between chains - it ensures that even if a chain's prover becomes compromised or unsound, the damage is strictly limited to the funds currently deposited on that specific chain.
5858

59-
![Pessimistic Proof Flow](../../img/agglayer/PessimisticProofFlow.png)
59+
![Pessimistic Proof Flow](../../../img/agglayer/PessimisticProofFlow.png)
6060

6161
**Security Model:**
6262

docs/agglayer/core-concepts/state-transition-proof/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ State Transition Proof is a comprehensive trust validation process that ensures
3232
- **Internal Chain Validation**: State transition verification within individual chains
3333
- **Cross-Chain Validation**: Bridge operation verification between chains (Aggchain Proof + Pessimistic Proof)
3434

35-
![State Transition Proof Flow](../../img/agglayer/v03Flow.png)
35+
![State Transition Proof Flow](../../../img/agglayer/v03Flow.png)
3636

3737
*Figure 1: High-level overview of the v0.3 dual proof system*
3838

docs/agglayer/core-concepts/unified-bridge/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The Unified Bridge is the core interoperability layer that enables seamless cros
3333

3434
The Unified Bridge uses a sophisticated Merkle tree structure to securely track and verify all cross-chain transactions:
3535

36-
![Unified Bridge Data Structure](../../img/agglayer/UnifiedBridgeTree.png)
36+
![Unified Bridge Data Structure](../../../img/agglayer/UnifiedBridgeTree.png)
3737

3838
**Security Model:**
3939

Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
---
2+
title: Agglayer Native Bridge
3+
---
4+
5+
<!-- Page Header Component -->
6+
<h1 style="text-align: left; font-size: 38px; font-weight: 700; font-family: 'Inter Tight', sans-serif;">
7+
Agglayer Native Bridge
8+
</h1>
9+
10+
<div style="text-align: left; margin: 0.5rem 0;">
11+
<p style="font-size: 18px; color: #666; max-width: 600px; margin: 0;">
12+
Direct blockchain operations with Agglayer bridge contracts for maximum control and flexibility
13+
</p>
14+
</div>
15+
16+
## Overview
17+
18+
Agglayer Native Bridge is the SDK's **Native module** that provides direct interaction with Agglayer bridge contracts and blockchain networks. Unlike Multi-Bridge Routes which uses ARC API for route aggregation, Native Bridge gives you complete control over bridge operations, ERC20 token management, and chain configurations across local, testnet, and mainnet environments.
19+
20+
## Core Features
21+
22+
<div style="display: flex; flex-direction: column; gap: 1rem; max-width: 800px; margin: 1rem 0;">
23+
24+
<!-- ERC20 Operations Card -->
25+
<div style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 1rem 1rem; margin: 0.25rem 0;">
26+
<h3 style="color: #0071F7; margin: 0 0 0.5rem 0; font-size: 18px; font-weight: 600;">
27+
ERC20 Operations
28+
</h3>
29+
<p style="color: #666; margin-bottom: 0.75rem; line-height: 1.4; font-size: 14px;">
30+
Complete ERC20 token management including balance checks, approvals, transfers, and direct bridge operations with built-in gas estimation.
31+
</p>
32+
<a href="/agglayer/developer-tools/agglayer-sdk/agglayer-native-bridge/operations/erc20-operations/" style="color: #0071F7; text-decoration: none; font-weight: 500; font-size: 14px;">
33+
Learn more →
34+
</a>
35+
</div>
36+
37+
<!-- Bridge Operations Card -->
38+
<div style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 1rem 1rem; margin: 0.25rem 0;">
39+
<h3 style="color: #0071F7; margin: 0 0 0.5rem 0; font-size: 18px; font-weight: 600;">
40+
Bridge Operations
41+
</h3>
42+
<p style="color: #666; margin-bottom: 0.75rem; line-height: 1.4; font-size: 14px;">
43+
Direct bridge contract interactions including asset bridging, message bridging, claim operations, and proof generation.
44+
</p>
45+
<a href="/agglayer/developer-tools/agglayer-sdk/agglayer-native-bridge/operations/bridge-operations/" style="color: #0071F7; text-decoration: none; font-weight: 500; font-size: 14px;">
46+
Learn more →
47+
</a>
48+
</div>
49+
50+
<!-- Chain Management Card -->
51+
<div style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 1rem 1rem; margin: 0.25rem 0;">
52+
<h3 style="color: #0071F7; margin: 0 0 0.5rem 0; font-size: 18px; font-weight: 600;">
53+
Chain Management
54+
</h3>
55+
<p style="color: #666; margin-bottom: 0.75rem; line-height: 1.4; font-size: 14px;">
56+
Built-in chain registry with support for custom networks, RPC configuration, and multi-environment setups (local, testnet, mainnet).
57+
</p>
58+
<a href="/agglayer/developer-tools/agglayer-sdk/agglayer-native-bridge/operations/chain-management/" style="color: #0071F7; text-decoration: none; font-weight: 500; font-size: 14px;">
59+
Learn more →
60+
</a>
61+
</div>
62+
63+
</div>
64+
65+
## Complete Guides
66+
67+
<div style="display: flex; flex-direction: column; gap: 1rem; max-width: 800px; margin: 1rem 0;">
68+
69+
<!-- Local Testing Card -->
70+
<div style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 1rem 1rem; margin: 0.25rem 0;">
71+
<h3 style="color: #0071F7; margin: 0 0 0.5rem 0; font-size: 18px; font-weight: 600;">
72+
Local Testing with AggSandbox
73+
</h3>
74+
<p style="color: #666; margin-bottom: 0.75rem; line-height: 1.4; font-size: 14px;">
75+
Complete guide for local development using AggSandbox. Perfect for rapid prototyping with instant feedback and comprehensive debugging.
76+
</p>
77+
<a href="/agglayer/developer-tools/agglayer-sdk/agglayer-native-bridge/step-by-step-guide/native-bridge-locally/" style="color: #0071F7; text-decoration: none; font-weight: 500; font-size: 14px;">
78+
Start locally →
79+
</a>
80+
</div>
81+
82+
<!-- Testnet Testing Card -->
83+
<div style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 1rem 1rem; margin: 0.25rem 0;">
84+
<h3 style="color: #0071F7; margin: 0 0 0.5rem 0; font-size: 18px; font-weight: 600;">
85+
Testnet Development
86+
</h3>
87+
<p style="color: #666; margin-bottom: 0.75rem; line-height: 1.4; font-size: 14px;">
88+
Step-by-step guide for testnet development using Sepolia and other test networks. Validate your integration with real network conditions.
89+
</p>
90+
<a href="/agglayer/developer-tools/agglayer-sdk/agglayer-native-bridge/step-by-step-guide/native-bridge-testnet/" style="color: #0071F7; text-decoration: none; font-weight: 500; font-size: 14px;">
91+
Test on testnet →
92+
</a>
93+
</div>
94+
95+
<!-- Production Deployment Card -->
96+
<div style="background: #f8f9fa; border: 1px solid #dee2e6; border-radius: 6px; padding: 1rem 1rem; margin: 0.25rem 0;">
97+
<h3 style="color: #0071F7; margin: 0 0 0.5rem 0; font-size: 18px; font-weight: 600;">
98+
Production Deployment
99+
</h3>
100+
<p style="color: #666; margin-bottom: 0.75rem; line-height: 1.4; font-size: 14px;">
101+
Production-ready implementation with mainnet configuration, error handling, monitoring, and security best practices.
102+
</p>
103+
<a href="/agglayer/developer-tools/agglayer-sdk/agglayer-native-bridge/step-by-step-guide/native-bridge-mainnet/" style="color: #0071F7; text-decoration: none; font-weight: 500; font-size: 14px;">
104+
Deploy to mainnet →
105+
</a>
106+
</div>
107+
108+
</div>
109+
110+
## When to Use Native Bridge
111+
112+
Choose Native Bridge when you need direct control over bridge operations, local testing capabilities with AggSandbox, or custom bridge logic beyond standard route aggregation. It's ideal for advanced integrations with custom business logic and testnet development workflows.
113+
114+
Consider [Multi-Bridge Routes](/agglayer/developer-tools/agglayer-sdk/multi-bridge-routes/) for route optimization across multiple providers and cross-chain bridging from non-Agglayer chains.
115+
116+
## Quick Example
117+
118+
Here's how simple it is to perform direct bridge operations with Native Bridge:
119+
120+
```typescript
121+
import { AggLayerSDK, SDK_MODES } from '@agglayer/sdk';
122+
123+
// Initialize for local testing
124+
const sdk = new AggLayerSDK({
125+
mode: [SDK_MODES.NATIVE],
126+
native: {
127+
defaultNetwork: 1,
128+
customRpcUrls: {
129+
1: 'http://localhost:8545', // AggSandbox L1
130+
1101: 'http://localhost:8546', // AggSandbox L2
131+
},
132+
},
133+
});
134+
135+
const native = sdk.getNative();
136+
137+
// Create token instance and bridge directly
138+
const token = native.erc20('0xTokenAddress', 1);
139+
const bridgeTx = await token.bridgeTo(
140+
1101, // Destination network
141+
'0xRecipientAddress',
142+
'1000000000000000000', // 1 token
143+
'0xFromAddress'
144+
);
145+
146+
// Transaction ready for signing and execution
147+
console.log('Bridge transaction built:', bridgeTx.to);
148+
```

0 commit comments

Comments
 (0)