Crate ledger_mob_core
source ·Expand description
MobileCoin hardware wallet core
This provides a common Engine supporting transaction signing and verification for execution on hardware wallets.
Interactions with the Engine are performed via Events and Outputs, see ledger_mob_apdu for APDU objects and wire encodings.
Operations
Prior to interacting with a hardware wallet the client should issue an
AppInfoReq to fetch an
AppInfoResp containing application information
including the applet version, protocol version, and flags for available features.
Requesting wallet / subaddress keys
Wallet keys can be requested via WalletKeyReq
APDU, returning a WalletKeyResp containing
the root spend public key and view private key for a given account index.
SubAddress keys can be requested via WalletKeyReq
APDU, returning a WalletKeyResp containing
the subaddress spend public key and view private key for a given account index.
Key Image Scanning
Key images can be recovered via KeyImageReq request,
returning a KeyImageResp APDU containing the computed
key image.
Executing a transaction
Transactions consist of a series of operations to first configure the transaction, sign memos for the transaction, then to sign the set of rings included in the transaction.
See lib/src/handle.rs
for a complete / reference implementation.
Unless otherwise documented each transaction operation returns a
TxInfo response containing the current
transaction state as well as a
TxDigest computed from the inputs to the transaction.
This digest ensures the executed transaction matches the callers expectations,
and MUST be cached on TxInit and updated and
compared for each operation during a transaction, with the transaction
discarded if a mismatch is detected.
- Issue
TxInitwith transaction options to start a transaction operation - Generate and sign memos
- Issue
TxMemoSignto fetch aTxMemoSigAPDU containing a signature for the provided memo
- Issue
- Build transaction summary to generate message for signing (see: MCIP#52)
- Issue
TxSummaryInitto start summary generation - Add N outputs and unblinding information using
TxSummaryAddTxOutfollowed byTxSummaryAddTxOutUnblinding - Add M inputs via
TxSummaryAddTxIn - Issue
TxSummaryBuildto build summary message
- Issue
- Sign N rings
- Issue
TxRingInitto start a ring signing operation - Issue
TxSetBlindingto set the blinding values for the ring - Issue
TxAddTxOutfor each ring entry (in order ofreal_indexto(real_index - 1) % ring_size) - Issue
TxRingSignto complete signing - Issue
TxGetKeyImageto fetch aTxKeyImageAPDU containing the key image and zeroth challenge for the signed ring - Issue
TxGetResponseto fetchTxResponseAPDU containing the response scalar for each ring entry
- Issue
- Issue
TxCompleteto complete transaction
Re-exports
pub use ledger_mob_apdu as apdu;
Modules
- The Engine provides functionality required by hardware wallets.
Structs
- Token Id, used to identify different assets on on the blockchain.