Ledger® Developer Portal

Ledger® Wallet – Getting Started™

Everything you need to integrate Ledger hardware wallet support into your app: SDKs, secure signing flows, recommended UX patterns, and a safe in-page simulator to prototype without secrets.

Overview for developers

Ledger hardware wallets protect private keys inside a secure element and expose a small, auditable surface for signing operations. As a developer, you interact with the device through official SDKs and connectors (WebHID, WebUSB, and native bridges). Your app should prepare unsigned payloads, request signatures, and always require on-device user confirmation for the final approval step.

Quickstart (conceptual)

  1. Choose the right integration: web (WebHID/WebUSB) for browser apps, or native SDKs for desktop/mobile.
  2. Use the Ledger SDK or lightweight transport libraries to enumerate and connect to a device.
  3. Prepare a canonical transaction or message payload off-device.
  4. Send the payload to the device and prompt the user to confirm the exact details shown on the device screen.
  5. Receive the signed response and broadcast or process it server-side as required.

Code example (mock)

Below is a safe, non-networking mock of the expected flow — it demonstrates the pattern without accessing hardware or secrets. Replace the mock calls with official Ledger transport/SDK calls in production.

// Mock Ledger flow (educational only)
async function mockLedgerFlow(payload) {
  console.log('Preparing payload:', payload);
  // In real code, use @ledgerhq/hw-transport-webusb or hw-transport-node-hid
  // to open a connection to the Ledger device and the appropriate app (e.g. BTC, ETH).
  await fakeDelay(600);
  // Device would display human-readable details for user confirmation
  const userConfirmed = confirm('Device shows: send 0.01 BTC to 1A2b... Approve?');
  if (!userConfirmed) throw new Error('User rejected on device (simulated)');
  await fakeDelay(600);
  // The device returns a signature; here we return a mock signature
  return { signature: 'MOCK_SIGNATURE_abc123', payloadHash: hash(payload) };
}
          

Security & UX guidelines

  • Never request or log recovery phrases. Ledger will never ask for them.
  • Show human-readable transaction summaries in your UI, but require the user to confirm on-device.
  • Validate origins and enforce HTTPS. Avoid mixed-content or iframes that can obscure context.
  • Minimize permissions and provide clear fallback flows for unsupported browsers or transports.

Recommended libraries & tools

Use the official Ledger libraries for your platform: transport layer packages (WebUSB/WebHID/HID), app-specific APDUs, and the Ledger Live integration guides. For production apps, always pin to vetted package versions and verify package signatures or checksums.

Testing & CI

Automated testing should mock signing operations and simulate user acceptance/rejection. For integration tests that touch real devices, use isolated environments and never store actual recovery material in CI artifacts.

Documentation & support

Complete API references, sample projects, and device specifications are provided in the official developer docs. When in doubt, consult the SDK docs and reach out to official developer support channels — never share private keys or recovery words in public forums.

Simulator (safe demo)

Practice the developer flow without connecting a device. This emulator returns mock signatures so you can build-and-test UI flows.


Output will appear here (mock).