Chia-Network / chips

Apache License 2.0
45 stars 22 forks source link

CHIP-0034: keccak and base64 operators #116

Closed danieljperry closed 5 months ago

freddiecoleman commented 6 months ago

Thanks, @danieljperry ! This CHIP has been assigned CHIP-34 and is now a Draft. Feel free to leave a review here, or to discuss it in the #chips channel of our Discord.

greimela commented 6 months ago

Great addition!

Regarding passkey support: the passkey standard uses the urlencoded version of base64, without padding. So those two aspects could be configurable via arguments, or via separate operators.

danieljperry commented 6 months ago

Thanks for the comments! I have updated the CHIP accordingly.

danieljperry commented 6 months ago

Thanks for the reviews, I believe I have addressed all of the concerns raised.

danieljperry commented 6 months ago

We will hold a public zoom call to talk about this CHIP on May 20 at the following time: 7 AM PDT / 2 PM UTC / 10 PM China See the #chips channel of our public Discord for more info.

Yakuhito commented 5 months ago

Hi! Wanted to put this here. This CHIP could potentially allow Chia to integrate with any wallets that support ETH - including hardware wallets - by 'impersonating' a custom EVM chain during signing. From my (very brief) research, I think RLP encoding should be looked into - again, this is just a raw idea.

EDIT: As discussed in the call, because this CHIP is so far along & a new operator is needed, someone will need to create a new CHIP for the operator(s) to make it possible.

EDIT 2: After a tweet exchange, it now seems possible to bypass the RLP encoding part by using EIP-712 signatures. This ChIP would then be sufficient to add Ethereum wallet support (including hardware).

danieljperry commented 5 months ago

CHIP-34 is now in Review. Please review as time permits. We seem to have consensus on adding the three operators from this CHIP, if there are no objections from the community, we will move it to Last Call soon.

danieljperry commented 5 months ago

In case you missed it, here is our discussion of this CHIP: https://youtu.be/hFwPBfM4s8c

danieljperry commented 5 months ago

We have decided to withdraw CHIP-34 from consideration. The reasons for this are threefold:

  1. There isn't sufficient demand for the keccak256 operator to justify forking the consensus in order to implement it.

  2. For base64 encoding, we are able to do this without adding a new operator. While it is true that prior to the activation of the 2.1 hard fork, the operator from this CHIP would have been significantly less costly than the non-CHIP method, this is a moot point because this CHIP would not have activated prior to the 2.1 fork's activation.

After the 2.1 fork takes full effect, block compression will be enabled. At this point, the operator from this CHIP would only have been about 2.3% more efficient in CLVM cost versus the non-CHIP version of base64 encoding. We deemed that this saving would not justify forking the consensus.

  1. For base64 decoding, this was only ever added for completeness. There is not currently a use case for it.

If we ever do decide to implement these operators in the future, the source material will still be available for a new CHIP.