一键导入
hyperlane-utils
Helper skill for using Hyperlane CLI address conversion utilities (addressToBytes32 and bytes32ToAddress) for cross-chain message formatting
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Helper skill for using Hyperlane CLI address conversion utilities (addressToBytes32 and bytes32ToAddress) for cross-chain message formatting
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Update standing fee quotes for the CROSS/moonpay warp route. Use when asked to set, update, or change fees/bps for specific chains, tokens, or directions in the MoonPay route. Also use when asked to show or read current standing quotes.
Encode and decode raw Hyperlane messages to/from packed hex bytes using the CLI. Use when you need to construct a message for testing, inspect a raw message from logs or a transaction, or decode a warp transfer body.
A skill that allows a user to validate that a warp route deployment will be in the expected state after applying some configuration
Simulate pending Safe (multisig) governance txs for a warp route by replaying the literal calldata onto anvil forks, self-relaying any ICA messages, then running warp check against the desired registry config. Use to verify that a not-yet-signed Safe batch produces the intended warp route config before signing.
Add a new chain to an existing warp route owned by a customer. Reads a Linear ticket, adds the new chain to the deploy.yaml, builds a customer-specific strategy file for existing chains, runs warp apply, and outputs transaction files for the customer to sign via their multisig.
Review code changes using Hyperlane monorepo coding standards. Use when reviewing PRs, checking your own changes, or doing self-review before committing.
| name | hyperlane-utils |
| description | Helper skill for using Hyperlane CLI address conversion utilities (addressToBytes32 and bytes32ToAddress) for cross-chain message formatting |
You are a specialized agent for helping users convert addresses to/from bytes32 format using the Hyperlane CLI utils commands.
Hyperlane uses bytes32 format for addresses in cross-chain messages to support multiple blockchain protocols. Each protocol has different native address formats, but they all convert to/from 32-byte representations for interchain messaging.
Hyperlane CLI: Ensure the CLI is available
# Check if installed
command -v hyperlane >/dev/null 2>&1 || npm install -g @hyperlane-xyz/cli
# Or use from monorepo
cd typescript/cli && pnpm hyperlane
| Protocol | Native Address Format | Bytes32 Padding |
|---|---|---|
ethereum | 20-byte (0x...) | 12 zero bytes at start |
tron | Base58 (T...) or hex | 12 zero bytes at start |
cosmos | Bech32 (cosmos1...) | 12 zero bytes at start |
cosmosnative | Bech32 or hex | 12 zero bytes at start |
sealevel | Base58 (Solana) | 32 bytes (no padding) |
starknet | Hex (0x...) | Variable |
radix | Bech32m (account_...) | Variable |
aleo | Bech32m (aleo1...) | Variable |
Convert a protocol-specific address to bytes32 format.
Syntax:
hyperlane address to-bytes32 --address <address> [--protocol <protocol>]
Parameters:
--address - The address to convert (required)--protocol - Protocol type (optional - auto-detected for most formats)Examples:
# EVM address (auto-detected)
hyperlane address to-bytes32 --address 0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266
# Solana address
hyperlane address to-bytes32 --address EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v --protocol sealevel
# Cosmos address
hyperlane address to-bytes32 --address cosmos1wxeyh7zgn4tctjzs0vtqpc6p5cxq5t2muzl7ng --protocol cosmos
# CosmosNative with explicit protocol
hyperlane address to-bytes32 --address hyp1wj9q2x06carugtqaeafhjxcazhwcv96hvselyh --protocol cosmosnative
Convert bytes32 format back to a protocol-specific address.
Syntax:
hyperlane address from-bytes32 --bytes32 <bytes32> --protocol <protocol> [--prefix <prefix>]
Parameters:
--bytes32 - The 32-byte hex string (with or without 0x prefix) (required)--protocol - Target protocol type (required)--prefix - Address prefix (required for Cosmos and Radix chains)Examples:
# Convert to EVM address
hyperlane address from-bytes32 --bytes32 0x000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266 --protocol ethereum
# Convert to Solana address
hyperlane address from-bytes32 --bytes32 0xc6fa7af3bedbad3a3d65f36aabc97431b1bbe4c2d2f6e0e47ca60203452f5d61 --protocol sealevel
# Convert to Cosmos address (prefix required)
hyperlane address from-bytes32 --bytes32 0x000000000000000000000000748a0519fac747c42c1dcf53791b1d15dd861757 --protocol cosmos --prefix cosmos
# Convert to CosmosNative with custom prefix
hyperlane address from-bytes32 --bytes32 0x000000000000000000000000748a0519fac747c42c1dcf53791b1d15dd861757 --protocol cosmosnative --prefix hyp
# Convert to Osmosis address
hyperlane address from-bytes32 --bytes32 0x000000000000000000000071b24bf8489d5785c8507b1600e341a60c0a2d5b --protocol cosmos --prefix osmo
| Chain | Prefix |
|---|---|
| Cosmos | cosmos |
| Osmosis | osmo |
| Neutron | neutron |
| Injective | inj |
| Celestia | celestia |
| Stargaze | stars |
| Juno | juno |
These protocols use 20-byte addresses that MUST have 12 zero bytes (24 hex characters) of padding at the start:
Format: 0x + 24 zeros + 40 hex chars (20 bytes)
Example: 0x000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266
^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12 zero bytes (padding) 20 bytes (actual address)
The CLI will validate this and show a clear error if padding is incorrect:
Error: Ethereum (EVM) addresses are 20 bytes and must have 12 zero bytes (24 hex characters) of padding at the start.
Your input has only 2 zero bytes at the start.
Expected format: 0x000000000000000000000000<20-byte-address>
Your input: 0x0000f39fd6e51aad88f6f4ce6ab8827279cfffb9226600000000000000000000
These use the full 32 bytes with no padding requirements.
When constructing a warp transfer to a non-EVM chain:
# Convert recipient address to bytes32 for message encoding
hyperlane address to-bytes32 --address cosmos1wxeyh7zgn4tctjzs0vtqpc6p5cxq5t2muzl7ng --protocol cosmos
When analyzing a cross-chain message:
# Extract bytes32 recipient from message and decode
hyperlane address from-bytes32 --bytes32 0x00000000000000000000000071b24bf8489d5785c8507b1600e341a60c0a2d5b --protocol cosmos --prefix cosmos
Ensure address encoding is correct:
# Original address
ADDR="hyp1wj9q2x06carugtqaeafhjxcazhwcv96hvselyh"
# Convert to bytes32
BYTES32=$(hyperlane address to-bytes32 --address $ADDR --protocol cosmosnative | grep "Bytes32:" | awk '{print $2}')
# Convert back and verify
hyperlane address from-bytes32 --bytes32 $BYTES32 --protocol cosmosnative --prefix hyp
When debugging cross-chain transfers:
# From message logs, extract sender and recipient bytes32
SENDER_BYTES32="0x000000000000000000000000f39fd6e51aad88f6f4ce6ab8827279cfffb92266"
RECIPIENT_BYTES32="0x000000000000000000000000748a0519fac747c42c1dcf53791b1d15dd861757"
# Decode both
echo "Sender (EVM):"
hyperlane address from-bytes32 --bytes32 $SENDER_BYTES32 --protocol ethereum
echo "Recipient (Cosmos):"
hyperlane address from-bytes32 --bytes32 $RECIPIENT_BYTES32 --protocol cosmosnative --prefix hyp
Cause: Invalid or unrecognized address format for the specified protocol.
Solutions:
cosmos vs cosmosnative)Cause: Missing prefix parameter for Cosmos/Radix chains.
Solution: Add the appropriate prefix:
# Wrong
hyperlane address from-bytes32 --bytes32 0x... --protocol cosmos
# Correct
hyperlane address from-bytes32 --bytes32 0x... --protocol cosmos --prefix osmo
Cause: Incorrectly padded bytes32 for 20-byte address protocols.
Solutions:
addressToBytes32 to generate correctly padded bytes32If you get padding errors but believe the address is valid:
Check if it's a Cosmos account address or module ID:
Verify the protocol:
# Try both cosmos and cosmosnative
hyperlane address from-bytes32 --bytes32 <bytes32> --protocol cosmos --prefix <prefix>
hyperlane address from-bytes32 --bytes32 <bytes32> --protocol cosmosnative --prefix <prefix>
When a user asks for help with address conversions:
Identify the use case: Are they encoding for a message, decoding from logs, or verifying?
Determine the protocols involved: Ask for source and destination chains if not clear
Check address format: Validate the input address looks correct for the protocol
Provide the correct command: Use the examples above as templates
Verify the result: For critical operations, suggest round-trip verification
Handle errors: If the CLI returns an error, interpret it and suggest fixes
User: "I need to send a warp transfer from Ethereum to Neutron. The recipient is neutron1wxeyh7zgn4tctjzs0vtqpc6p5cxq5t2m7khwyl"
Your Response:
# Convert the Neutron address to bytes32 format
hyperlane address to-bytes32 --address neutron1wxeyh7zgn4tctjzs0vtqpc6p5cxq5t2m7khwyl --protocol cosmos
# This will give you the bytes32 representation to use in your warp transfer message
# Expected output format: 0x000000000000000000000000<20-byte-address>
User: "I see bytes32 0x00000000000000000000000071b24bf8489d5785c8507b1600e341a60c0a2d5b in the message logs. What Cosmos address is this?"
Your Response:
# Since you don't have a specific prefix, let's try common Cosmos chains
# For Cosmos Hub:
hyperlane address from-bytes32 --bytes32 0x00000000000000000000000071b24bf8489d5785c8507b1600e341a60c0a2d5b --protocol cosmos --prefix cosmos
# For Osmosis:
hyperlane address from-bytes32 --bytes32 0x00000000000000000000000071b24bf8489d5785c8507b1600e341a60c0a2d5b --protocol cosmos --prefix osmo
# For Neutron:
hyperlane address from-bytes32 --bytes32 0x00000000000000000000000071b24bf8489d5785c8507b1600e341a60c0a2d5b --protocol cosmos --prefix neutron
# EVM → bytes32
hyperlane address to-bytes32 --address 0x<address>
# Cosmos → bytes32
hyperlane address to-bytes32 --address <bech32-address> --protocol cosmos
# Solana → bytes32
hyperlane address to-bytes32 --address <base58-address> --protocol sealevel
# bytes32 → EVM
hyperlane address from-bytes32 --bytes32 0x<bytes32> --protocol ethereum
# bytes32 → Cosmos (specify prefix!)
hyperlane address from-bytes32 --bytes32 0x<bytes32> --protocol cosmos --prefix <prefix>
# bytes32 → Solana
hyperlane address from-bytes32 --bytes32 0x<bytes32> --protocol sealevel
cosmos for CosmWasm, cosmosnative for native modules