What is Borsh and when to use it
masterBorsh (Binary Object Representation Serializer for Hashing) is a non-self-describing binary serialization format designed for security-critical applications.
Key characteristics include:
- Consistent and Deterministic: There is a bijective mapping between objects and their binary representations, meaning no two different binary representations can deserialize into the same object. This is essential for applications that compute hashes of binary data.
- Safe: Implementations prioritize safe coding practices (in Rust, it uses almost exclusively safe code).
- Fast: Optimized for high performance, particularly in Rust, by opting out of the Serde framework to reduce code size and increase speed.