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
TxInit
with transaction options to start a transaction operation - Generate and sign memos
- Issue
TxMemoSign
to fetch aTxMemoSig
APDU containing a signature for the provided memo
- Issue
- Build transaction summary to generate message for signing (see: MCIP#52)
- Issue
TxSummaryInit
to start summary generation - Add N outputs and unblinding information using
TxSummaryAddTxOut
followed byTxSummaryAddTxOutUnblinding
- Add M inputs via
TxSummaryAddTxIn
- Issue
TxSummaryBuild
to build summary message
- Issue
- Sign N rings
- Issue
TxRingInit
to start a ring signing operation - Issue
TxSetBlinding
to set the blinding values for the ring - Issue
TxAddTxOut
for each ring entry (in order ofreal_index
to(real_index - 1) % ring_size)
- Issue
TxRingSign
to complete signing - Issue
TxGetKeyImage
to fetch aTxKeyImage
APDU containing the key image and zeroth challenge for the signed ring - Issue
TxGetResponse
to fetchTxResponse
APDU containing the response scalar for each ring entry
- Issue
- Issue
TxComplete
to 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.