-
Notifications
You must be signed in to change notification settings - Fork 251
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
Add support of secp256k1 key pairs #440
Comments
With Aurora launching, this is likely becoming high priority |
It sounds like secp256k1 support in nearcore has been pushed until next quarter. We should take this time to audit the elliptic package. If it looks good we can replace |
Can you elaborate on that? On the account level we already support secp256k1 key for a while now. |
@bowenwang1996 that is just what I heard when I asked about this. I've been messing around with adding a secp256k1 key with this code: async function run() {
const account = await near.account("rnm.testnet");
const ec = new EC("secp256k1");
const kp = ec.genKeyPair();
const publicKey = `secp256k1:${base_encode(
kp.getPublic().getX().toBuffer()
)}`;
// const kp = KeyPair.fromRandom("ed25519");
// const publicKey = kp.getPublicKey().toString();
const res = await account.addKey(publicKey);
console.log(res);
} But am getting the following error:
If I do the same thing, replacing async function run() {
const account = await near.account("rnm.testnet");
const ec = new EC("ed25519");
const kp = ec.genKeyPair();
const publicKey = `ed25519:${base_encode(
kp.getPublic().getX().toBuffer()
)}`;
// const kp = KeyPair.fromRandom("ed25519");
// const publicKey = kp.getPublicKey().toString();
const res = await account.addKey(publicKey);
console.log(res);
} I can play around with it more. |
That is probably a borsh serialization issue in near-api-js |
Created issue with borsh-js. near/borsh-js#19 Waiting for feedback, then will implement a fix and implement this change |
I think we still need this, and want to bump it. Been fielding some questions from builders and believe it'd be good to remember it. This is a good lead: |
Have a draft of this in #810 |
The rollout of EVM feature implies support of EVM-native keys generation, encoding, signing and verification. Users that are familiar with Ethereum should be able to use their accounts for working with NEAR EVM implementation.
The text was updated successfully, but these errors were encountered: