Skip to content

Readded `class Signature(Bytes3112): #214

@KolbyML

Description

@KolbyML

So to start off with we use Signature in SignedAttestations and SignedBlockWithAttestions leanSig's to_bytes() function just returns bytes, so to safely be able to encode those bytes every the network, we would want to use some SSZ FixedBytes container, which implements tree_hash_root()

A pattern in rust would be,

SZZSignatureContainer(leanSigSignature)

class Bytes3112(BaseBytes):
    """Fixed-size byte array of exactly 3112 bytes."""

    LENGTH = 3112
class SZZSignatureContainer(Bytes3112):
    """Represents aggregated signature produced by the leanVM (SNARKs in the future)."""

@tcoratger has some concerns #210 (comment)

For now I would like to avoid having this one because before when we had this it was very confusing because we had two signature classes: one in the XMSS folder and one here that was tied to a specific number of bytes associated to the production configuration.

But this was very messy in terms of flexibility and clarity (for example we had to pad with the testing configuration).

So I would say that we can see in a followup PR if someone has a better idea to make things clean but for now the current way of doing things is pretty minimalist and clear from a spec point of view.

So like if we wanted to support a test configuration of leanSig, then we would need to

class SZZSignatureContainer(Bytes2ABC):
    """Represents aggregated signature produced by the leanVM (SNARKs in the future)."""

^ we would need a different signature size

So I guess there is a few possible solutions

  • do we need to use/support a test configuration for leanSig? If we can just use the prod config, and reuse generated keys then we should be fine
  • the consensus specs https://github.com/ethereum/consensus-specs has a "mainnet"/"minimal" presents, how do they handle different type sizes? Maybe we can copy what they do?
  • some other solution to support, different byte sizes for signatures?

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