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:
- What does the error “The credential deployment contained invalid signatures” imply in this context?
- Is there a step in the signature generation or transaction creation process that I might be overlooking or misimplementing?
- 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!