-
Notifications
You must be signed in to change notification settings - Fork 15
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 for the PUB_K1 public key format to v1/chain/get_fio_names #36
Comments
The following API endpoints could be modified to support this:
However, the signing and the responses will still be in the |
@aaroncox would this type of fix be beneficial to BPs despite the response data being in the FIO format? |
I believe so. At that point it might require some validation logic to be changed (if it exists), but will at least allow results to be returned to the client. |
PR Submitted |
Resolved by #64 |
You can't just replace FIO prefix with PUB_K1 because they are encoding the public key differently, You can see the difference here: https://github.com/EOSIO/eosjs/blob/master/src/eosjs-numeric.ts#L272 |
here's a better example in c++ https://github.com/EOSIO/abieos/blob/master/src/crypto.cpp#L134 |
Someone floated the idea of just adding a prefix since we still have to use this as a human-readable address people can send to. Is that doable? Something like FIO_PUB_K1_6smr7ThQMWYBHzEvkzTZdxNNmUwxqh2VXdXZdDdzYHgak1U8Di? |
It should be. Another option would be to use The code @cc32d9 mentioned would need updated, eosjs/fiojs would need updated in the same way, and eosio-core would all have to be updated. It's not a comprehensive list, but those are a few areas I immediately recognize that would need updates. |
Yeah, I like FIO_KY vs. FIO_PUB_K1. I could think of it this way: "PUB_..." is a generic public key. "FIO_..." is a specific public key. |
It'd be very helpful of the FIO specific API endpoints that deal with public keys also support the
PUB_K1
format of keys, which is what eosjs v20+ deals with internally for the most part. The endpoint I ran into where this was unsupported was the/v1/chain/get_fio_names
endpoint, though there may be others that accept public keys as inputs that this would also help support.For example, this does not currently work:
I discovered the v1 history plugin endpoints already support both, likely because the conversion is happening. Examples as follows.
Using a
PUB_K1
public key:Using a
FIO
public key:The text was updated successfully, but these errors were encountered: