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 claim-vs-reclaim decision hinges on the script’s deadline, which each validating node evaluates against its own clock. Endorsers therefore agree on the verdict only insofar as their clocks agree, which makes clock synchronisation a deployment requirement and sets a lower bound on usable deadlines. See HTLC Deadlines and Clock Synchronisation.
Spending an HTLC-locked token is validated by each token driver’s transfer validator
(TransferHTLCValidate in token/core/fabtoken/v1/validator and
token/core/zkatdlog/nogh/v1/validator). Both drivers enforce the same rules, so an action
that is valid under one driver is valid under the other:
Claim and Reclaim helpers in token/services/interop/htlc, which each spend a
single unspent token.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.