The credential deployment contained invalid signatures

Environment:

  • NodeJS version: 18>
  • Concordium NodeSDK version: (9.4.0)
  • Network: Testnet

Description: I am integrating a wallet creation workflow using the Concordium NodeSDK, following the approach outlined in the wallet example on GitHub. The process of creating an identity and confirming it works as expected. However, I encounter an error when attempting to publish the address to the chain using the sendCredentialDeploymentTransaction function. The error message is: “The credential deployment contained invalid signatures”.

Below is a screenshot

Here is my code incase i am doing something wrong

    public async createConcordiumWallet(confirmIdentity: IdentityObjectV1) {

        const identityProviders = await fetchIdentityProviders();

        const cryptographicParameters = await this.client.getCryptographicParameters();

        if (!cryptographicParameters) {
            throw new Error('Cryptographic parameters were not found on a block that has been finalized.');
        }

        const seedPhrase = "parade exist vocal emotion slam abandon hospital snow start nest round dog envelope imitate seek reward sea true useful stadium gas usual edit tuna"

        const network = 'Testnet'; // use 'Testnet' for the testnet.

        const selectedIdentityProvider = identityProviders[0];
        const identityIndex = 1002;
        const credNumber = 0;

        const {
            idCredSec,
            prfKey,
            attributeRandomness,
            blindingRandomness,
            credentialPublicKeys,
        } = createCredentialDeploymentKeysAndRandomness(
            seedPhrase,
            network,
            selectedIdentityProvider.ipInfo.ipIdentity,
            identityIndex,
            credNumber
        );



        const credentialInput: CredentialInputNoSeed = {
            revealedAttributes: [],
            idObject: confirmIdentity,
            globalContext: cryptographicParameters,
            credNumber,
            ipInfo: selectedIdentityProvider.ipInfo,
            arsInfos: selectedIdentityProvider.arsInfos,
            attributeRandomness,
            credentialPublicKeys,
            idCredSec,
            prfKey,
            sigRetrievelRandomness: blindingRandomness,
        };


        const expiry = getDefaultTransactionExpiry();

        const workerInput: AccountWorkerInput = {
            credentialInput,
            // @ts-ignore
            expiry,
        };


        console.log({workerInput})

        const credentialTransaction = createCredentialTransactionNoSeed(
            // @ts-ignore
            workerInput.credentialInput,
            workerInput.expiry
        );

        const signingKey = getAccountSigningKey(
            seedPhrase,
            credentialTransaction.unsignedCdi.ipIdentity
        );

        const signature = await signCredentialTransaction(
            credentialTransaction,
            signingKey
        );

        const sendTx = await sendCredentialDeploymentTransaction(
            credentialTransaction,
            signature,
            this.client
        );

        const accountAddress = getAccountAddress(
            credentialTransaction.unsignedCdi.credId
        );

        console.log({accountAddress})

        return accountAddress


    }

The error occurs on the sendCredentialDeploymentTransaction line, and the code for this is as below:

export async function sendCredentialDeploymentTransaction(
    credentialDeployment: CredentialDeploymentTransaction,
    signature: string,
    client: ConcordiumGRPCClient
) {

    const signatures = [signature];

    console.log({signatures})
    const payload = serializeCredentialDeploymentPayload(
        signatures,
        credentialDeployment
    );


    return await client.sendCredentialDeploymentTransaction(
        credentialDeployment,
        signatures,
    );
}

Attempted Solutions:

  • Ensured the identity creation and confirmation processes work correctly.
  • Double-checked the input parameters for sendCredentialDeploymentTransaction.
  • Verified the integrity and format of the signature being used.

Questions:

  1. What does the error “The credential deployment contained invalid signatures” imply in this context?
  2. Is there a step in the signature generation or transaction creation process that I might be overlooking or misimplementing?
  3. Are there common pitfalls or specific considerations when using sendCredentialDeploymentTransaction in the Concordium NodeSDK that I should be aware of?

Any insights or suggestions on how to resolve this error would be greatly appreciated. Thank you in advance for your help!

What function is this getAccountSigningKey? The identity index in there must match what you used above. And if it is the one from the example then it does not match, which would lead to an invalid credential.

Okay perfect that seemed to be the issue. Thanks so much.

That works, thank you so much!.

So i get an address generated like this

However, when i use the mnemonic key used to generate this account and import it into the concordium wallet extension, i get a no identities found error. Then, after a while, i noticed an address added .
However as shown below, this is not same address as the one generated.

After the wallet generation ideally what is the next step? How do i store the private/mnemonic key to use that for future signings on behalf of users?