cosmos / ibc-rs

Rust implementation of the Inter-Blockchain Communication (IBC) protocol.
Apache License 2.0
182 stars 74 forks source link

FR: Allow binary data in ibc::apps::transfer::types::Memo #1019

Open mina86 opened 6 months ago

mina86 commented 6 months ago

Change ibc::apps::transfer::types::Memo type to wrap Vec<u8> rather than a String so that it doesn’t have to be valid UTF-8. With ICS-20 memo is used to transfer machine-readable instructions to execute after a transfer. However, the field being a String forces them to be valid UTF-8. In some situations, this prevents most efficient memo representation to be used.

For example, on Ethereum one might define memo to use/include Ethereum ABI encoded function call but to be able to include that in memo it must be UTF-8 which forces users to waste time and space doing hex or base64 encoding.

Notably, in Proto converting string field into bytes is backwards compatible. Furthermore, Go (as far as I know) accepts invalid encoding within string type.

mina86 commented 4 months ago

Was there any progress or discussion on this topic anywhere?