Sign User Message
Make sure you have set the configuration in Getting Started first.
Use of cryptographic signatures is a key part of the blockchain. They are used to prove ownership of an address without exposing its private key. While primarily used for signing transactions, cryptographic signatures can also be used to sign arbitrary messages.
FCL allows you to send an arbitrary string to a wallet provider where the user may approve signing it with their private keys.
Unlike account proof, fcl
will NOT hold that user signature for you. You have to store it yourself for verification.
We can retrieve user signatures only after user had logged in, otherwise error will be thrown.
The message could be signed by several private key of the same wallet address. Those signatures will be valid all together as long as their corresponding key weight sum up at least 1000. That's why return value above is an array.
Verify user signatures
Just like account proof, FCL-Unity includes a utility function in AppUtility
, verifyUserSignatures
, for verifying one or more user signatures against an account's public key on the Flow blockchain.
BLOCTO_FCLCRYPTO_CONTRACT_ADDRESS can be found here
Last updated