Closed dcoutts closed 5 years ago
Assigning this to myself, since I need to change it for integration with ouroboros-network
In both the Byron and Shelley formal specs, the genesis key delegation mapping (dms
) has type VKeyG |-> VKey
. We will need to change these to hashes as well.
here are the changes I am expecting for the shelley formal spec:
dms
be KeyHash_gen |-> VKey
fdms
and dms
dms
and fdms
be KeyHash_gen |-> VKey
hgk := hash gkey
hgk \in dom dms
fdms
with {(s', hgk) |-> vk}
gkeys
should now have type P (KeyHash_gen)
osched
should now have type Slot |-> KeyHash_gen
dms
and osched
dms
and the full genesis verification key.
bslot bhb |-> hk \in osched
hk |-> vk \in dms
hk = hash bvkcold bhb
Finally, we should probably also change the UTxO witness mapping to be a set.
Needs to be fixed in the Byron spec also
In the actual implementation for Byron we do not use verification keys in maps, except for the AVVM/redemption case, and the auditors signed off on that exception.
So for Byron the only thing to do is to check the specs agree with the impl about the use of keys vs key hashes.
For the Shelley rules, there's more to do, as Jared notes above.
@dcoutts Yes, sorry, should have been clearer above - the thing that needs doing for Byron is bringing the specs in line with the implementation
I've created this issue for Byron https://github.com/input-output-hk/cardano-ledger-specs/issues/760
In general we should not be comparing or ordering keys directly. When we need to compare or index on keys we should be using key hashes.
More specifically, the approach is that verification keys have an Eq but no Ord, while signing keys have no Eq or Ord at all.
More or less we do do that everywhere. But in the executable spec for
Updates.hs
we do have one place where we have a mapping from genesis verification keys to other things. It looks like it would not be a significant change to switch that over to genesis key hashes (in both executable and formal spec)Specifically:
AVUpdate
is aMap (VKeyGenesis dsignAlgo) Applications
PPUpdate
is aMap (VKeyGenesis dsignAlgo) (Set Ppm)
And we should check for any others. Trying to compile will the latest
cardano-prelude
crypto classes will reveal any remaining cases.