Skip to content

Define Crypto API (meta) #751

@ethanfrey

Description

@ethanfrey

There have been a number of requests for suporting various signature verification as "pre-compiles", such as #583 as well as a number of requests in chats. This is an overview ticket to work out what APIs we would like to support. Each individual algorithm should be a separate PR (and maybe a breakout issue). You may also want to address #602 to allow more complex return values in these APIs.

Very important:

Serious Consideration:

Bonus Points:

  • Secp256r1 signature verification: used in EOS, coming in Cosmos SDK v0.42 (found in Android and iOS secure enclaves)
  • Secp256k1 schnorr theshhold scheme (verification side), as defined in BIP 340, which seems to be approaching Bitcoin mainnet
  • Pairing support that maps to Ethereum ZK-snark support. In particular, supporting similar functionality to EIP 196 and EIP 197 This uses the alt_bn128 curve (maybe the same as bn256?). Reason to support this particular algorithm is the amount of tooling around Ethereum ZK snark contracts, eg. Zokrates, which may be able to be ported to CosmWasm contract.
  • Various common blockchain hash functions (most are light enough to include in wasm):
    • keccak3
    • sha2-256
    • sha2-512
    • ripemd160
    • blake2

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions