Adding a New Signer to IdentityKit
To add your wallet as a signer to IdentityKit, follow these four steps:
- Clone the IdentityKit repository.
- Add your wallet configuration.
- Create a pull request.
- Wait for approval and merge of the pull request.
Steps
1. Clone the IdentityKit repository
First, clone the IdentityKit repository to your local machine. Open your terminal and run the following command:
git clone https://github.com/internet-identity-labs/identitykit.git
2. Add your wallet configuration
Open the packages/identitykit/src/lib/signers.ts
file in your preferred code editor and add your
wallet configuration. Ensure that each field is correctly filled out:
- id: A unique identifier for your wallet. Make sure it is unique to avoid conflicts.
- description: The description shown when the wallet is in feature mode.
- providerUrl: The URL to connect to your wallet. This URL should be compatible with ICRC standards.
- transportType: The method your wallet uses to communicate with the client’s dApp. If your wallet
is an extension, use
TransportType.EXTENSION
. For web dApps, you can chooseTransportType.NEW_TAB
. - label: The display name of your wallet.
- icon: A base64-encoded SVG image representing your wallet.
Here is an example configuration:
const YourWalletSigner: SignerConfig = {
id: "YourWalletSignerIdentifier",
description: "Your wallet description.",
providerUrl: "https://your-wallet-rpc-url.com",
transportType: TransportType.NEW_TAB,
label: "Your Wallet Name",
icon: "data:image/svg+xml;base64,PHN2ZyB3aWR0ac+Cg==",
}
Note: by default IdentityKit uses IdentityKitAuthType.DELEGATION
for all signers that support
icrc34_delegation, if you add new signer that does not support it - please make you’ve added
custom authType for this signer in packages/identitykit/src/lib/identity-kit.ts
export const IdentityKitCustomSignerAuthType = {
[OISY.id]: IdentityKitAuthType.ACCOUNTS,
[InternetIdentity.id]: IdentityKitAuthType.DELEGATION,
[Stoic.id]: IdentityKitAuthType.DELEGATION,
[new_signer_id]: IdentityKitAuthType,
}
3. Create a pull request
After adding your wallet configuration, commit your changes and push them to the repository. Then, create a pull request (PR).
4. Wait for approval and merge of the pull request
Wait for the maintainers to review and approve your pull request. Once approved, it will be merged into the main branch, and the new version of the @nfid/identitykit NPM package will be released.
By following these steps, you will successfully add your wallet as a signer to IdentityKit.
If you want your extension wallet to be automatically discovered by IdentityKit, it needs to implement the ICRC-94 standard.