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§
- Parsed
Memo - 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_ 0 Deprecated - 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