Skip to main content

mint_signing_input

Function mint_signing_input 

Source
pub fn mint_signing_input(t: &IssueTransfer) -> Result<Vec<u8>, LedgerError>
Expand description

The canonical, domain-separated bytes an issuance authorization signs.

Every field that determines what is minted, and where it lands, is bound: changing the amount, the destination, the unit, or the idempotency key changes the signing input and invalidates the signature. The encoding is canonical DAG-CBOR in a fixed array order (the same discipline crate::AccountId::derive uses), so an independent implementation can reproduce these bytes exactly.

[
  "hs-ledger-mint-authorization-v1",
  <transfer_id  : bstr(16)>,   // big-endian u128
  <issuer_liab  : bstr(16)>,   // big-endian u128
  <destination  : bstr(16)>,   // big-endian u128
  <unit_issuer  : tstr>,
  <unit_class   : tstr>,
  <amount       : bstr(16)>,   // big-endian u128
  <grant_cid    : bstr>,       // empty when absent
  <user_data    : bstr(32)>
]