Links

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: string
ops: Array
broadcast: boolean
nonce: number
}
Properties
  • key_type: the key type required to sign the transactions. It can be one of posting|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 the sign_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

{
cmd: "sign_req"
account: string
data: string
token: string // DEPRECATED - protocol < 1 only
}
Properties
  • account: the Hive account name
  • data: the Base64 representation of an encrypted sign_req_data object
  • token: the authentication token - Deprecated since protocol V1
The HAS will reply with a sign_wait message:

sign_wait

{
cmd: "sign_wait",
uuid: string,
expire: number
}
Properties
  • uuid: a unique identifier given by the HAS to the request
  • expire: UNIX time when the request will expire