Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] - Replace EdDSA with ECDSA for vertex cryptographic signing function #478

Open
magnified103 opened this issue Feb 18, 2025 · 0 comments · May be fixed by #492
Open

[FEATURE] - Replace EdDSA with ECDSA for vertex cryptographic signing function #478

magnified103 opened this issue Feb 18, 2025 · 0 comments · May be fixed by #492
Assignees
Labels
feature New feature or request

Comments

@magnified103
Copy link
Contributor

Problem Description

Currently we're using EdDSA (using the ed25519 curve) for vertex signing.

async signWithEd25519(data: string): Promise<Uint8Array> {
if (!this._ed25519PrivateKey) {
throw new Error("Private key not found");
}
const signature = await this._ed25519PrivateKey.sign(uint8ArrayFromString(data));
return new Uint8Array(signature);

This signature scheme requires public keys to be known before verification.

Proposed Solution

ECDSA (using the secp256k1 curve) does not have this issue, as the public key can be derived from the signature (vertex.signature), the original data (vertex.hash), and the recovery ID (which is typically embedded in the signature).

The public key then will be verified against vertex.peerId. In order to do that,

const tmp = this._config.private_key_seed.padEnd(32, "0");
privateKey = await generateKeyPairFromSeed("Ed25519", uint8ArrayFromString(tmp));

should be changed to secp256k1.

Implementation PR

No response

Reference Issues

No response

Unresolved questions

No response

Additional Information

No response

@magnified103 magnified103 added the feature New feature or request label Feb 18, 2025
@d-roak d-roak added this to DRP Feb 18, 2025
@github-project-automation github-project-automation bot moved this to 🔮 Backlog in DRP Feb 18, 2025
@trungnotchung trungnotchung self-assigned this Feb 19, 2025
@d-roak d-roak moved this from 🔮 Backlog to ⚙️ In Progress in DRP Feb 19, 2025
@trungnotchung trungnotchung linked a pull request Feb 19, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants