near / borsh

Binary Object Representation Serializer for Hashing
https://borsh.io/
487 stars 41 forks source link

Serde compatibiity #100

Open orthecreedence opened 4 years ago

orthecreedence commented 4 years ago

Hi, I'm investigating using the Near network for a project I'm working on. Looking through the examples on smart contracts and seeing Borsh, it looks like a really cool serialization format. I'm a bit curious if it plays nicely with Serde-based structs at all.

My use-cases are for using things like chrono::Datetime and url::Url which come with serde implementations. I suppose I could wrap these in newtypes and implement Borsh by hand, but I think it would be much easier if Borsh could work on top of serde (as well as having its own derive macros). This would make it easier to use the format with existing libraries and projects. I understand that Borsh layers some new features on top of its own implementation so obviously those would not be available in a serde-driven version.

I'm curious if this is a possibility for the projects near future. Thank you!