The proposal is to advance stellar-core by adding a host function to verify the secp256r1 signature, which is the most common elliptic curve used outside of the blockchain space. It is useful in connecting off-chain authentication interfaces with on-chain functionality.
Note that the proposal is not for a new signer type but a host function.
Leigh investigated adding support for the WebAuthN use case, by allowing a custom account / smart contract to sign soroban auth entries using a secp256r1-signed payload.
secp256r1 is supported by phones, passkeys, and enables an app to replace passwords. This is a massive benefit to user-facing applications like wallets.
Pros and cons of the interface: blockchains generally implement the recovery interface over the verification interface but verification is easier for developers as it reduces burden on the client and the network.
The WebAuthN use case requires encoding and decoding of base64 payloads and decoding JSON blobs, which is not currently supported in Soroban.
While there are hacky ways of accomplishing the latter, it’s not a great developer experience and final implementation is susceptible to breakages on updates.
It is also costly to bundle decoding with verification in guest.
Soroban has always led with a batteries included mindset. Keeping in line with that approach, it makes sense to further investigate and determine whether a host function makes sense for these as well.
Leigh’s implementation may require further evaluation of the crates used for ecdsa and p256.
Brief discussion around proposed process for adding of a host function by a non-core dev.
The need for zk-enabling encryption curves like BLS12-381. Github thread.
Use cases that ecosystem is interestd in:
Excellar, i.e. folks that kicked off this conversation by submitting a PR for BLS12-381, wants to add a DAO-controlled oracle where the elliptical curve provides the ability to add new DAO voters
Zkbricks wants to build an L2 system for that enables secret state for arbitrary smart contracts
Skyhitz wants to use stellar for efficient compute, cost, and scalability while using zk to prove ownership of high-value assets on another chain
Core devs questioned whether BLS12-381 was the right curve and also highlighted the need to determine the correct level of abstraction given there is a tradeoff between flexibility and efficiency. Lower level of abstraction will enable more flexibility but result in more hot loops in the wasm while a higher level of abstraction will be highly efficient but will restrict generality.
ZkBricks thought that there is a need to directly expose pairings and group operations without any level of abstraction. The space is in active development and flexibility is needed to try out new approaches and proof systems. From the point of view of crypto agility, it would be good to expose a generic interface that supports a variety of curves in the backend.
Path Forward
Core devs mentioned crypto curves can be experimented locally by linking rust crates, which it turns out, had failed in the past. This will be explored and fixed.
ZkBricks and others will prototype locally and provide feedback.
What are the best practices for managing transactions in the frontend, with respect to transaction ordering.
Core devs confirmed that ordering is intentionally arbitrary.
Request for an API for current version of the environment/sdk
Github issue filed for the RPC to return versions of the current node.