Transaction request
The APP can request the PKSA to sign and/or broadcast a transaction.
Before sending its request, the APP must create a "sign request data" object (sign_req_data
) it will send to the PKSA
sign_req_data
key_type
: the key type required to sign the transactions. It can be one ofposting
|active
ops
: an array of operations objects (see Hive API doc for more info)broadcast
:true
if the PKSA must broadcast the transaction to the blockchain.false
if the PKSA must return a signed transaction but not broadcast it to the blockchain.nonce
: current UNIX time in ms (Date.now()
in Javascript). If a transaction request ever fails, do NOT reuse thesign_req_data
object before first updating the nonce!
The APP must then encrypt the sign_req_data
object using the encryption key previously shared with the PKSA (auth_key
). By encrypting the sign_req_data
object, the HAS will be unaware of what's going on between the app and the PKSA and unable to tamper with the sign request process.
Finally, the APP sends its request to the HAS using the following message:
sign_req
account
: the Hive account name that must sign the transactionsdata
: the Base64 representation of an encryptedsign_req_data
objecttoken
: the authentication token - Deprecated since protocol V1
The HAS will reply with a sign_wait
message:
sign_wait
uuid
: a unique identifier given by the HAS to the requestexpire
: UNIX time when the request will expire
Signing transactions using delegated authority
Authority delegation on the Hive blockchain allows users to grant specific permissions to others, enabling them to sign transactions or perform actions on their behalf while retaining control over their account.
This can be easily achieved with HiveAuth.
Let's assume that the @alice account has delegated authority to @bob's account and that @bob wants to broadcast transactions to the blockchain on behalf of @alice.
create one or multiple operations using
"alice"
as the operation initiator, then add them to thesign_req_data
create a
sign_req
object and use"bob"
as the signing account.
Last updated