Account registration
The PKSA can register one or more accounts and do it either by issuing one command with multiple accounts or by issuing one command per account.
The PKSA sends the following message to the HAS:
register_req
app
: can contain any value identifying the PKSAaccounts
an array that can contain one or moreaccount
objectsname
: the Hive account namepok
: the current UNIX time encrypted using the account private key and the HAS server public key (see Proof of Key)
The Proof Of Key sent to the HAS for each account enables it to verify that the PKSA has access to the private keys of the account it wants to register.
This prevents malicious actors from creating a PKSA, registering accounts for which they do not have private keys, and sniffing requests relayed by the HAS.
The register_req
command can be issued multiple times. If an account is already registered, the command will be ignored.
When multiple accounts are registered at the same time, the HAS server will check that ALL provided accounts exist on the Hive blockchain and return an error if any of them does not exist and cannot be registered.
For each successfully registered account, the HAS server will reply with the following message:
register_ack
account
: the account that has been successfully registered
Timing
The account registration can be performed before or after the HIVE applications will issue related authentication or transaction requests.
a) If the PKSA registration occurred before the requests are issued, it will receive those requests immediately.
b) If no PKSA is registered when the HAS receives authentication or transaction requests, it will queue them, waiting for a PKSA to register. If no PKSA registers before they expire, requests are discarded.
In both cases, (a) and (b), the APP will be notified of the requests' pending or expired status.
Last updated