To use quorum approvals, you must first create your P-256 keypairs first, then register them with Privy alongside a quorum 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

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

Once you have generated a P-256 keypair, you can register the public key for the keypair with Privy by making a POST request to:

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

Body

In the request body, include the following:

public_keys
string[]
required

A list of PEM-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 create a new authorization key 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 "privy-authorization-signature: <authorization-signature-for-request>" \
-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
}'