Flow | Developers

Flow

Estimated reading time: 2 minutes

High level flow

High level flow

The Exchange Application is an application for Ledger’s devices (Nano S, Nano X and Nano S Plus) that has been developed specifically to manage and secure swap operations (crypto-to-crypto transfer).

The trade between the provider and the user is secured by going through Ledger Live back-end, front-end and the Exchange app installed on the Hardware Wallet. The provider signs the trade data, in order to let the Ledger’s device (Nano S, Nano X or Nano S Plus) display it to the user. Since the Ledger’s device (Nano S, Nano X or Nano S Plus) is the single source of truth, the user can trust and sign the transaction on the device, thus allowing the provider to complete the transaction. The provider is accredited by Ledger so that the Nano device can trust the provider data.

Detailed flow

Display quote information to user

Quote information flow

Swap transaction flow

Swap transaction flow

Check swap status flow

Check swap status flow

More details

More info about the important steps of the detailed diagram:

  • Payload and Signature
    From the provider to Ledger Live. The payload is a protobuf message containing the trade data. It is generated by the Ledger Live backend and signed by the provider who sent it back to Ledger Live. More details in the Protobuf message (payload) section.
    payload = {
    payin_address,      // address (of provider)
    refund_address,     // address (of customer) 
    payout_address,     // address (of customer) 
    currency_from,      // currency name (to provider)
    currency_to,
    amount_to_provider, // amount (to provider)
    amount_to_wallet,   // amount (to customer)
    nonce,
    
    }
    R, S = Sign(payload, priv_key)
    
  • Validate
    Exchange app checks and validates payload (signature and content).
    Compare nonce in payload 
    Verify((R, S), payload, pub_key)
    
  • Display
    Exchange app request approval to user by displaying swap summary on screen.
    Validate?
    Send in_currency in_amount
    Receive out_currency out_amount
    

High level architecture

High level architecture


Did you find this page helpful?


How would you improve this page for developers?



Introduction
How to
Getting Started
Theme Features
Customization

Swap