signature()
Othent JS SDK signature() function
Deprecation warning:
The signature()
function is deprecated in Othent 2.0.0
, ArConnect 1.0.0
and Arweave.app. Read about the alternatives below:
There are quite a few cases where you might need to generate a cryptographic signature for a piece of data or message so that you can verify them. The most common ones and their alternatives are the following:
Generating a signature for a transaction:
sign()
Generating a signature for a bundle data item:
signDataItem()
ordispatch()
Signing a message to later validate ownership:
signMessage()
combined withverifyMessage()
The safety of our users' wallets is our top priority, so we've decided to deprecate our signature()
function, following the example of ArConnect and Arweave.app and we expect other Arweave wallets now or in the future to do the same. Eventually, this should be a smooth transition to the new alternatives. We are sorry for any inconveniences caused by this change.
Often an application might need a piece of data that is created, authorized or confirmed by the owner of a wallet. The signature() function creates a cryptographical signature that allows applications to verify if a piece of data has been signed using a specific wallet. This function works similarly to the webcrypto sign API.
This function assumes (and requires) a user is authenticated. See requireAuth().
Tip: Not to be confused with the sign() function that is created to sign Arweave transactions.
API
data: string | BinaryDataType
data: string | BinaryDataType
The data to be signed with the user's private key.
return Promise<Uint8Array>
return Promise<Uint8Array>
A Promise containing a Uint8Array with the signed data.
Example usage
Last updated