solana-idl-foundation / solana-idl-spec

Specifying a Solana IDL Standard, inspired from the Anchor IDL Standard
Apache License 2.0
20 stars 2 forks source link

Field for serialization format #8

Open seanyoung opened 1 year ago

seanyoung commented 1 year ago

spl_token uses bincode for serialization. We should have a field for serialization format. The default should be borsh.

I would like to avoid proliferation of serialization formats. Each new format will require work for each support language (both on-chain and client side).

People love to invent new serialization formats though.

riptl commented 1 year ago

Maybe relevant, I've tried to formalize the Serde/Rust type model and bincode serialization format here: https://github.com/solana-foundation/specs/pull/17

austbot commented 1 year ago

+1 to this as many programs are moving to a mixture of borsh and parts of the account that are zero copy

austbot commented 1 year ago

The serialization types I have used or seen in the wild are: Message Pack Flatbuffers Bebop Borsh POD(bytemuck) Bincode Mixture of POD and Borsh usually with a borsh header