Skip to content

Encoding for on-chain structures #621

@anorth

Description

@anorth

The spec is very light on details about the serialization/encoding of on-chain structures. At present, CBOR is not mentioned but a few structs have a // representation tuple comment.

I believe the intention at present is for all structures to be CBOR-tuple encoded (i.e. a CBOR array with items corresponding to struct fields in their order of declaration). This is efficient but has some potential problems. I'm filing this issue so that we have them written down somewhere.

@jbenet's most recent declaration is:

  • i'm OK with tuple encoding for testnet
  • we MAY ship mainnet w/ tuple encoding
  • we MAY have to change from tuple to int-keyed map for structs for mainnet
  • we will prioritize this along other changes that come out of security review during testnet
  • IF [int-keyed maps are already implemented] we can motivate realignment to that now.
  • IF NOT (gfc has string maps, but not int-keyed maps and those would be a lot of work), proceed w/ tuple. but keep it easy to change this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions