Skip to content

Commit

Permalink
chore: Add emulator warnings.
Browse files Browse the repository at this point in the history
[no changelog]
  • Loading branch information
andrewkozlik committed Mar 3, 2025
1 parent 55101b8 commit 2154f16
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions core/emu.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,12 @@ def cli(
By default, emulator output goes to stdout. If silenced with -q, it is redirected
to $TREZOR_PROFILE_DIR/trezor.log. You can also specify a custom path with -o.
This emulator is for development purposes only. Any other usage of the emulator is
discouraged. Doing so runs the risk of losing funds. It uses a pseudo random number
generator, and thus no guarantee on its entropy is made. Security and hardening
efforts are only made available on physical Trezor hardware.
"""
if executable:
executable = Path(executable)
Expand Down
4 changes: 4 additions & 0 deletions core/src/boot.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ async def bootscreen() -> None:
utils.halt(e.__class__.__name__)


# Display emulator warning.
if utils.EMULATOR:
print("\x1b[1;31m*** TREZOR EMULATOR IS FOR DEVELOPMENT PURPOSES ONLY ***\x1b[0m")

# Ignore all automated PIN messages in the boot-phase (turned off in `bootscreen()`), unless Optiga throttling delays are active.
if not utils.USE_OPTIGA or (optiga.get_sec() or 0) < 150:
ignore_nonpin_loader_messages()
Expand Down
6 changes: 6 additions & 0 deletions docs/legacy/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,12 @@ poetry run ./script/cibuild
A built device firmware will be located in `legacy/firmware/trezor.bin`. A built emulator will be
located in `legacy/firmware/trezor.elf`.

### ⚠️ Disclaimer ⚠️

The emulator is for *development purposes only*. It uses a pseudo random number generator, and thus no guarantee on its entropy is made. No security or hardening efforts are made here. It is, and will continue to be, intended for development purposes only. Security and hardening efforts are only made available on [physical Trezor hardware](https://shop.trezor.io/).

Any other usage of the emulator is discouraged. Doing so runs the risk of losing funds.

### Common errors

* **"Exception: bootloader has to be smaller than 32736 bytes"**: if you didn't modify the bootloader
Expand Down

0 comments on commit 2154f16

Please sign in to comment.