Generate a keypair

To use quorum approvals, you must first generate a P-256 keypair, then register them with Privy alongside an authorization threshold. You can create a keypair with the following command:

openssl ecparam -name prime256v1 -genkey -noout -out private.pem && \
openssl ec -in private.pem -pubout -out public.pem

Register the public key

After you have generated your keypairs, register them with Privy via the Dashboard or REST API, and make sure to save the id for future use.

Register the public key of the keypair with Privy by making a POST request to:

https://api.privy.io/v1/key_quorums

Body

In the request body, include the following:

public_keys
string[]
required

A list of PEM or DER formatted P-256 public keys to register. Make sure to include the PEM header and footer and to properly escape any newlines.

authorization_threshold
number

The minimum number of signatures required to authorize an action. If left unset, the default is all keys.

display_name
string

Human readable display name to attach to the key.

Response

If the request is successful, Privy will return the following in the response:

id
string

Unique ID for the key quorum, used to assign the owner_id to a resource.

authorization_keys
{public_key: string, display_name: string | null}[]

The list of public keys and their display names.

authorization_threshold
number | null

The minimum number of signatures required to authorize an action. If left unset, the default is all keys.

display_name
string

Human readable display name to attach to the key.

Example

As an example, a request to register a 2 of 2 key quorum might look like the following:

$ curl --request POST https://api.privy.io/v1/key_quorums \
-u "<your-privy-app-id>:<your-privy-app-secret>" \
-H "privy-app-id: <your-privy-app-id>" \
-H 'Content-Type: application/json' \
-d '{
    "display_name": "Sample key",
    "public_keys": [
        "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEx4aoeD72yykviK+f/ckqE2CItVIG\n1rCnvC3/XZ1HgpOcMEMialRmTrqIK4oZlYd1RfxU3za/C9yjhboIuoPD3g==\n-----END PUBLIC KEY-----",
        "-----BEGIN PUBLIC KEY-----\nMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAErzZtQr/bMIh3Y8f9ZqseB9i/AfjQ\nhu+agbNqXcJy/TfoNqvc/Y3Mh7gIZ8ZLXQEykycx4mYSpqrxp1lBKqsZDQ==\n-----END PUBLIC KEY-----"
    ],
    "authorization_threshold": 2
}'