Tagged Derivation Keys™ 🔑

Tagged derivation keys are a concept conceived by the maintainers of Panda Wallet, offering developers a wide array of possibilities limited only by their imagination. Although presently exclusive to Panda, any wallet has the potential to incorporate this feature. Wallet developers keen on integrating tagged derivations can reach out to a Panda maintainer through Discord.

Under the hood, tagged derivation keys are human-readable tags (plus metadata) associated with a set of keys derived from a specific derivation path within the user's connected wallet. Each derivation path is distinct, generated from a hash of the label and id and permissioned based on the requesting domain.

Notably, these tags are also encrypted and inscribed; linked to the user's identity address.

Think of them as on-chain configuration files.

Generate a Set of Tagged Keys:

{
  label: string; // something human readable
  id: string; // some uuid or other identifier
  meta?: Record<string, any>; // any valid object
}

Note that the domain , which is a part of the response, will be injected as a part of the panda request automatically.

const wallet = initProvider(); // see "Detecting the Provider"

const tag = {
  label: "cool-app",
  id: '76dfc2eb-067e-43a4-be62-d3b61f2c9bad',
  meta: {foo: 'bar'}
};

try {
    const response = await wallet.generateTaggedKeys(tag);
    console.log(response);
// {
//   address: string;
//   pubKey: string;
//   tag: DerivationTag;
// }

} catch (err) {
    console.log(err);
}

Get Existing Tagged Keys:

{
  label: string;
  ids?: string[];
}

Attempting to retrieve keys from a domain which did not generate them will result in an empty array response. If an ids array is not a part of the request, it will return all the tags.

const wallet = initProvider(); // see "Detecting the Provider"

const request = {
  label: "cool-app",
  ids: ["76dfc2eb-067e-43a4-be62-d3b61f2c9bad", "f8b7539e-795b-4422-830f-d8ab1fd712bf"]
};

try {
    const response = await wallet.getTaggedKeys(request);
    console.log(response);
// [{
//   address: string;
//   pubKey: string;
//   tag: DerivationTag;
// },
// {
//   address: string;
//   pubKey: string;
//   tag: DerivationTag;
// }]

} catch (err) {
    console.log(err);
}

Last updated