Skip to content

Commit

Permalink
update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
MiKeF05 committed Jun 10, 2022
1 parent ead50d0 commit 238f555
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![license](https://img.shields.io/github/license/IOTA-Ledger/blue-app-iota.svg)](https://github.com/IOTA-Ledger/blue-app-iota/blob/master/LICENSE)


***It is strongly recommended to take a few minutes to read this document to make sure you fully understand how IOTA and the Ledger Hardware Wallet works, and how they interact together.***
***It is strongly recommended to take a few minutes to read this document. You need to make sure to fully understand how the Ledger hardware wallet works in combination with the IOTA network.***

## Table of contents

Expand All @@ -12,8 +12,8 @@
- [Introduction](#introduction)
- [Terminology](#terminology)
- [Address Reuse](#address-reuse)
- [IOTA Message](#iota-message)
- [Parts of an IOTA Message](#parts-of-an-iota-message)
- [IOTA Block](#iota-block)
- [Parts of an IOTA Block](#parts-of-an-iota-block)
- [How Ledger Hardware Wallets Work](#how-ledger-hardware-wallets-work)
- [IOTA Specific Considerations for Ledger Hardware Wallets](#iota-specific-considerations-for-ledger-hardware-wallets)
- [IOTA User-Facing App Functions](#iota-user-facing-app-functions)
Expand All @@ -24,86 +24,86 @@
- [FAQ](#faq)
- [I lost my ledger, what should I do now?](#i-lost-my-ledger-what-should-i-do-now)
- [Development](#development)
- [Prepare repository and submodules](#prepare-repository-and-submodules)
- [Prepare Repository and Submodules](#prepare-repository-and-submodules)
- [Using Docker](#using-docker)
- [Building the app](#building-the-app)
- [Running the Speculos simulator](#running-the-speculos-simulator)
- [Loading the IOTA Ledger app](#loading-the-iota-ledger-app)
- [Building the App](#building-the-app)
- [Running the Speculos Simulator](#running-the-speculos-simulator)
- [Loading the IOTA Ledger App](#loading-the-iota-ledger-app)
- [Specification](#specification)

---

## Introduction

IOTA is an unique cryptocurrency with specific design considerations that must be taken into account. This document will attempt to go over how the Ledger hardware wallet functions, and how to stay safe when using a Ledger to store IOTA.
IOTA is an unique cryptocurrency with specific design considerations that must be taken into account. This document explains how the Ledger hardware wallet works and how to stay safe when using a Ledger to store IOTA funds.

### Terminology

*Seed:* A single secret key from that all private keys are derived (aka "*24 words*", [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki)).
*Seed:* A single secret key from which all private keys are derived (aka "*24 words*", [BIP39](https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki)).

*Private Key:* Private keys are derived from the seed ([BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) with ED25519 curve, [SLIP10](https://github.com/satoshilabs/slips/blob/master/slip-0010.md). The private key is used to generate a public key. It is also used to prove you own said public key by means of creating a signature for a specific transaction.
*Private Key:* Private keys are derived from the seed ([BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki) with ED25519 curve, [SLIP10](https://github.com/satoshilabs/slips/blob/master/slip-0010.md). The private key is used to generate a public key. The private key is also used to prove that you own said public key by means of creating a signature for a specific transaction.

*Public Key:* The public part of a private/public key pair.

*Address:* A hashed representation of the public key that is used to send coins to.
*Address:* A hashed representation of the public key that is used to receive funds.

*Input:* The unspent transaction output (UTXO) from which coins are transfered.
*Input:* The unspent transaction output (UTXO) from which funds are transfered.

*Output:* The address to which coins are transfered.
*Output:* The address to which funds are transfered.

*Change/Remainder:* After sending funds to a 3rd party, all remaining funds on the account must be transferred to a new address - this is called the change or remainder address.

### Address Reuse

IOTA Chrysalis switched from quantum resistance signatures (Winternitz One-Time) to ED25519 signatures and from an account based model to an UTXO model. For this reason, address reuse no longer is problematic and IOTA is as secure as *other major crypto currencies*.
With the Chrysalis update IOTA switched from quantum resistance signatures (Winternitz One-Time) to ED25519 signatures and from an account based model to an UTXO model. For this reason, address reuse is no longer a problem and IOTA is as secure as *other major crypto currencies*.

### IOTA Message
### IOTA Block

A message mainly is just a group of inputs and outputs. So if Bob has 10Mi, and wants to send Alice 3Mi, the message could look like this:
A block is mainly just a group of inputs and outputs. If Bob has 10Mi and he wants to send 3Mi to Alice then the block could look like this:

**input:** Bob -10Mi

**output:** Alice +3Mi

**output:** Bob +7Mi (change output / remainder)

This example highlights how IOTA handles messages. First it takes an input of 10Mi from Bob's address. It sends 3 of it to Alice, and it puts the remaining 7Mi on a new address belonging to Bob's seed.
This example highlights how the IOTA network handles blocks. First an input of 10Mi from Bob's address is used. After this 3Mi are sent to Alice and the remaining funds are sent to a new address belonging to Bob's seed.

All inputs require the private key to generate signatures which prove that you are the owner of the funds.
All inputs require the private key to generate signatures which prove that you own the funds.

Because messages are *atomic units*, the network will never accept Bob's input of -10Mi without also accepting sending 3 to Alice, and 7 to a new address owned by Bob (in this example).
Because blocks are *atomic units*, the network will never accept Bob's input of -10Mi without accepting sending 3Mi to Alice and 7Mi to a new address owned by Bob (in this example). This new address where the remaining funds are sent to is called *remainder address.*

### Parts of an IOTA Message
### Parts of an IOTA Block

An IOTA message is broken up into 2 halves. The first half is generating a message and creating signatures for it.
An IOTA block is split into different parts. The first part is to create a block and signatures for this block.

The second half is selecting 2 other messages to confirm, and performing the proof of work.
The second part is to attach this block to the tangle. Therefore the block needs between one and eight tip messages which are requested from a node of the IOTA network.

The Ledger is **only** responsible for generating signatures for a specific message. After that the host machine (or anybody else for that matter), can take the signatures and broadcast it to the network (however the signatures are only valid for the specific message).
The Ledger hardware wallet is **only** responsible for generating signatures for a specific block. After that the host machine (or anybody else for that matter) can take the signatures and broadcast it to the network (however the signatures are only valid for the specific block).

## How Ledger Hardware Wallets Work

The Ledger Hardware Wallet works by deterministically generating IOTA keys based on your 24 word mnemonic (created when setting up the device).
The Ledger hardware wallet works by deterministically generating IOTA keys based on your 24 word mnemonic (created when setting up the device).

Instead of storing the seed on your computer (which could be stolen by an attacker), the seed is stored on the Ledger device, and is never broadcast to the host machine it is connected to.
Instead of storing the seed on your computer (which could be stolen by an attacker) the seed is **only** stored on the Ledger device itself. This ensures that the seed is never sent to the host machine it is connected to.

Instead, the host machine must ask the Ledger to provide the information (such as public keys or signatures). When creating messages, the host will generate an unsigned message and then send it to the Ledger device to be signed. The Ledger will then use the private keys associated with the inputs to generate unique signatures, and will then transfer **only the signatures** back to the host machine.
Instead the host machine needs to ask the Ledger device to provide the information (such as public keys or signatures). When blocks are created the host generates an unsigned block and sends it to the Ledger device for signing. The Ledger uses the private keys associated with the inputs to generate unique signatures and transmits **only the signatures** to the host machine.

The host can then use these signatures (which are only valid for that specific message) to broadcast the message to the network. However as you can see, neither the seed, nor any of the private keys ever leave the device.
The host is then able to use these signatures (which are only valid for that specific block) to broadcast the block to the network. However, as you can see, neither the seed nor any of the private keys ever leave the Ledger device.

See [Ledger's documentation](http://ledger.readthedocs.io) to get more info about the inner workings of the Ledger Hardware Wallets.
See [Ledger's documentation](https://developers.ledger.com/) to get more info about the inner workings of the Ledger hardware wallets.

## IOTA Specific Considerations for Ledger Hardware Wallets

### IOTA User-Facing App Functions

#### Functions

- *Display Address:* The wallet can ask the Ledger to display the address for a specific index on the seed. It **only** accepts the index, and subsequently generates the address itself and thus verifies that the address belongs to the Ledger.
- *Display Address:* The wallet is able to ask the Ledger device to display the address for a specific index of the seed. It **only** accepts the index and subsequently generates the address itself. It thus verifies that the address belongs to the corresponding Ledger.

*Note: Only the remainder address (shown as "Remainder") will be verified to belong to the Ledger. Outputs shown as "Send To" are not.*

- *Sign Transaction:* The wallet will generate a message for the user to approve before the Ledger signs it. **Ensure all amounts and addresses are correct before signing**. These signatures are then sent back to the host machine.
- *Sign Transaction:* The wallet will generate a block for the user to approve before the Ledger signs it. **Ensure all amounts and addresses are correct before signing**. These signatures are then sent back to the host machine.

#### Display

Expand All @@ -112,20 +112,20 @@ See [Ledger's documentation](http://ledger.readthedocs.io) to get more info abou

### IOTA Security Concerns Relating to Ledger Hardware Wallets

All warnings on the Ledger are there for a reason, **MAKE SURE TO READ THEM** and refer to this document if there is any confusion.
All warnings on the Ledger are there for a reason. **MAKE SURE TO READ THEM** and refer to this document if there is any confusion.

- **Don't rush through signing a message.**
Before a message is signed, all outputs of a message are shown on the display. The user can scroll through the individual outputs and finally choose whether to sign the message ("Accept") or not ("Reject").
- **Don't rush through signing a block.**
Before a block is signed all outputs of a block are shown on the display. The user can scroll through the individual outputs and finally choose whether to sign the block ("Accept") or not ("Reject").

Outputs that go to 3rd party addresses are shown on the display with "Send To". The address to which the rest is sent is shown as "Remainder".
Outputs that go to 3rd party addresses are shown on the display with "Send To". The address to which the rest is sent is shown as "remainder".

The Remainder also shows the BIP32 path in addition to the amount. This address is calculated on the ledger and ensures that the rest of the IOTAs are sent to an address owned by the Leder Nano.
In addition to the amount the remainder also shows the BIP32 path. This address is calculated on the Ledger and ensures that the rest of the IOTA funds are sent to an address owned by the Ledger device.

If the input amount perfectly matches the output amount, there will be no remainder. **If there is no remainder, double check that you are sending the proper amount to the proper address because there is no remainder being sent back to your seed.**
If the input amount perfectly matches the output amount then there will be no remainder. **If there is no remainder, double check that you are sending the proper amount to the proper address because there is no remainder being sent back to your seed.**

### Limitations of Ledger Hardware Wallets

Due to the memory limitations of the Ledger Nano S/X, the messages have certain restrictions. The Ledger Nano S can only accept messages with about 17 inputs/outputs (e.g. 4 inputs, 13 outputs). The Ledger Nano X can accept messages with about 180 inputs/outputs.
Due to the memory limitations of the Ledger Nano S/X, the blocks have certain restrictions. The Ledger Nano S can only accept blocks with about 17 inputs/outputs (e.g. 4 inputs, 13 outputs). The Ledger Nano X has the ability to accept blocks with approximately 180 inputs/outputs.

## FAQ

Expand All @@ -143,7 +143,7 @@ You either can
- run the app in a Ledger Nano S/X/S+ simulator or
- load the app on your read Ledger Nano S/S+

### Prepare repository and submodules
### Prepare Repository and Submodules

- Clone this repo
- Ensure that all git submodules are initialized
Expand All @@ -155,27 +155,27 @@ You either can

Using the `build.sh` script is highly recommended because it uses official Docker images for building the app and running the Speculos simulator.

#### Building the app
#### Building the App

```
./build.sh -m (nanos*|nanox|nanosplus)
```

#### Running the Speculos simulator
#### Running the Speculos Simulator

The app can be build by:
The app can be built by:
```
./build.sh -m (nanos*|nanox|nanosplus) -s
```

The simulator will open the port `9999` for APDU commands and provide a web-interface on port `5000`.

#### Loading the IOTA Ledger app
#### Loading the IOTA Ledger App

The app can be build and installed in the following way:
The app can be built and installed in the following way:

- Connect your Ledger to the PC and unlock it
- To load the app, be sure that the dashboard is opened in the Ledger
- Connect your Ledger to the computer and unlock it
- To load the app, be sure that the dashboard is opened on the Ledger
- Run the following command to compile the app from source and load it
```
./build.sh -m (nanos*|nanox|nanosplus) -l
Expand Down

0 comments on commit 238f555

Please sign in to comment.