Crate zingo_memo

Source
Expand description

Zingo-Memo

Utilities for procedural creation and parsing of the Memo field.

These memos are not directly exposed to the user, but instead write down UAs on-chain for recovery after rescan.

Enums§

ParsedMemo
A parsed memo. The main use-case for this is to record the UAs that a foreign recipient provided, as the blockchain only records the pool-specific receiver corresponding to the key we sent with. We also record the index of any ephemeral addresses sent to. On rescan, this tells us:

Functions§

create_wallet_internal_memo_version_0Deprecated
Packs a list of UAs into a memo. The UA only memo is version 0 of the protocol Note that a UA’s raw representation is 1 byte for length, +21 for a T-receiver, +44 for a Sapling receiver, and +44 for an Orchard receiver. This totals a maximum of 110 bytes per UA, and attempting to write more than 510 bytes will cause an error.
create_wallet_internal_memo_version_1
Packs a list of UAs and/or ephemeral address indexes. into a memo. Note that a UA’s raw representation is 1 byte for length, +21 for a T-receiver, +44 for a Sapling receiver, and +44 for an Orchard receiver. This totals a maximum of 110 bytes per UA, and attempting to write more than 510 bytes will cause an error. Ephemeral address indexes are CompactSize encoded, so for most use cases will only be one byte.
parse_zingo_memo
Attempts to parse the 511 bytes of a zingo memo
read_unified_address_from_raw_encoding
A helper function to decode a UA from a CompactSize specifying the number of receivers, followed by the UA’s raw encoding as specified in https://zips.z.cash/zip-0316#encoding-of-unified-addresses
write_unified_address_to_raw_encoding
A helper function to encode a UA as a CompactSize specifying the number of receivers, followed by the UA’s raw encoding as specified in https://zips.z.cash/zip-0316#encoding-of-unified-addresses