• This repository has been archived on 16/Apr/2019
  • Stars
    star
    318
  • Rank 131,872 (Top 3 %)
  • Language
    C
  • License
    GNU Lesser Genera...
  • Created about 12 years ago
  • Updated over 5 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

🔒 Don't use this repo, use the new monorepo instead:

TREZOR One Bootloader and Firmware

Build Status gitter

https://trezor.io/

How to build the TREZOR bootloader, firmware and emulator

Ensure that you have Docker installed. You can follow Docker's installation instructions.

Clone this repository:

git clone https://github.com/trezor/trezor-mcu.git`
cd trezor-mcu

Use the build.sh command to build the images.

  • to build bootloader 1.6.0 and firmware 1.7.0:
    ./build.sh bl1.6.0 v1.7.0
  • to build latest firmware from master:
    ./build.sh
  • to build the emulator from master:
    ./build.sh EMU
  • to build the emulator for version 1.7.0:
    ./build.sh EMU v1.7.0

Build results are stored in the build/ directory. File bootloader-<tag>.bin represents the bootloader, trezor-<tag>.bin is the firmware image, and trezor-emulator-<tag>.elf is the emulator executable.

You can use TREZOR_OLED_SCALE environment variable to make emulator screen bigger.

How to get fingerprint of firmware signed and distributed by SatoshiLabs?

  1. Pick version of firmware binary listed on https://wallet.trezor.io/data/firmware/1/releases.json
  2. Download it: wget -O trezor.signed.bin https://wallet.trezor.io/data/firmware/1/trezor-1.6.1.bin
  3. Compute fingerprint: tail -c +257 trezor.signed.bin | sha256sum

Step 3 should produce the same sha256 fingerprint like your local build (for the same version tag). Firmware has a special header (of length 256 bytes) holding signatures themselves, which must be avoided while calculating the fingerprint, that's why tail command has to be used.

How to install custom built firmware?

WARNING: This will erase the recovery seed stored on the device! You should never do this on TREZOR that contains coins!

  1. Install python-trezor: pip install trezor (more info)
  2. trezorctl firmware_update -f build/trezor-TAG.bin

Building for development

If you want to build device firmware, make sure you have the GNU ARM Embedded toolchain installed. You will also need Python 3.5 or later and pipenv.

  • If you want to build the emulator instead of the firmware, run export EMULATOR=1 TREZOR_TRANSPORT_V1=1
  • If you want to build with the debug link, run export DEBUG_LINK=1. Use this if you want to run the device tests.
  • When you change these variables, use script/setup to clean the repository
  1. To initialize the repository, run script/setup
  2. To initialize a Python environment, run pipenv install
  3. To build the firmware or emulator, run pipenv run script/cibuild

If you are building device firmware, the firmware will be in firmware/trezor.bin.

You can launch the emulator using firmware/trezor.elf. To use trezorctl with the emulator, use trezorctl -p udp (for example, trezorctl -p udp get_features).

More Repositories

1

trezor-firmware

🔒 Trezor Firmware Monorepo
C
1,286
star
2

python-mnemonic

🐍 Mnemonic code for generating deterministic keys, BIP39
Python
762
star
3

trezor-suite

🍬 Trezor Suite Monorepo
TypeScript
619
star
4

blockbook

📘 Trezor address/account balance backend
Go
585
star
5

trezor-crypto

🔒 Don't use this repo, use the new monorepo instead:
C
493
star
6

trezor-core

🔒 Don't use this repo, use the new monorepo instead:
Python
353
star
7

connect

🔗 A platform for easy integration of Trezor into 3rd party services
JavaScript
350
star
8

cython-hidapi

🐍 Python wrapper for the HIDAPI
Cython
255
star
9

trezord-go

😈 Trezor Communication Daemon (written in Go)
C
226
star
10

python-trezor

🐍 Don't use this repo, use the new monorepo instead:
Python
203
star
11

trezor-hardware

🔧 Hardware design of Trezor
171
star
12

python-shamir-mnemonic

Python
155
star
13

trezor.js

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/connect instead
JavaScript
95
star
14

trezor-common

🔒 Don't post issues/PRs to here, use the new monorepo:
Python
89
star
15

trezor-android

📱 TREZOR Communication Library for Android
Java
78
star
16

hd-wallet

💰 High-performance Bitcoin HD Wallet in Javascript
JavaScript
56
star
17

trezor-password-manager

Password Management via TREZOR
SCSS
42
star
18

data

📦 Data files for Trezor
HTML
39
star
19

trezor-wallet

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
JavaScript
29
star
20

trezor-user-env

Development tool for Trezor developers
Python
24
star
21

trezor-link

Javascript module for integrating TREZOR into Node.js and web applications.
TypeScript
18
star
22

connect-explorer

Connect Examples
JavaScript
12
star
23

trezor-suite-guide

User Guide present in Trezor Suite
11
star
24

rng-test

🎲 Random Number Generator (RNG) tests
C
10
star
25

community

👫 TREZOR Developer Community Discussion
9
star
26

trezor-ui-components

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
JavaScript
9
star
27

trezor-storage

🔒 Don't use this repo, use the new monorepo instead:
C
9
star
28

coinjoin-backend

Python
6
star
29

omni-trezor

OMNI Wallet for Trezor
JavaScript
6
star
30

ui

🍺 User Interface Mockups and Experiments
HTML
6
star
31

trezor-rollout

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
JavaScript
5
star
32

trezor-test-scenarios

Python
5
star
33

trezor-core-ui

HTML
5
star
34

trezor-storage-test

🔒 Don't use this repo, use the new monorepo instead:
Python
4
star
35

trezor-onboarding

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
TypeScript
4
star
36

.github

4
star
37

trezor-flags

JavaScript
4
star
38

trezor-translations-manager

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
JavaScript
3
star
39

trezor-blockchain-link

⚠️ OBSOLETE. DO NOT USE! Use https://github.com/trezor/trezor-suite instead
TypeScript
3
star
40

upysize

Tool for decreasing the size of compiled micropython code
Python
3
star
41

trezor-docker-images

Collection of docker images and configurations used across various trezor projects.
Dockerfile
2
star
42

binsize

Tool to analyze the size of a binary from .elf file
Python
2
star
43

definitions

Python
1
star