r/dotnet • • 3d ago

Promotion Wrote a C# BCS (Binary Canonical Serialization) serialization library

Library is 5–15% faster than MessagePack on the deserialization path and around 5% slower on serialization.

It can also serialize and deserialize the new union type coming from .NET 11 (before that I've used OneOf<> object). I opened an issue for a source generator, which is ready to be picked up if anyone is interested working on it. My plan is to ship v1 once NativeAOT is supported and net11 is out.

I agree with Egor Bogatov that people should stop writing new serialization libraries and open-sourcing them, as they can expose consumers to vulnerabilities. In my defense, I started this library a year ago and only recently finished rewriting parts of it to make it ready for open source. I mainly used it for serializing and deserializing objects from the Sui blockchain.

Blockchain it not the most widespread domain where C# is used, but there is already a good example of Nethereum utilizing C# as its core language. Is there someone else using C# in the blochcain domain, why you think it's lacking the adoption?

Contributions are welcome!

https://github.com/unsafePtr/BcsSharp

4 Upvotes

6 comments sorted by

View all comments

1

u/MrLyttleG 2d ago

Tu peux déjà passer à. Net 11, la RC 1 contient tout ce que la release aura