Detailed Technical Flows

Detailed Technical Flows

Overview diagram

This is a C4 diagram (opens in a new tab) that describes an overview of the exchange during the swap process.

Swap C4 diagram

Although the provider's LiveApp is embedded inside Ledger Live, we describe it as running in a separate environment because it is sandboxed.

Detailled transaction flow

Explanations about each step below the diagram.

Swap transaction flow
  1. Ledger Live opens the provider's LiveApp through a deeplink. Example:

The quoteId sent is the one coming from a previous request to the /quote endpoint of the Provider's backend. This id is linked to the fromCurrency and toCurrency wanted by the user.

  1. The provider's LiveApp starts Ledger's swap process through a call to ExchangeSDK method call: swap.

  2. After asking the user to start the process, Ledger's Swap Service will call the Provider's backend to generate and sign the payload. The backend will also returns a swapId, for status tracking purpose.

  3. The Provider's backend will generate the payload with Ledger's currency id. This part is important as Ledger's device only knows Ledger's referential currency.

  4. The Provider's backend will sign the payload with its private key. The public part must be previously sent to Ledger and must use secp256k1 curve.

  5. As soon as the user signs the transaction within his Ledger's device, Ledger Live will broadcast the transaction.

  6. The transactionId is returned in the response of the swap method, called by the LiveApp.

  7. The LiveApp should call back Ledger Live with a deeplink. Example: ledgerlive://swap?status=COMPLETED&swapId=123

Display quote information to user

Quote information flow

Details on the quote API needed (opens in a new tab).

Check swap status flow

Check swap status flow
Copyright © Ledger SAS. All rights reserved. Ledger, Ledger Nano S, Ledger Vault, Bolos are registered trademarks of Ledger SAS