There are various different payloads that are signed off-chain by a user or a whitelisted operator account and are verified on-chain. All payloads are expected to be signed using signPersonalMessage(message: Uint8Array). The method performs following operations on the input message bytes before signing is:
- Bcs serializes the input message bytes
- Adds intent scope bytes for personal message i.e.
[3, 0, 0] as the beginning of the bcs serialized message bytes array
- Computes hash of the message bytes using blake2
- And then signs the hash
Sui typescript SDK as well as on-chain move language provides support for creating and validating signatures using signPersonalMessage()
On Pro, the following eight payloads are signed off-chain and verified on-chain as part of different contract calls:
- Withdrawal: Can be signed using UI wallet extension on Pro front-end
- Order: Can be signed using UI wallet extension on Pro front-end
- Authorize Account: Can be signed using UI wallet extension on Pro front-end
- Adjust Margin: Can be signed using UI wallet extension on Pro front-end
- Adjust Leverage: Can be signed using UI wallet extension on Pro front-end
- Close Position: Sign by a user on front-end to close their position on a delisted market.
- Liquidate: Signed by a service on backend but a user can sign it as well (third party liquidators) not from UI but using our Python or TS SDK or can create their own signature code.
- ADL: signed by a whitelisted ADL operator to perform a deleveraging trade.
- Set Funding Rate: Signed by a service on backend
- Prune Table: Signed by guardian
- Authorize Liquidator: Signed by the guardian of the protocol
- Set Account Status: Signed by the guardian to update the account status from retail to institute.