Skip to content

Strict DAG-CBOR encoding/decoding #503

@vmx

Description

@vmx

DAG-CBOR only supports a subset of CBOR. Especially for the FVM we should be strict about (de)serializing only valid DAG-CBOR. DAG-CBOR supports:

  • From all major types: only finite length major types. Not infinite length ones.
  • From major type 6: only tag 42 (CID) is supported, which is encoded as 0xd8 0x2a. Not any other tag.
  • From major type 7:
    • Only finite 64-bit floats. i.e. for major type 7 only the 0xfb byte. Not 16-bit (0xf9), 32-bit (0xfa).
    • Only the simple values false (0xf4), true (0xf5) and null (0xf6). Not simple values (0xe00xf3), undefined (0xf7), simple value, one byte follows (0xf8), "break" stop code (0xff).

The development will happen within the DAG-CBOR library, but I opened the issue here for tracking purpose.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions