The Interoperability (Interop) Service (token/services/interop) enables cross-chain and cross-network token operations within Panurus. Its primary focus is on implementing secure value exchange mechanisms like Atomic Swaps through Hashed Timelock Contracts (HTLCs).
The Interop Service is responsible for:
The service implements a standardized HTLC lifecycle to ensure secure, trustless exchanges.
sequenceDiagram
autonumber
participant Alice as Party A<br/>(Network A)
participant Bob as Party B<br/>(Network B)
box darkgreen Panurus Stack
participant Alice
participant Bob
end
Note over Alice: 1. Generate Preimage & Lock (A)
Alice->>+Alice: Generate random preimage 'S' and hash 'H = hash(S)'
Alice->>+Alice: Create HTLC(H, timeout, Bob's Identity)
Alice->>+Alice: Broadcast Lock Transaction on Network A
Note over Bob: 2. Lock (B)
Bob->>+Bob: Wait for Network A Transaction
Bob->>+Bob: Create HTLC(H, timeout/2, Alice's Identity)
Bob->>+Bob: Broadcast Lock Transaction on Network B
Note over Alice: 3. Release (B)
Alice->>+Alice: Reveal 'S' to release tokens on Network B
Alice->>+Bob: (Publicly revealed on Ledger B)
Note over Bob: 4. Release (A)
Bob->>+Bob: Use 'S' from Ledger B to release tokens on Network A
The service provides the htlc sub-package, which includes:
The Interop Service coordinates with the Network Service across multiple DLT instances. It monitors the finality of “Lock” transactions on one network before initiating corresponding “Lock” transactions on another, ensuring that the atomic swap protocol can proceed safely.
The service integrates with the Identity Service to handle specialized interop identities that can be used to generate and verify HTLC-based proofs of ownership.