Sign Message and Verify
Sign and verify challenges for off-chain authentication
Note that Blocto SDK for EVM-compatible chains is still in Beta. APIs are subject to breaking changes.
Install from npm/yarn
Use web3.js
Verify Signature (personal.sign)
For single-sig wallet like MetaMask, there is only one signature returned and it's 65 bytes, e.g.,
0xca5955c4098c061254ee83deda2b50ad9209beb3af41ca405578409646134bfb2963866d6d4a814e669e028c178e87c77a1aff1b39f5bac4eb84d90740e6b8511c
We have built the tools to carry out this verification:
Use it in your dApps (usually on backend):
Demo
PersonalSign Technical Details
According to ERC-191 and ERC-1271, when receiving personalSign
request with message
, Blocto will sign:
0x19
+0x0
+[User’s wallet address]
+ hash(0x19
+0x45 (E)
+thereum Signed Message:
+len(message)
+message
)
Verify Signature (typed data sign)
According to ERC-191 and ERC-1271, when receiving typeDataSign
request, Blocto will sign:
0x19
+0x0
+[User’s wallet address]
+[typed-data-hash]
Demo
Last updated
Was this helpful?