Expand description
TAIP-20 on-chain transfer correlation via memo hash.
TAIP-20 defines a chain-agnostic correlation primitive that ties a TAP
transfer to its on-chain settlement. The primitive is tap_hash = SHA-256(UTF8(transfer_id)). The hash is then carried on-chain in either:
- Profile A (text): the canonical form
tap:1:<64-lowercase-hex>placed in a UTF-8 memo / reference / comment field. - Profile B (binary): the raw 32-byte hash placed in a fixed-length binary memo field.
See prds/taips/TAIPs/taip-20.md for the full spec.
Functionsยง
- encode_
binary_ memo - Encode a transfer ID as a Profile B (binary) memo: the raw 32-byte hash.
- encode_
text_ memo - Encode a transfer ID as a Profile A (text) memo:
tap:1:<64-lowercase-hex>. - tap_
memo_ hash - Compute the canonical TAP correlation hash for a transfer ID:
SHA-256(UTF8(transfer_id)). - verify_
binary_ memo - Verify that a Profile B binary memo (raw bytes) correlates to the given transfer ID. Memos that are not exactly 32 bytes long are rejected.
- verify_
text_ memo - Verify that a Profile A text memo correlates to the given transfer ID.