1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-12 10:39:00 +00:00
trezor-firmware/core/src/apps/nem
2021-03-30 22:34:01 +02:00
..
mosaic refactor(core): turn show_address, show_pubkey, show_xpub into layouts 2021-02-10 13:57:19 +01:00
multisig refactor(core): model-dependent UI component directories 2021-02-10 13:57:19 +01:00
namespace style(core): use PEP515 Underscores in Numeric Literals 2020-11-23 14:30:16 +01:00
transfer refactor(core): model-dependent UI component directories 2021-02-10 13:57:19 +01:00
__init__.py feat(core): update most apps to use path schemas 2020-11-05 14:30:11 +01:00
get_address.py refactor(core): turn show_address, show_pubkey, show_xpub into layouts 2021-02-10 13:57:19 +01:00
helpers.py style(core): use PEP515 Underscores in Numeric Literals 2020-11-23 14:30:16 +01:00
layout.py refactor(core): no implicit spaces in render_text 2021-03-30 22:34:01 +02:00
README.md
sign_tx.py fix(core): create protobuf messages correctly 2021-02-10 10:56:52 +01:00
validators.py
writers.py core: introduce safer write_bytes functions 2020-03-20 14:19:30 +00:00

NEM

MAINTAINER = Tomas Susanka tomas.susanka@satoshilabs.com

AUTHOR = Tomas Susanka tomas.susanka@satoshilabs.com

REVIEWER = Jan Pochyla jan.pochyla@satoshilabs.com

ADVISORS = Grégory Saive, Saleem Rashid


This implementation of NEM for Trezor Core is mostly based on the trezor-mcu C implementation by Saleem Rashid. The protobuf messages are heavily inspired by the NEM NSI API.

You can read a lot about NEM in the Technical Reference paper.

This app supports number of NEM services (transfers, mosaics, namespaces and multisig), also called transactions as the general term. Each of those services is divided into corresponding folders. In those folders we use serialize.py for the transaction serialization and layout.py to display data and to require user interactions.

In this app we support the following:

Mosaics

You can read more on mosaics here. Each mosaic has a name and lives under certain namespace, this identification namespace.mosaic is unique in the network.

Trezor Core supports mosaic creation and changing the mosaic's supply.

Namespaces

You can read more on namespaces at the same link. Namespace creation is supported.

Transfers

There is a number of things the term transfer may refer to:

Regular transfers

The traditional transfer of the native NEM coins XEM.

Mosaic transfers

Except XEM you can also transfer mosaics. Mosaics are attached to a regular transfer.

Each such attached mosaic has a quantity denoting the amount of such mosaic to be transferred. There is a catch though: the actual amount of the mosaic to be transferred isn't quantity but mosaic.quantity * transfer.amount. In other words, the quantity is multiplied by the amount field in transfer. This is most likely due to backwards compatibility where transfers with amount 0 where discarded.

You can also transfer XEM and mosaics at the same time. In that case you need to attach the nem.xem mosaic. From the user point of view Trezor shows this as a regular XEM transfer.

Importance transfer

Importance transfer is a special kind of transaction, which enables (or disables) delegated harvesting.

Multisig

NEM supports multisig accounts. First you convert an account into a multisig and add cosignatories. After that any cosignatory can initiate a multisig transaction.

Multisig is a wrapper, so you can use any of the services mentioned above wrapped into a multisig transaction requiring n out of m signatures.

A common scenario to test out multisig with NanoWallet might be:

  • Create a simple account without Trezor (account A)
  • Create another account with Trezor One (account B)
  • Convert A to a multisig with B as a cosigner
  • Create another account with Trezor T (account C)
  • Add C as a cosigner
  • Try to send a transaction where B and C cosigns