EOSIO / EOSIO/eosjs-ecc

Can the toPublic method add an pubkey_prefix parameter for user-defined use?

Open
#57 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
289
Forks
117
PR merge metrics
No merged PRs in 30d

Description

https://github.com/EOSIO/eosjs-ecc/blob/2063257e8d02e82ce4ca1d0fdadf451281b33d1e/src/key_private.js#L62

### Original edition
```
function toPublic() {
if (public_key) {
// cache
// S L O W in the browser
return public_key
}
const Q = secp256k1.G.multiply(d);
return public_key = PublicKey.fromPoint(Q);
}
```
### Revised
```
function toPublic(pubkey_prefix = 'EOS') {
if (public_key) {
// cache
// S L O W in the browser
return public_key
}
const Q = secp256k1.G.multiply(d);
return public_key = PublicKey.fromPoint(Q, pubkey_prefix );
}
```

https://www.bcskill.com/index.php/archives/700.html

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.