This guide covers the Arbitrum blockchain anchor client integration for TrustWeave. The Arbitrum adapter provides the largest L2 by TVL with EVM compatibility.
Overview
The chains/plugins/arbitrum module provides a complete implementation of TrustWeave’s BlockchainAnchorClient interface using Arbitrum One, the largest Ethereum L2 by TVL. This integration enables you to:
Anchor credential digests on Arbitrum with lower fees than Ethereum
Benefit from the largest L2 ecosystem by TVL
Use EVM-compatible transaction data storage
Leverage Ethereum security with L2 scalability
Installation
Add the Arbitrum adapter module to your dependencies:
1
2
3
4
5
6
7
8
9
dependencies{implementation("com.trustweave.chains:arbitrum:1.0.0-SNAPSHOT")implementation("com.trustweave:trustweave-anchor:1.0.0-SNAPSHOT")implementation("com.trustweave:trustweave-json:1.0.0-SNAPSHOT")implementation("com.trustweave:trustweave-core:1.0.0-SNAPSHOT")// Web3j for Arbitrum blockchain (EVM-compatible)implementation("org.web3j:core:5.0.1")}
Configuration
Basic Configuration
1
2
3
4
5
6
7
8
9
10
11
12
13
importcom.trustweave.anchor.*importcom.trustweave.arbitrum.*// Create Arbitrum anchor client for mainnetvaloptions=mapOf("rpcUrl"to"https://arb1.arbitrum.io/rpc","privateKey"to"0x..."// Optional: for signing transactions)valclient=ArbitrumBlockchainAnchorClient(ArbitrumBlockchainAnchorClient.MAINNET,options)
Pre-configured Networks
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// Arbitrum One mainnetvalmainnetClient=ArbitrumBlockchainAnchorClient(ArbitrumBlockchainAnchorClient.MAINNET,mapOf("rpcUrl"to"https://arb1.arbitrum.io/rpc","privateKey"to"0x..."))// Arbitrum Sepolia testnetvalsepoliaClient=ArbitrumBlockchainAnchorClient(ArbitrumBlockchainAnchorClient.ARBITRUM_SEPOLIA,mapOf("rpcUrl"to"https://sepolia-rollup.arbitrum.io/rpc","privateKey"to"0x..."))
SPI Auto-Discovery
When the module is on the classpath, Arbitrum adapter is automatically available:
importcom.trustweave.anchor.*importcom.trustweave.arbitrum.*importkotlinx.serialization.json.*valclient=ArbitrumBlockchainAnchorClient(ArbitrumBlockchainAnchorClient.ARBITRUM_SEPOLIA,mapOf("rpcUrl"to"https://sepolia-rollup.arbitrum.io/rpc","privateKey"to"0x..."))// Anchor a JSON payloadvalpayload=buildJsonObject{put("digest","uABC123...")put("timestamp",System.currentTimeMillis())}valresult=client.writePayload(payload,"application/json")println("Anchored to Arbitrum: ${result.ref.txHash}")
Chain IDs
Network
Chain ID
RPC URL
Arbitrum One Mainnet
eip155:42161
https://arb1.arbitrum.io/rpc
Arbitrum Sepolia Testnet
eip155:421614
https://sepolia-rollup.arbitrum.io/rpc
Advantages
Largest L2: Highest TVL among Ethereum L2s
Lower fees: Significantly cheaper than Ethereum mainnet
Fast confirmations: Optimistic rollup with fast finality
EVM compatible: Same tools and patterns as Ethereum