Dfns API Documentation
  • 👋Welcome
  • Getting Started
    • Onboarding to Dfns
    • Dfns Environments
    • Core API Objects
    • Supported Assets
    • Postman
    • Dfns SDKs
    • Dashboard Videos
  • API Docs
    • Introduction
    • Authentication
      • Delegated Authentication
        • Delegated Registration
        • Delegated Registration Restart
        • Delegated Login
      • User Action Signing
        • Create User Action Signature Challenge
        • Create User Action Signature
      • Registration
        • Create User Registration Challenge
        • Complete User Registration
        • Complete End User Registration with Wallets
        • Resend Registration Code
        • Social Registration
      • Login
        • Create User Login Challenge
        • Complete User Login
        • Social Login
        • Logout
        • Send Login Code
      • Users
        • List Users
        • Create User
        • Get User
        • Activate User
        • Deactivate User
        • Archive User
      • Service Accounts
        • List Service Accounts
        • Create Service Account
        • Get Service Account
        • Update Service Account
        • Activate Service Account
        • Deactivate Service Account
        • Archive Service Account
      • Applications
        • List Applications
        • Create Application
        • Create Server-Signed Application
        • Get Application
        • Update Application
        • Activate Application
        • Deactivate Application
        • Archive Application
      • Personal Access Tokens
        • List Personal Access Tokens
        • Create Personal Access Token
        • Get Personal Access Token
        • Update Personal Access Token
        • Activate Personal Access Token
        • Deactivate Personal Access Token
        • Archive Personal Access Token
      • Credentials
        • Credentials Overview
        • API Reference
          • Create Credential Code
          • Create Credential Challenge
          • Create Credential Challenge With Code
          • Create Credential
          • Create Credential With Code
          • Deactivate Credential
          • Activate Credential
          • List Credentials
      • Recovery
        • Send Recovery Code Email
        • Create Recovery Challenge
        • Create Delegated Recovery Challenge
        • Recover User
    • Wallets
      • Create Wallet
      • Update Wallet
      • Delete Wallet
      • [deprecated] Delegate Wallet
      • Get Wallet by ID
      • List Wallets
      • Get Wallet Assets
      • Get Wallet NFTs
      • Get Wallet History
      • Tag Wallet
      • Untag Wallet
      • Transfer Asset
      • Get Transfer Request by ID
      • List Transfer Requests
      • Sign and Broadcast Transaction
        • Algorand
        • Aptos
        • Bitcoin / Litecoin
        • Canton
        • Cardano
        • EVM
        • Solana
        • Stellar
        • Tezos
        • TRON
        • XRP Ledger (Ripple)
      • Get Transaction Request by ID
      • List Transaction Requests
      • [deprecated] Generate Signature
      • Advanced Wallet APIs
        • Import Wallet
        • [deprecated] Export Wallet
    • Fee Sponsors
      • Create Fee Sponsor
      • Get Fee Sponsor
      • List Fee Sponsors
      • Activate Fee Sponsor
      • Deactivate Fee Sponsor
      • Delete Fee Sponsor
      • List Sponsored Fees
    • Keys
      • Create Key
      • Update Key
      • Delete Key
      • Delegate Key
      • Get Key by ID
      • List Keys
      • Generate Signature
        • Algorand
        • Aptos
        • Bitcoin / Litecoin
        • Cardano
        • Cosmos Appchain
        • EVM
        • Solana
        • Stellar
        • Substrate (Polkadot)
        • Tezos
        • TON
        • TRON
        • XRP Ledger (Ripple)
      • Get Signature Request by ID
      • List Signature Requests
      • Advanced Key APIs
        • Import Key
        • Export Key
        • Deterministic Derivation
    • Networks
      • Estimate fees
      • Read Contract
      • Validators
        • Create Validator
        • List Validators
    • Policy Engine
      • Policies Overview
      • API Reference
        • Create Policy
        • Get Policy
        • List Policies
        • Update Policy
        • Archive Policy
        • Get Approval
        • List Approvals
        • Create Approval Decision
    • Permissions
      • Permissions Overview
      • API Reference
        • Get Permission
        • List Permissions
        • Create Permission
        • Update Permission
        • Archive Permission
        • Assign Permission
        • Revoke Permission
        • List Permission Assignments
    • Webhooks
      • Create Webhook
      • Get Webhook
      • List Webhooks
      • Update Webhook
      • Delete Webhook
      • Ping Webhook
      • Get Webhook Event
      • List Webhook Events
    • Dfns Change Log
    • API Errors
  • Integrations
    • Exchanges
      • Kraken
      • Binance
      • Coinbase Prime
      • API Reference
        • Create Exchange
        • List Exchanges
        • Get Exchange
        • Delete Exchange
        • List Exchange Accounts
        • List Exchange Account Assets
        • Create Exchange Deposit
        • Create Exchange Withdrawal
    • AML / KYT
      • Chainalysis
    • Staking
      • API Reference
        • Create Stake
        • Create Stake Action
        • List Stakes
        • List Stake Actions
        • get Rewards
    • Fiat On/Off-Ramps
    • Account Abstraction on EVMs
  • Advanced Topics
    • Authentication
      • API Authentication
      • Request Headers
      • Credentials
        • Generate a Key Pair
        • User Credentials
        • Access Token Credentials
        • Storing WebAuthn Credentials in Password Managers
      • Request Signing
      • API objects
    • Delegated Signing
    • API Idempotency
    • FAQ
  • Guides
    • Passkey Settings - Migration guide
    • Keys & Multichain - Migration Guide
Powered by GitBook
On this page
  • TLDR
  • What's New
  • Keys API
  • Reuse a Key for Multichain
  • Deprecated Pseudo Networks
  • Enhanced Generate Signature
  • Changes to Wallets Permissions
  1. Guides

Keys & Multichain - Migration Guide

Last updated 1 month ago

TLDR

A Dfns managed key can now be used across different blockchains, as long as the key scheme and curve are compatible with the target chain. The primary use case is using the same key for the Ethereum ecosystem to have the same wallet address across L1 and all the L2 chains. But it doesn't stop there. You can also use the same ECDSA key for Bitcoin and TRON as well.

What's New

Keys API

Existing wallets are not impacted. The will remain mostly the same except the following endpoints, , , and , are deprecated and migrated to equivalent endpoints in the new .

Creating a new wallet automatically creates a signing key in the Dfns MPC cluster. This has always been the behavior except previously the details were hidden. Now the signing key linked to wallets are exposed as signingKey.id.

{
  "id": "wa-1f04s-lqc9q-xxxxxxxxxxxxxxxx",
  "network": "Ethereum",
  "address": "0x00e3495cf6af59008f22ffaf32d4c92ac33dac47",
  "signingKey": {
    "id": "key-6ece3-9l565-xxxxxxxxxxxxxxxx",
    "scheme": "ECDSA",
    "curve": "secp256k1",
    "publicKey": "e2375c8c9e87bfcd0be8f29d76c818cabacd51584f72cb2222d49a13b036d84d3d"
  },
  ...
}

This is the ID you use to invoke the keys endpoints where required.

Reuse a Key for Multichain

Instead of creating a new signing key when creating a wallet, if you want to create additional wallets with an existing signing key, you can pass the key id in the request body,

{
    "network": "Base",
    "signingKey": {
        "id": "key-6ece3-9l565-xxxxxxxxxxxxxxxx"
    }
}

This will create a new Base wallet, but the new wallet will reuse the same signing key and share the same address as the Ethereum wallet.

{
  "id": "wa-19bcu-r0b9h-xxxxxxxxxxxxxxxx",
  "network": "Base",
  "address": "0x00e3495cf6af59008f22ffaf32d4c92ac33dac47",
  "signingKey": {
    "id": "key-6ece3-9l565-xxxxxxxxxxxxxxxx",
    ...
  },
  ...
}

When you bridge assets between the two blockchains and the balances will update accurately in both Dfns wallets. Note that you can only create one wallet per network with a given key.

Deprecated Pseudo Networks

Enhanced Generate Signature

The new generate signature endpoint with keys is nearly identical to the previous version for wallets, except it takes in one additional field blockchainKind in some situations. The reason is that without the wallet context, it can't always know how to interpret the data format. For example, to use a key to sign an Ethereum transaction, you will provide a hint by setting the blockchainKind to Evm.

{
  "blockchainKind": "Evm",
  "kind": "Transaction",
  "transaction": "0x02e783aa36a71503850d40e49def82520894e5a2ebc128e262ab1e3bd02bffbe16911adfbffb0180c0"
}

And to sign the data as a Solana transaction instead, set blockchainKind to Solana.

One major enhancement is you can now sign complex formats with raw key signing. Before when you use a pseudo-network, the old equivalent of raw key signing, the only supported format is Hash. Now by declaring which blockchain you want to be compatible with, you can sign specific data formats with a raw key. For example, if you want to sign an EIP-712 typed message for a private blockchain with just a signing key, you can use

{
  "blockchainKind": "Evm",
  "kind": "Eip712",
  "types": {
    ...
  },
  "domain": {
    "chainId": PRIVATE_CHAIN_ID_HERE,
  },
  "message": {
    ...
  }
}

Before you would have to compute the hash digest from the typed data message yourself before it's signable by Dfns.

Changes to Wallets Permissions

The following new permission operations are added with the Keys API, some replaced the old wallets operations.

Name
Description
Note

Keys:Create

Required for creating a new key or creating a new wallet with a new signing key.

Before you only need Wallets:Create when creating a new wallet, key creation is implicit. Now you will also need Keys:Create explicitly.

Keys:Reuse

Required for creating a wallet with an existing signing key.

Keys:Delegate

Required for delegating a key to an end user.

Wallets:Delegate is deprecated.

Keys:Import

Required for importing a key.

Wallets:Import is deprecated.

Keys:Export

Required for exporting a key.

Wallets:Export is deprecated.

Keys:Signatures:Create

Required for making a key generate signature request.

Wallets:GenerateSignature is deprecated.

Keys:Signatures:Read

Required for reading signature requests.

Wallets:ReadSignature is deprecated.

Also the following operations have been renamed,

Name
Replaced

Wallets:Transfers:Create

Wallets:TransferAsset

Wallets:Transfers:Read

Wallets:ReadTransfer

Wallets:Transactions:Create

Wallets:BroadcastTransaction

Wallets:Transactions:Read

Wallets:ReadTransaction

All existing permissions are updated with the changes outlined above.

The , KeyECDSA and KeyEdDSA networks, was introduced as a way to use a raw signing key with the Wallets API. Now that Keys API is first class, this old workaround is no longer necessary. You should phase out the usage and migrate to .

Wallets API
delegate
import
export
generate signature
Keys API
concept of pseudo networks
key's generate signature