DocumentationDevice interactionLedgerJS: Soon deprecatedExplanationArchitecture diagrams

Architecture diagrams

Application architecture

Architecture Overview

Ledger Live Prerequisites Fig. 1: Overall Architecture

On the client side we have your core application containing your business logic and workflows. You need to integrate at least the Device Management Kit or the LedgerJS Transport libraries in order to discuss with the Ledger device.

Some major networks have dedicated JS Library, like Bitcoin / Ethereum. You should use them if you are planning to integrate with these apps. This will provide a good abstraction level and allow you to use a proper SDK. You can see how to use them in Integration Walkthrough - Web USB/HID.

Nano API calls

This section describes what are the role of the Nano API. Indeed we call Nano API the “LedgerJS Dedicated App Lib” on the above image at the top of the page. You must have encontered few of the APIs if you have gone through the Integration Walkthrough. In the Walkthroughs, we have mostly used the Bitcoin and Ethereum API provided by Ledger.

The Nano API role is to help you to carry out operations in the “Embedded Apps” (rf. image at the top).

The APIs are not written in the same way for all Embedded apps. In addition, while some of them are provided by ledger, others are written by the various crypto communities.

You can have a look at how they are coded and documented at the LedgerHQ repository. You can also see the different Nano API provided by Ledger below.

Nano APIs provided by Ledger

Here is the list of all the APIs provided by Ledger.

BlockchainNano API
Algorandnpm @ledgerhq/hw-app-algorand
Bitcoinnpm @ledgerhq/hw-app-btc
Cosmosnpm @ledgerhq/hw-app-cosmos
Elrondnpm @ledgerhq/hw-app-elrond
Ethereumnpm @ledgerhq/hw-app-eth
Polkadotnpm @ledgerhq/hw-app-polkadot
Solananpm @ledgerhq/hw-app-solana
Stellarnpm @ledgerhq/hw-app-str
Tezosnpm @ledgerhq/hw-app-tezos
Tronnpm @ledgerhq/hw-app-trx
Ripplenpm @ledgerhq/hw-app-xrp

Nano APIs provided by the crypto-asset community

You may find these libraries on the GitHub repositories written by the community.

We currently do not have an updated list of all community-developed Nano APIs. If you wish to contribute yours, please use the comment box at the bottom of this page.

Here is the list of all the APIs from the community that you can find on npm.

BlockchainNano API
Vitenpm ledgerjs-hw-app-vite
Ergonpm ledgerjs-hw-app-ergo
Cardanonpm @cardano-foundation/ledgerjs-hw-app-cardano
Sianpm @siacentral/ledgerjs-sia

Nano API-less calls

When there is no available Nano API, the way to make your Nano calls is by constructing the ADPU call yourself, by using the syntax information found in each application documentation.

Here are some examples:

Blockchain AppApplication documentation
PolymathPolymath
FilecoinFilecoin

Dataflow architecture

Dataflow Overview

During a transaction handled by Ledger Device several exchanges are done between different application & hardware components. These exchanges allow to read data from Ledger Device & Sign Transactions with internal private key without sharing it.

Application Sequence Diagram Fig. 1: Application Sequence Diagram

This diagram demonstrate the sequence of different calls done by each application layer during a transaction. 5 different layers are used to handle a transaction:

  • Your Application Core Code: your software wallet
  • Ledger JS Transport API: packages that allow you to implement several kind communication between the software wallet and a Ledger hardware wallet
  • Ledger JS Dedicated App Lib: packages that allow you to communicate with specific Ledger Embedded Apps
  • Embedded App: the application that run on a Ledger hardware wallet to interact with a specific blockchain
  • Ledger Device Software: the operating system of Ledger harware devices

This workflow demonstrate a typical use case of Ledger Device using an Embedded App Lib. If you are planning to integrate with a embedded app with no API, you have to complete all actions done by LedgerJS Dedicated App Lib within your application core code.

Ledger
Copyright © Ledger SAS. All rights reserved. Ledger, Ledger Nano S, Ledger Vault, Ledger OS are registered trademarks of Ledger SAS