Skip to content

Instantly share code, notes, and snippets.

@limemloh
Last active February 27, 2024 11:48
Show Gist options
  • Save limemloh/8c0c55f67cf5a83ac7cc21cb646e65c1 to your computer and use it in GitHub Desktop.
Save limemloh/8c0c55f67cf5a83ac7cc21cb646e65c1 to your computer and use it in GitHub Desktop.
Concordium instructions to update keys using concordium-client

Update account keys

This is a guide for updating the keys for a Concordium account which uses a single credential.

Finding the credential registration ID

First we need to get the credential registration ID of the account that we are updating keys for.

Run the following command where you replace <Account-name-or-account-address> with your account:

concordium-client account show <Account-name-or-account-address>

This will output something like:

Address:                3G5srtaeRvy2uzyaiheY3ZZ6nqTkDg1kRm59xWVnFo8CoEiZ6Y
Balance:                1001736.135182 CCD
Nonce:                  16
Encryption public key:  b14cbfe44a02c6b1f78711176d5f437295367aa4f2a8c2551ee10d25a03adc69d61a332a058971919dad7312e1fc94c5a411f21ab3b0962c6fb664212e41769e83c82288515f16ca72c86f8a03e87531cae46394bffc63ab6168432903d79fb0

Baking or delegating stake: no

Credentials:
* <credential-registration-id>:
  - Index: 0
  - Expiration: Jun 2023
  - Type: normal
  - Revealed attributes: none

Whatever is there below Credentials: instead of the <credential-registration-id> is what we want.

Sending transaction to update key of an account

To send the transaction for updating keys use:

concordium-client account update-keys --credId "<credential-registration-id>" --sender <Account-name-or-address> ./update-keys.json

where update-keys.json is a file of the following format:

{
    "keys": {
        "0": {
            "verifyKey": "<Hex encoding of public key from fireblocks>"
        }
    },
    "threshold": 1
}

This will replace the current key tied to the account with the key from fireblocks, i.e. disabling the current key.

If instead both the current key and the fireblocks key needs to be active, add the current key as well to the update-keys.json file:

{
    "keys": {
        "0": {
            "verifyKey": "<Hex encoding of public key already on chain>"
        },
        "1": {
            "verifyKey": "<Hex encoding of public key from fireblocks>"
        }
    },
    "threshold": 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment