Signature and verification
The Loopring wallet is a smart contract wallet. Its address is a contract wallet address. There is an owner who controls the wallet.
The wallet signature is signed by the owner, and the contract records the owner. Although the signature is actually signed by the owner you cannot get the owner, so you need to verify the signature through the wallet contract.
Loopring also has a counterfactual wallet, which means the wallet's contract hasn't been deployed. To deploy the contract, you need to get the actual owner from the Loopring server.
You can verify the signature one by one (use contract wallet verification and counterfactual wallet verification), if one of the two passes the signature is verified.
The signature is a little different from EOA wallets, and it can also be verified by the wallet contract.
We append 02 or 03 after the signature, for example, the signature is: 0x05b49f99ac6d8f67d4519dfaf9b545dbc775dcc837441f85ef9aae74c83e5c2d700729cdba1d7a9cc818abb43a598cf1e4eeca547e4e6697ff18c4d2ac111ac21b02
02 means the signature is sign the message directly: ecdsaSign(message)
03 means the signature is like personal_sign in ethereum, ecdsaSign(sha256($ethereum_header + message))
Contract Wallet
There is a need to call the contract (wallet address) to verify the signature is EIP1271 standard:
The verify flow:
Counterfactual Wallet
Use the address to get owner info
Endpoint
(goerli is uat2.loopring.io, mainnet is api3.loopring.io):
Response:
So the signature is signed by the walletOwner. you can use ecrecover to verify the signature:
if the signature ends with 02: the recover message is the message
if the signature ends with 03: the recover message is sha256($ethereum_header + message)
Test Env: Goerli
Android apk:
Last updated