OnBlock Agency Account (OAA)
For IOST blockchain, we have
onblockp2 as OAA currently. But you may not rely on them, because we may have more OAAs later.
How does OnBlock confirm how much token users spend?
When sending transactions on behalf of users, OAA will deduct transaction fees from users’ balance. On IOST, this fee is the value of amount_limit in transaction, while“*”as well as "unlimit" will be neglected.
How does frontend call contract?
The recipient must be a contract in order to receive transactions from OAA where the last parameter of the contract receives OID information and the last parameter in transaction parameter list to be the according user’s OID.
How to send rewards to users?
Senders must transfer to the user’s OAA and include OID in the memo when transferring. Our convention is that OID must be at the beginning of the user’s memo, and be separated from other information by space. It can be any character after the space.
Only some minor changes are required for an existing Dapp to go aboard on OnBlock. Take Dice Game, a typical category in blockchain world, as an instance. Changes required are as follow:
- Accept the OID information with the last parameter of the bet function and store it in the bet record.
- OID information must be included in the memo when sending rewards to OAA if the user wins.
- The back end uses the common way to draw a prize. OID information can be obtained from contract records if need to record the specific user.