1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-02 12:38:43 +00:00
trezor-firmware/core/src/apps/nem
2020-07-24 16:37:58 +02:00
..
mosaic core: update isort config to place relative imports last 2020-05-18 14:31:51 +02:00
multisig core: update isort config to place relative imports last 2020-05-18 14:31:51 +02:00
namespace MONOREPO CREATE FROM trezor-core 2019-04-15 19:14:40 +02:00
transfer core: update isort config to place relative imports last 2020-05-18 14:31:51 +02:00
__init__.py core: use new keychain decorators where appropriate 2020-05-15 14:08:29 +02:00
get_address.py core: update references to keychain everywhere 2020-07-24 16:37:58 +02:00
helpers.py MONOREPO CREATE FROM trezor-core 2019-04-15 19:14:40 +02:00
layout.py core: update isort config to place relative imports last 2020-05-18 14:31:51 +02:00
README.md MONOREPO CREATE FROM trezor-core 2019-04-15 19:14:40 +02:00
sign_tx.py core: update references to keychain everywhere 2020-07-24 16:37:58 +02:00
validators.py MONOREPO CREATE FROM trezor-core 2019-04-15 19:14:40 +02:00
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