Attestations
Types
Attestation (Onchain)
schemaId
string
Schema ID for this attestation.
linkedAttestationId?
string
, null
The ID of the attestation that this attestation references.
validUntil?
number
Timestamp that this attestation is valid until.
revoked?
boolean
, null
Whether or not this attestation is revoked.
recipients?
string[]
List of recipient addresses.
indexingValue
string
The indexing value of this attestation. Can be used for filtering while querying using the indexing service.
attester?
address
The attester's address.
attestTimestamp?
number
Timestamp that the attestation was created.
revokeTimestamp?
number
Timestamp that the attestation was revoked.
dataLocation?
DataLocationOnchain
Where Attestation.data
is stored. See DataLocation.DataLocation
.
data
{ [key: string]: any }
, string
If dataLocation
is ONCHAIN
, data
is the data object. Otherwise, data is a string
of the CID from the storage provider.
Attestation (Offchain)
schemaId
string
Schema ID for this attestation.
linkedAttestationId?
string
, null
The ID of the attestation that this attestation references.
validUntil?
number
Timestamp that this attestation is valid until.
revoked?
boolean
, null
Whether or not this attestation is revoked.
recipients?
string[]
List of recipient addresses.
indexingValue
string
The indexing value of this attestation. Can be used for filtering while querying using the indexing service.
attester?
address
The attester's address.
dataLocation?
DataLocationOffchain
Where Attestation.data
is stored. See DataLocation.DataLocation
.
data
{ [key: string]: any }
The data object to be stored with this attestation.
Creating Attestations
Creating an Attestation
Parameters
attestation
Attestation
An attestation object.
options?
CreateAttestationOnChainOptions
Options for creating an attestation.
CreateAttestationOnChainOptions
resolverFeesETH?
BigInt
ETH fees to be sent to the schema hook, in wei.
delegationSignature?
string
The attester's delegate signature when creating an attestation on their behalf.
getTxHash?
(txHash: `0x${string}`) => void
An optional callback that immediately returns the transaction hash.
recipientEncodingType?
RecipientEncodingType
Defines the attestation's recipient encoding type as either an address or string.
extraData?
0x${string}
Extra data that is passed to the schema hook. This data is not stored by the Sign Protocol contract.
Example
Delegating On-chain Attestation via ECDSA
Parameters
attestation
Attestation
An attestation object.
options
DelegateSignAttestationOptions
Options for delegate attestation signature.
DelegateSignAttestationOptions
chain
EvmChains
The EVM chain we are targeting.
delegationAccount?
PrivateKeyAccount
The signer account that signs the message. See viem/accounts
. If this is null, a signer from window.ethereum
will be used.
recipientEncodingType?
RecipientEncodingType
Defines the attestation's recipient encoding type as either an address or string.
rpcUrl?
string
Optional RPC URL.
walletClient?
WalletClient
Optional WalletClient
from viem to use for transactions.
Example
Retrieving an Attestation
Parameters
attestationId
string
The ID of the attestation we are trying to retrieve.
Example
Revoking Attestations
Revoke an Attestation
Parameters
attestationId
string
The ID of the attestation we are revoking.
options?
RevokeAttestationOptions
Options for revoking an attestation.
RevokeAttestationOptions
reason?
string
Reason for the revocation.
delegateSignature?
string
The user's delegate signature when revoking an attestation on their behalf.
getTxHash?
(txHash: `0x${string}`) => void
An optional callback that immediately returns the transaction hash.
Example
Delegating On-chain Revocation via ECDSA
Parameters
attestationId
string
The ID of the attestation we are revoking.
options
DelegateSignRevokeAttestationOptions
Options for delegate revoking an attestation.
DelegateSignRevokeAttestationOptions
chain
EvmChains
The EVM chain we are targeting.
delegationAccount?
PrivateKeyAccount
The signer account that signs the message. See viem/accounts
. If this is null, a signer from window.ethereum
will be used.
reason?
string
Reason for the revocation.
rpcUrl?
string
Optional RPC URL.
walletClient?
WalletClient
Optional WalletClient
from viem to use for transactions.
Example
Last updated