fip | title | status | type | author | created | updated |
---|---|---|---|---|---|---|
36 |
Add ability to fetch FIO Public Key for an account |
Accepted |
Functionality |
Pawel Mastalerz <[email protected]> |
2022-01-27 |
2022-02-23 |
This FIP adds a new getter which returns FIO Public Key which hashes to supplied account.
Endpoint | Description |
---|---|
/get_account_fio_public_key | Returns FIO Public Key which hashes to supplied account. |
FIO Chain does not support EOSIO transfer action, which takes account name as payee, and instead requires the use of trnsfiopubky action, which requires a FIO Public Key. If one wanted to send FIO Tokens to a specific account, there is currently no easy way to get the FIO Public Key which hashes down to the account name. The key could be fetched from fio.address->accountmap table, but it requires complex table query logic. This FIP sets out to simplify this task.
Returns FIO Public Key which hashes to supplied account.
Parameter | Required | Format | Definition |
---|---|---|---|
account | Yes | EOSIO name | FIO Chain account. |
{
"account": "j4hmnt4nsugb"
}
- Check fio.address->accountmap table and return FIO Public Key for supplied account name
Error condition | Trigger | Type | fields:name | fields:value | Error message |
---|---|---|---|---|---|
Invalid account | Format of FIO Account not valid. | 400 | "account" | Value sent in, i.e. "purse@alice" | "Invalid FIO Account format" |
Account not found | Supplied account does not exist in fio.address->accountmap. | 404 | "Account not found" |
Parameter | Format | Definition |
---|---|---|
fio_public_key | String | FIO Public Key |
{
"fio_public_key": "FIO8eq4fNgKjtNwVAPHqCFdUpHLUUbZpnubLhwrWandABB27ANpmx"
}
An alternative approach was considered to make transfer action callable by anyone (currently system action). This approach would require extensive modifications as transfer is called by many contracts. It would also potentially create confusion that this may be the main way to transfer tokens (as it is on most EOSIO chains). However, in FIO Chain the primary way to send tokens is trnsfiopubky action.
It was determined that adding a new getter will be the easiest and fastest way to allow sending of tokens to an account, which is anticipated to remain an edge case.
No backwards compatibility issues.
None
https://fioprotocol.atlassian.net/wiki/spaces/FC/pages/473104421/Enhanced+permissions