-
Notifications
You must be signed in to change notification settings - Fork 59
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
Generator of three words identifiers #65
Conversation
|
||
export default address => { | ||
const bytes = decodeBase58Check(address.split('$')[1]) | ||
let entropy = bytes.readUInt32BE(bytes.length - 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if this function receives two different addresses with the same entropy? Looks like it would return the same words. Maybe each word should be based on separate entropy (i.e. different bytes of the buffer)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this function will return the same words if addresses have the same 4 last bytes, but it should be quite difficult for the attacker to generate a key pair with the same last bytes.
Also, this implementation does not protect against typos. Maybe aeternity accounts addresses are already somehow protected against typos?
Entropy can be generated based on the hash of an address or we can use account address as randseed like Status does, but as I understand the generation of such identifier is much cheaper than a generation of key pair so even if we will use the whole address as entropy still will be possible to generate different address with the same identifier, but without corresponding private key. Of course, we can increase the complexity of identifier generation algorithm, but it can decrease the performance of our apps in some cases.
@jsnewby could you please elaborate whether this shall be part of the SDK? |
My opinion is that this ought to be separate from the SDK, as the SDK should be application-agnostic, and this seems to belong to the aepps. Does anyone strongly disagree? |
Three words identifiers are not only for Base aepp. Usefulness of this feature depends on the number of applications that supports it. I think it should be defined as a standard on the level of aepp SDK. |
aa38c9e
to
17ade19
Compare
17ade19
to
57fe10c
Compare
closed due to inactivity and age. Opened issue #168 in favour of this idea. |
@ricricucit why we can't merge this PR? It is ready to be used in the Base app and other aepps. |
|
||
export default address => { | ||
const bytes = decodeBase58Check(assertedType(address, 'ak')) | ||
let entropy = bytes.readUInt32BE(bytes.length - 4) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it is more accurate to use dividedToIntegerBy
and modulo
from bignumber.js with the whole address instead of working with the last 4 bytes.
Close due to inactivity |
Word lists taken from here.
https://www.pivotaltracker.com/story/show/157082201