Repository navigation
MIP-0013: Multi-key Account Authorization for Custody Contracts #244
Replies: 2 comments 3 replies
|
I think that signature verification isn't the right approach. VRFs are much better for the identity part in a ZK context. If you verify a native ETH signature with ecrecover directly in an Ethereum contract, it is cheap. But if you want to do the same in a ZK environment and you put that signature inside a ZK circuit, then you need to prove ECDSA over secp256k1 inside a SNARK, and this is very heavy for the prover. With a VRF we can use ZK-friendly primitives (Poseidon, Jubjub), so the circuit needs much fewer constraints. And on-chain the contract only verifies a small SNARK proof instead of a heavy signature. This saves a lot of fees. The second point is unlinkability. If we want to prove "the sender is in the allowlist/DAO" without saying who: verifying the signature directly exposes the public key on-chain, and if we hide it in a circuit, we have to prove a signature against a big Merkle tree of keys, which is expensive. With a VRF, the user proves "my key is in this Merkle tree, and this is the VRF output for this tx nonce." The output changes for every context, so nobody can link two transactions to the same user, but the nullifier still prevents double-submits. In short: VRF plus ZK-friendly curves gives us cheaper proofs, cheaper verification and real unlinkability. Signed payloads are only better when privacy is not a requirement. |
|
Hey @riusricardo, Thanks for jumping into the topic. What's the level of adoption of VRF from a library and tooling perspective? Could a passkey/HW wallet be integrated into your proposed solution? One of the reasons for this kind of auth is to explicitly follow the requirements coming from MVE, where the user should be able to operate MN infrastructure without having to hold or even have access to the private/secret key. ECDSA P256 is the norm for these secure signers. |
Uh oh!
There was an error while loading. Please reload this page.
Abstract
This MIP specifies the multi-key account standard for Midnight custody contracts: who may release an account's assets, how that authority is proven, and how it is granted, revoked, and rotated across a set of independent device keys. It is the second building block of the multi-key account contract recommended by MPS-0018, and it instantiates the authorisation seam that the Contract Custody of Midnight-Native Assets MIP (hereafter "the custody MIP") deliberately left abstract.
Authorisation is by digital signature: each device holds an independent Schnorr keypair on the JubJub curve, and every asset-releasing circuit verifies, in-circuit, a signature over a challenge that binds the account, the circuit, its arguments, and a per-account authorisation counter. The choice of an asymmetric signature scheme over the cheaper hash-preimage alternative is deliberate, and carries the standard's three load-bearing properties. First, Schnorr admits the FROST threshold-signing protocol, so a key can be held as shares across an MPC committee that never reconstructs it — the composability with threshold custody that MPS-0018 records as broken at the proving boundary. Second, JubJub is the embedded curve of Midnight's proof system, so the curve arithmetic of verification — ecMulGenerator, ecMul, ecAdd — is native in-circuit, with no foreign-field emulation; the challenge hash is the standard library's version-stable persistent hash (Rationale R3). Third, a signature separates approval from proving: the party that authorises an operation produces a short artefact and needs no Midnight stack, while the party that proves needs the artefact and not the credential, so key custody and proof generation can live in different trust domains.
The scheme has been validated end to end on a devnet node, with independent TypeScript and Rust signers producing interchangeable signatures against the same in-circuit verifier. The device set carries an epoch mechanism that revokes every stale authorisation in one step, and a recovery seam, left abstract here, for the recovery-paths MIP recommended by MPS-0018.
MIP: https://github.com/midnightntwrk/midnight-improvement-proposals/blob/main/mips/mip-0013-account-authorisation.md
Contributors: @hbulgarini @NicolasDP
All reactions