Part of #8 · Layer 2 (interop) · 🟢 P1 · Phase 3 (parallel, does NOT gate codec cutover)
What
Add @void-layer/interop TS package over the codec's decoded model (Hybrid C):
asCaip(invoice) → { chain: Caip2, account: Caip10, asset: Caip19 } View
fromCaip2() / fromCaip10() / fromCaip19() parsers
Core @void-layer/types stays raw (network_id + token_address) — CAIP is a projection, never a wire byte.
Why
- CAIP-19 natively resolves cross-chain token disambiguation (e.g. WETH same address on Base/Optimism) that the wire token-dict only approximates — the chain prefix does the work.
- CAIP-2 is
Final (frozen since 2021, zero breaking changes); projection-only binding is safe.
- Matches WalletConnect / MetaMask / SIWE which already speak CAIP.
Acceptance
wiki: concepts/caip-2-blockchain-id.md, concepts/caip-10-account-id.md, concepts/caip-19-asset-id.md, comparisons/caip-2-vs-dict-chain-encoding.md
Part of #8 · Layer 2 (interop) · 🟢 P1 · Phase 3 (parallel, does NOT gate codec cutover)
What
Add
@void-layer/interopTS package over the codec's decoded model (Hybrid C):asCaip(invoice) → { chain: Caip2, account: Caip10, asset: Caip19 }ViewfromCaip2() / fromCaip10() / fromCaip19()parsersCore
@void-layer/typesstays raw (network_id+token_address) — CAIP is a projection, never a wire byte.Why
Final(frozen since 2021, zero breaking changes); projection-only binding is safe.Acceptance
asCaip/fromCaip*implemented, parity-tested against decoded modelslip44) vs ERC-20 (erc20:) handled; cross-chain WETH verifiedraw → CAIP → rawis losslesswiki:
concepts/caip-2-blockchain-id.md,concepts/caip-10-account-id.md,concepts/caip-19-asset-id.md,comparisons/caip-2-vs-dict-chain-encoding.md