IntersectMBO / cardano-ledger

The ledger implementation and specifications of the Cardano blockchain.
Apache License 2.0
261 stars 157 forks source link

Check use of keys vs key-hashes #760

Closed dnadales closed 4 years ago

dnadales commented 5 years ago

Check that the specification and implementation agree w.r.t. the use of keys vs key hashes in the mappings.

As pointed out by Duncan here https://github.com/input-output-hk/cardano-ledger-specs/issues/754#issuecomment-520819824

dnadales commented 5 years ago

Formal (and therefore executable) spec differ from the implementation in the use of key vs key hashes.

dnadales commented 5 years ago

Next, I'm checking that key hashes are consistently used in the implementation. If the difference between key and key hashes can be glossed over in the elaboration, then this discrepancy might be ok.

dnadales commented 5 years ago

For UTxO we have:

image

So we're using addresses hashes instead of addresses in the implementation :heavy_check_mark:

dnadales commented 5 years ago

For delegation scheduling we have:

image

:heavy_check_mark:

dnadales commented 5 years ago

Note that in the implementation we're hashing the keys before checking set inclusion:

image

dnadales commented 5 years ago

Delegation activation:

image

:heavy_check_mark:

dnadales commented 5 years ago

For update we have:

image

:heavy_check_mark:

dnadales commented 5 years ago

Finally the chain environment and state uses key hashes as well:

image

:heavy_check_mark: