NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
crates.io · #646 most downloaded on crates.io
Binary Object Representation Serializer for Hashing
Last release 1 months ago
26 Aug 2026
Release timing varies
gaps range from 4 weeks to 8 months
Most releases are documented
notes for 36 of 54 stable releases
1 version withdrawn
withdrawn after publishing
7 years old
61 releases · first in 2019
BorshSchema derive resolves bare Self in enum variant fields to the enum, not the inner struct
merge multiple #[borsh(...)] attributes instead of rejecting them
One column per quarter.
impl BorshSerialize and BorshDeserialize for Uuid
keep bytes no_std unless borsh std is enabled
Upgrade the CI base image to use ubuntu-24.04 instead of the deprecated ubuntu-20.04
replace Result::unwrap err msg with proc_macro_crate::crate_name tag
Result::unwrap err msg with proc_macro_crate::crate_name tag (#351)add mention of indexmap feature
fix typo in private module name
make doc examples testable in ci
specify a minimum version for syn as 2.0.81
syn as 2.0.81 (#320)ser/de for IpAddr type; schema for Ipv4Addr/Ipv6Addr/IpAddr types
*(schema)* for HashMap -> HashMap , for HashSet -> HashSet
implement BorshSchema for VecDeque and LinkedList
impl BorshSchema for Cow<'a, T>
bump proc-macro-crate to 3; bump MSRV to 1.67
impl BorshSchema for Rc and Arc; add doc for rc feature
BorshSchema for Rc and Arc; add doc for rc feature (#268)optimize BorshSerialize derive for enums with unit variants
add support for types from ascii crate
ascii crate (#255)bump proc-macro-crate to 2.0.0 in borsh-derive
proc-macro-crate to 2.0.0 in borsh-derive (#256)addressed warnings in docs generation
relax schema_container_of target requirement with ?Sized to allow slices
> The year is 2653 and the best yet-to-be citizens of the Terran Federation are fighting
The year is 2653 and the best yet-to-be citizens of the Terran Federation are fighting and mostly just dying in a relentless interstellar war against the Arachnids. Yet the structure of our society has changed through the course of this confrontation.
The members of the Arachnid brain caste and queens have infiltrated the circles of our most influential political and industrial leaders. Either directly, or via the Arachnid technology called "Brain Bugs". This tech alone can accomplish what the Arachnid starship paratroopers will not ever be capable to do.
Simple, straightforward and performant serialization libraries can set us in course to remedy this dangerous stalemate situation by cleaning the minds of its users from even the tiniest of Brain Bugs.
borsh-rs 1.0.0 release was first conceived and then brought into existence by minds of:
Contributors, who imposed powerful impact on the past, present and future of this library are specially recognized:
BorshSchema feature, rethinking it, bringing up great ideas and coming up with the
fairly involved algorithm of max_serialized_size implementation.This section contains links to short documents, describing problems encountered during update of borsh
version to v1.0.0 for related repositories.
Library's structure was made more modular and optimized with respect to visibility of its public/private constituents and ease of access to them.
borsh's traits derives and their attributes had their capabilities extended and unified,
both with respect to external interfaces and internal implementation. Please visit borsh_derive
documentation pages if you're interested in more of the details.
The consistency property of deserialization, declared in Borsh Specification, became an
opt-in feature de_strict_order for hash collections.
Support of explicit enum discriminants was added to derives of borsh traits.
It has been added in somewhat limited form, only allowing the values of u8 range literals.
use borsh::{BorshSerialize, BorshDeserialize, BorshSchema};
<<<<<<< borsh-v0.10.3
#[derive(BorshDeserialize, BorshSerialize, BorshSchema)]
pub enum CurveType {
ED25519 = 0, // 0 as u8 in enum tag
SECP256K1 = 2, // 1 as u8 in enum tag
}
=======
#[derive(BorshDeserialize, BorshSerialize, BorshSchema)]
#[borsh(use_discriminant=false)]
pub enum CurveType {
ED25519 = 0, // 0 as u8 in enum tag
SECP256K1 = 2, // 1 as u8 in enum tag
}
// vs
#[derive(BorshDeserialize, BorshSerialize, BorshSchema)]
#[borsh(use_discriminant=true)]
pub enum CurveType {
ED25519 = 0, // 0 as u8 in enum tag
SECP256K1 = 2, // 2 as u8 in enum tag
}
>>>>>>> borsh-v1.0.0
RUSTSEC-2023-0033 has been resolved.
It has been resolved by forbidding collections with dynamic runtime length to contain zero-sized types
with runtime errors, happening on serialization or deserialization.
Arrays with non-Copy and non-Clone ZST singletons of length > 1 gracefully panic on deserialization,
not causing memory faults.
Using collections with dynamic runtime length (tagged sequences) for containing ZSTs was also deemed
wasteful of CPU cycles and a way to perform dos attacks.
Such a case is now flagged as error when using new BorshSchemaContainer::validate method for user-defined
types or instantiations of BorshSchema-supporting types with inappropriate parameters, defined by the library:
let schema = BorshSchemaContainer::for_type::<Vec<core::ops::RangeFull>>();
assert_eq!(
Err(
SchemaContainerValidateError::ZSTSequence("Vec<RangeFull>".to_string())
),
schema.validate()
);
BorshSchema was extended with max_serialized_size implementation, which now unlocks support of borsh
by a plethora of bounded types to express statically defined size limits of serialized representation of these types.
schema BorshSchemaContainer api was made future-proof.
schema Definition was extended with more variants, fields and details to uncover some of the
implied details of serialization format.
BorshSchema can now express a wider range of types. All types, which have BorshSchema defined by the library,
now have a Definition.
schema Declaration-s were renamed to follow Rust-first rule and not be a mix of Rust types naming/syntax and syntax
from other languages.
use borsh::schema::BorshSchema;
<<<<<<< borsh-v0.10.3
assert_eq!("nil", <()>::declaration());
assert_eq!("string", <String>::declaration());
assert_eq!("Array<u64, 42>", <[u64; 42]>::declaration());
assert_eq!("Tuple<u8, bool, f32>", <(u8, bool, f32)>::declaration());
=======
assert_eq!("()", <()>::declaration());
assert_eq!("String", <String>::declaration());
assert_eq!("[u64; 42]", <[u64; 42]>::declaration());
assert_eq!("(u8, bool, f32)", <(u8, bool, f32)>::declaration());
>>>>>>> borsh-v1.0.0
borsh's serialization format is guaranteed to NOT change throughout 1.x releases.borsh's public APIs not gated by unstable__schema feature are guaranteed to NOT break
throughout 1.x releases.BorshSchema from outside of near ecosystem,
thus borsh's public APIs gated by unstable__schema MAY break throughout 1.x releases.[breaking] completely remove deprecated BorshSerialize::try_to_vec
[breaking] add DiscriminantValue to Definition::Enum::variants tuples
DiscriminantValue to Definition::Enum::variants tuples (#232)length_width to schema::Definition::Sequence (#229)String/str (#226)Definition::Sequence::length_range field (#220)Definition::Primitive (#222)Definition::Enum’s tag_width when validating schema (#224)core::ops::Range... types (full, open-ended, inclusive) (#213)BorshSchema implementation for core::num::NonZero... integers (#214)borsh::io with either items of std:io or private borsh::nostd_io module reexported (std or no_std) (#212)borsh::max_serialized_size function, borsh::schema::BorshSchemaContainer::for_type method (#209)"Tuple<T0, T1, T2...>" -> "(T0, T1, T2...)" (schema::Declaration) (#234)"nil" -> "()", "string" -> "String", "nonzero_u16" -> "NonZeroU16" (schema::Declaration) (#233)"Array<T0, N>" -> "[T0; N]" (schema::Declaration) (#235)ValidationError from MaxSizeError; validate and max_serialized_size made BorshSchemaContainer's methods (#219)[breaking] deprecate try_to_vec method from BorshSerialize
[breaking] renamed #[borsh_skip] to #[borsh(skip)]
[breaking] borsh_init to borsh(init).
Unused fields warn, fields for inner structs of derived BorshSchema method
BorshSchema derive for enum (#177)schema feature in doc.rs (#166)from_slice and from_reader helper functions to make the API nicer (#142)#[borsh(use_discriminant = <bool>)] attribute that changes enum discriminant de- and serialization behaviorBinaryHeap support (#161)HashSet/BTreeSet/HashMap/BTreeMap (#162)BorshSerialize, BorshDeserialize, BorshSchema derives may break#[borsh(bound(..))] / #[borsh(schema(params = ...))]hashbrown dependency optional, hashbrown feature (#155)BorshSchemaContainer fields non-pub, HashMap -> BTreeMap in schema everywhere (#165)__private module with macro runtime (#171)borsh-schema-derive-internal and borsh-derive-internal crates won't be published anymoreinsta snapshots to borsh/tests (#157)insta tests for prettified TokenStream-s in borsh*derive-internal (#176)add BorshSchema for PhantomData, BTreeMap and BTreeSet
Nothing published for this version
Add optional bytes/bytesmut support
Prevent unbound allocation for vectors on deserialization
Implemented (de)ser for core::range
core::ops::range*BREAKING CHANGE*: BorshDeserialize now works by receiving an &mut std::Read instead of a &mut &[u8]. This is a breaking change for code that provides…
std:: instead of crate::maybestd::)for boundsBorshDeserialize now works by receiving an &mut std::io::Read
instead of a &mut &[u8]. This is a breaking change for code that provides custom
implementations of BorshDeserialize; there is no impact on code that uses only the
derive macro.BorshDeserialize::try_from_reader and BorshDeserialize::deserialize_reader.>=0.11,<0.14 to allow wider range of versions.Reduce code bloat in derived BorshSerialize impl for enums.
no_std compatibility.BorshSerialize impl for enums.Upgrade hashbrown from 0.9 to 0.11. This can breakage in the rare case that you use borsh schema together with no-std support and rely on a specific v
0.9 to 0.11. This can breakage in the rare case
that you use borsh schema together with no-std support and rely on a specific
version hashbrown of SchemaContainer. This is considered to be obscure
enough to not warrant a semver bump.Eliminated unsafe code from both ser and de of u8
*BREAKING CHANGE*: is_u8 optimization helper is now unsafe since it may cause undefined behavior if it returns true for the type that is not safe to C…
is_u8 optimization helper is now unsafe since it may
cause undefined behavior if it returns true for the type that is not safe
to Copy (#21)Avoid collisions of imports due to derive-generated code
Added support for BTreeMap, BTreeSet, BinaryHeap, LinkedList, and VecDeque
- Add no_std support.
Implement BorshSerialize for reference fields (&T)
BorshSerialize for reference fields (&T)Implement BorshSerialize for &T if T implements BorshSerialize.
BorshSerialize for &T if T implements BorshSerialize.Extended Box implementation for ?Sized types ([T], str, ...).
Box<T> implementation for ?Sized types ([T], str, ...).std::borrow::CowCargo.lock as it is advised for lib crates.Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →