Public keys using G2, real HashToCurve, Python implementation#4
Public keys using G2, real HashToCurve, Python implementation#4HarryR wants to merge 2 commits intomaticnetwork:masterfrom
Conversation
|
There may be another method to reduce cost of aggregating keys. You can have a positive bitmask and a negative bitmask. By keeping track of the aggregate key when adding and removing validators you can avoid having to compute it every time a signature is checked in the special case where all validators sign the message. But, when not all do, it may be cheaper to subtract the missing keys from the precomputed aggregate than it is to re-compute 'all but 1'. e.g. if you require a 2/3rds majority but there are some times when a validator may be temporarily offline or inactive, then removing just their key(s) will be much cheaper than recomputing all 253 or so keys (assuming the worst case) |
|
yes @HarryR, I was thinking of having both bitmasks also looking for alternative ways as well like
|
|
I really think that adding a 'game' here will add an unnecessary window of uncertainty where you could have proven finality, if you are set on that I will extract the useful code into a separate repository so it's not burdened with yet another poorly conceived finality game. Adding 'slashing' sounds easy, but it really isn't - it introduces many economic problems, such as when the reward for a malicious actor exceeds the value being slashed, and means that the total value of any transfers happening at any given point in time should be at most the amount at-risk by the upstream validators. In an ideal world, all of the validators sign each message and this eliminates the cost of aggregating keys on-chain, reduces complexity and the overall cost is about as low as it can get (a single |
|
@HarryR agreed that's why paying a little bit of extra gas makes more sense, that's why still thinking of going with bitmask with on-chain aggregation. We can keep making some small optimizations if possible. |
There are some improvements I've made:
pairing2operationThere are still some things which are inefficient:
And some things which are missing:
ethereum.tools.testeris currently brokenREADME.mdfileI will see if I can add better tests, updated documentation and support for Travis CI etc.