Skip to content

Tag inclusion #352

Description

@ivanlele

Project

compiler

Describe the feature

We are currently drafting a Simplicity metadata registry concept.

We need to somehow include metadata information in CMR. The need for this arises from the potential for an adversary: a malicious party can submit forged metadata to the registry and verify CMR with it. The solution is to include the metadata during compilation.

I propose a compilation option that includes a 32-byte tag with the main node as the compiled node, e.g., comp(main_node, tag). By default, the compilation result will be just the main node if no tag is provided.

The existence of such a tag can serve other purposes, such as:

  • Domain separation
  • Protocol binding
  • Source provenance (git commit, for example)
  • Version binding

Currently, a workaround is to create a constant in source files, but it is not programmable enough; for example, if a framework (Simplex, etc) includes this tag dynamically, it would need to modify the constant each time, and it will be a bit intrusive, but if we have a compilation option, then the framework can utilize this instead of cheap hacks.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions