Skip to content

LLC:intro

Alexandrine Boissiere edited this page Jul 9, 2024 · 5 revisions

Introduction, Goals and Tradeoffs

Before considering using a library or contributing to it, it's important to understand its goals and tradeoffs (or non-goals).

The entry to Ledger Live

Ledger Live Common is Ledger Live's business logic library.

Contributing to Ledger Live is actually likely going to happen in this library.

We can highlight this library have:

  • Currency models logic: Fiat and Crypto currencies data, icons and logic (formatters, parsers,...).
  • Account models logic: all helpers to display accounts and portfolio to the user.
  • Hardware Wallet logic for all interaction with our devices.
  • Manager logic including apps store logic and firmware updates.
  • CurrencyBridge and AccountBridge logic: All the logic needed for Add Accounts (scan accounts from Ledger devices), Receive flow (get account addresses), Send flow (blockchain transactions), and beyond... (specific currency feature are possible. Tezos staking is one example)

What remains on user land

This library does not have/is agnostic of:

  • The actual HW transport you use. But you can easily find one on ledgerjs libraries (or implement your own). There are many communication channel possible: webusb, webhid, webble, node-hid, react-native-hid, react-native bluetooth,...)

One library, multiple use cases

Ledger Live is one monolithic library that glues everything together, yet things are decoupled in a way that you can still use it for specific use cases without importing everything in the final bundle.

This works by having multiple entry points.

For instance, the Manager apps logic is imported from @ledgerhq/live-common/apps and the currencies logic is in @ledgerhq/live-common/currencies.

Modular coins support architecture

Ledger Live Common is designed to have very generic models (for currencies, accounts) but to also facilitate new coin integrations. More information in Coin Integration Introduction...

The tech stack

We use TypeScript.

This is purely an internal technology, the target module is a regular JavaScript package and @ledgerhq/live-common can totally be used in JS context.

Code convention

We use ESlint linter and Prettier code formatter.

Clone this wiki locally