marigold-dev / deku

MIT License
80 stars 16 forks source link

Validators should be represented by a key_hash #201

Closed EduardoRFS closed 2 years ago

EduardoRFS commented 3 years ago

Currently this means that the address at Validators.t should actually be a Wallet.t. And all of the places where it appears should then be fixed, the typer should be able to guide this change through the codebase.

https://github.com/marigold-dev/deku/blob/main/protocol/validators.rei#L4

rosalogia commented 3 years ago

Began working on this today; lots of progress so far, but it seems like there are some places and situations where replacing a key (Address.t) with a key hash (Wallet.t) might not make sense. An example is the Signature module (https://github.com/marigold-dev/deku/blob/main/protocol/signature.re#L37). The linked function verifies that the public key in a signature corresponds to a hash. This function internally calls Ed25519.verify which itself accepts an Ed25519 public key (unsurprisingly). The question is: does this function remain useful if signatures contain key_hashes rather than keys? If so, would we just be comparing the signature key_hash to the passed hash? And is there a specific way in which that should be handled? Unfortunately, I lack some of the context-specific knowledge to figure this out on my own, so I'm interested in having others' input.

EduardoRFS commented 3 years ago

@rosalogia yeah this is one of the cases where we need the proper key, a signature without the public key makes no sense.

rosalogia commented 2 years ago

Closed by #208