Skip to content

Latest commit

 

History

History
67 lines (58 loc) · 2.64 KB

fip-0036.md

File metadata and controls

67 lines (58 loc) · 2.64 KB
fip title status type author created updated
36
Add ability to fetch FIO Public Key for an account
Final
Functionality
Pawel Mastalerz <pawel@fioprotocol.io>
2022-01-27
2024-01-19

Abstract

This FIP adds a new getter which returns FIO Public Key which hashes to supplied account.

New getters

Endpoint Description
/get_account_fio_public_key Returns FIO Public Key which hashes to supplied account.

Motivation

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.

Specification

New getters

Get Account's FIO Public Key

Returns FIO Public Key which hashes to supplied account.

New end point: /get_account_fio_public_key

Request

Parameter Required Format Definition
account Yes EOSIO name FIO Chain account.
Example
{
  "account": "j4hmnt4nsugb"
}

Processing

  • Check fio.address->accountmap table and return FIO Public Key for supplied account name

Exception handling

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"

Response

Parameter Format Definition
fio_public_key String FIO Public Key
Example
{
	"fio_public_key": "FIO8eq4fNgKjtNwVAPHqCFdUpHLUUbZpnubLhwrWandABB27ANpmx"
}

Rationale

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.

Backwards Compatibility

No backwards compatibility issues.

Future considerations

None

Discussion link

https://fioprotocol.atlassian.net/wiki/spaces/FC/pages/473104421/Enhanced+permissions