Skip to main content
Client for interacting with the Cultura Attestation Service. The Attestation Service manages the creation and verification of attestations that prove digital asset ownership and rights. The attestation process is a crucial first step after minting a digital asset, where creators bond tokens to validate their ownership claims.

Attestation Service

getDigitalAssetClassId()

getDigitalAssetClassId(digitalAssetAddress, digitalAssetId): Promise<number>
Gets the current classId of a digital asset. The classId is selected by the digital asset minter during attestation and determines both the initial bond requirement and the thresholds for verified rights promotion.

Parameters

digitalAssetAddress
`0x${string}` Address of the digital asset contract
digitalAssetId
bigint Token ID of the digital asset to check

Returns

Promise<number>

Remarks

The classId cannot be changed after attestation and determines the requirements for verified rights level. Currently, there is one asset class defined, with each class having its own specific requirements for initial bonds, verification thresholds, and trust factors in the verification process.

getAttestation()

getAttestation(uid): Promise<{ uid: `0x${string}`; schema: `0x${string}`; time: bigint; expirationTime: bigint; revocationTime: bigint; refUID: `0x${string}`; recipient: `0x${string}`; attester: `0x${string}`; verifierCount: bigint; revocable: boolean; data: `0x${string}`; bondedAmount: bigint; digitalAssetAddress: `0x${string}`; digitalAssetId: bigint; communityUserCount: bigint; WLVerifierCount: bigint; }>
Retrieves detailed information about an attestation by its unique identifier. Use this method to get complete information about a specific attestation, including the recipient, verifier, schema reference, and associated data.

Parameters

uid
`0x${string}` Unique identifier of the attestation to retrieve

Returns

Promise<{ uid: `0x${string}`; schema: `0x${string}`; time: bigint; expirationTime: bigint; revocationTime: bigint; refUID: `0x${string}`; recipient: `0x${string}`; attester: `0x${string}`; verifierCount: bigint; revocable: boolean; data: `0x${string}`; bondedAmount: bigint; digitalAssetAddress: `0x${string}`; digitalAssetId: bigint; communityUserCount: bigint; WLVerifierCount: bigint; }> Complete attestation data including recipient, verifier, schema, digital asset details, and bond amounts

Example

const attestation = await sdk.attestationService.getAttestation(attestationUID);
console.log('Attestation details:', attestation);

new AttestationServiceClient()

new AttestationServiceClient(publicClient, walletClient, contractAddress): AttestationServiceClient

Parameters

publicClient
walletClient
contractAddress
`0x${string}`

Returns

AttestationServiceClient

Methods

attest()

attest(attestationRequest, digitalAssetAddress, digitalAssetId, assetClass, bondAmount): Promise<{ attestationUid: `0x${string}`; rightsBoundAccount: `0x${string}`; }>
Create an attestation for a digital asset

Parameters

attestationRequest
AttestationRequest Object containing attestation details
digitalAssetAddress
`0x${string}` Address of the digital asset token contract
digitalAssetId
bigint Token ID of the digital asset being attested
assetClass
bigint Asset class ID for the attestation (affects fees and requirements)
bondAmount
bigint Amount of tokens to bond for the attestation

Returns

Promise<{ attestationUid: `0x${string}`; rightsBoundAccount: `0x${string}`; }> An object containing the unique identifier (UID) of the created attestation and the address of the deployed Rights Bound Account.

Example

const attestationRequest = {
  schema: schemaHash,
  data: {
    recipient: userAddress,
    expirationTime: BigInt(Math.floor(Date.now() / 1000) + 365 * 24 * 60 * 60),
    revocable: true,
    refUID: "0x0000000000000000000000000000000000000000000000000000000000000000",
    data: "0x"
  }
}

const attestationData = await sdk.attestationService.attest(
  attestationRequest,
  tokenAddress,
  tokenId,
  assetClass,
  bondAmount
);

sponsoredAttest()

sponsoredAttest(attestationRequest, digitalAssetAddress, digitalAssetId, assetClass, bondAmount, payer): Promise<{ attestationUid: `0x${string}`; rightsBoundAccount: `0x${string}`; }>
Create a sponsored attestation for a digital asset paid by a third party

Parameters

attestationRequest
AttestationRequest Object containing attestation details
digitalAssetAddress
`0x${string}` Address of the digital asset token contract
digitalAssetId
bigint Token ID of the digital asset being attested
assetClass
bigint Asset class ID for the attestation (affects fees and requirements)
bondAmount
bigint Amount of tokens to bond for the attestation
payer
`0x${string}` Address of the sponsor/payer

Returns

Promise<{ attestationUid: `0x${string}`; rightsBoundAccount: `0x${string}`; }> An object containing the unique identifier (UID) of the created attestation and the address of the deployed Rights Bound Account.

Example

const attestationRequest = {
  schema: schemaHash,
  data: {
    recipient: userAddress,
    expirationTime: BigInt(Math.floor(Date.now() / 1000) + 365 * 24 * 60 * 60),
    revocable: true,
    refUID: "0x0000000000000000000000000000000000000000000000000000000000000000",
    data: "0x"
  }
}

const attestationData = await sdk.attestationService.sponsoredAttest(
  attestationRequest,
  tokenAddress,
  tokenId,
  assetClass,
  bondAmount,
  payer
);

delegatedAttest()

delegatedAttest(signatureParams, attestationRequest, digitalAssetAddress, digitalAssetId, assetClass, bondAmount, delegatedAddress): Promise<{ attestationUid: `0x${string}`; rightsBoundAccount: `0x${string}`; }>
Create a delegated attestation This method allows a user to create an attestation on behalf of another account, using a signature from that account for authorization.

Parameters

signatureParams
SignatureParams Parameters for the signature verification
attestationRequest
AttestationRequest Object containing attestation details
digitalAssetAddress
`0x${string}` Address of the digital asset token contract
digitalAssetId
bigint Token ID of the digital asset being attested
assetClass
bigint Asset class ID for the attestation (affects fees and requirements)
bondAmount
bigint Amount of tokens to bond for the attestation
delegatedAddress
`0x${string}` Address that will perform the attestation on behalf of the signer

Returns

Promise<{ attestationUid: `0x${string}`; rightsBoundAccount: `0x${string}`; }> An object containing the unique identifier (UID) of the created attestation and the address of the deployed Rights Bound Account.

sponsoredDelegatedAttest()

sponsoredDelegatedAttest(signatureParams, attestationRequest, digitalAssetAddress, digitalAssetId, assetClass, bondAmount, delegatedAddress, payer): Promise<{ attestationUid: `0x${string}`; rightsBoundAccount: `0x${string}`; }>
Create a delegated attestation This method allows a user to create an attestation on behalf of another account, using a signature from that account for authorization.

Parameters

signatureParams
SignatureParams Parameters for the signature verification
attestationRequest
AttestationRequest Object containing attestation details
digitalAssetAddress
`0x${string}` Address of the digital asset token contract
digitalAssetId
bigint Token ID of the digital asset being attested
assetClass
bigint Asset class ID for the attestation (affects fees and requirements)
bondAmount
bigint Amount of tokens to bond for the attestation
delegatedAddress
`0x${string}` Address that will perform the attestation on behalf of the signer
payer
`0x${string}`

Returns

Promise<{ attestationUid: `0x${string}`; rightsBoundAccount: `0x${string}`; }> An object containing the unique identifier (UID) of the created attestation and the address of the deployed Rights Bound Account.

verifyAttestation()

verifyAttestation(attestationUID, bondAmount): Promise<`0x${string}`>
Verify an attestation by bonding tokens This method allows a verifier to stake tokens against an attestation, supporting its validity. Verifiers receive rewards for accurate verifications. A digital asset can achieve Verified Rights status when it meets either of these thresholds:
  1. Total bonded tokens reach the level requirement
  2. Number of unique verifiers reaches the minimum threshold

Parameters

attestationUID
`0x${string}` Unique identifier of the attestation to verify
bondAmount
bigint Amount of tokens to bond for the verification

Returns

Promise<`0x${string}`> Transaction hash of the verification transaction

Remarks

Important notes about the Verified Rights promotion process:
  • Only one endorsement per address is counted towards the verifier threshold
  • Endorsement amounts are cumulative for the token threshold
  • Once Verified Rights level 2 is achieved, the digital asset can be used in licensing and other trust-dependent transactions
  • Professional verifiers’ endorsements may carry additional weight in the verification process
  • The level system reflects the trust and verification achieved by the digital asset

Example

const txHash = await attestationService.verifyAttestation(
  attestationUID,
  ethers.utils.parseEther("10")
);

isWhitelistedVerifier()

isWhitelistedVerifier(address): Promise<boolean>
Check if an address is a whitelisted verifier

Parameters

address
`0x${string}` The address to check

Returns

Promise<boolean> True if the address is a whitelisted verifier, false otherwise

addWhitelistVerifier()

addWhitelistVerifier(verifierAddress): Promise<`0x${string}`>
Add a new whitelisted verifier

Parameters

verifierAddress
`0x${string}` The address to add as a whitelisted verifier

Returns

Promise<`0x${string}`> The transaction hash

isOwner()

isOwner(address): Promise<boolean>
Check if an address is the owner of the contract

Parameters

address
`0x${string}` The address to check

Returns

Promise<boolean> True if the address is the owner, false otherwise

getNonce()

getNonce(address): Promise<bigint>
Get the current nonce for an address

Parameters

address
`0x${string}` The address to get the nonce for

Returns

Promise<bigint> The current nonce as a bigint

getDigitalAssetLevel()

getDigitalAssetLevel(digitalAssetAddress, digitalAssetId): Promise<number>
Get the level of a digital asset

Parameters

digitalAssetAddress
`0x${string}` The address of the digital asset contract
digitalAssetId
bigint The token ID of the digital asset

Returns

Promise<number> The level of the digital asset (0 = unverified, 1 = basic, 2 = verified/licensable)

Remarks

The level system represents the verification status of a digital asset:
  • Level 0: Just minted - Initial state of any newly minted digital asset
  • Level 1: Attested - Digital asset creator has completed attestation, initial bond and fee paid
  • Level 2: Verified Rights - Achieved through community endorsements, meets token threshold or unique verifiers requirement
Important Notes:
  • All digital assets, regardless of classId, can achieve Verified Rights status
  • Verified Rights level 2 is required for licensing and other trust-dependent operations
  • Level status is independent of the digital asset’s classId

Example

const level = await sdk.attestationService.getDigitalAssetLevel(digitalAssetAddress, tokenId);
console.log('Digital Asset Level Status:',
  level === 0 ? 'Just Minted' :
  level === 1 ? 'Attested' :
  level === 2 ? 'Verified Rights (Licensable)' : 'Unknown'
);

removeWhitelistedVerifier()

removeWhitelistedVerifier(verifierAddress): Promise<`0x${string}`>
Remove a whitelisted verifier

Parameters

verifierAddress
`0x${string}` The address to remove from the whitelist

Returns

Promise<`0x${string}`> The transaction hash

getRightsBoundAccountFromReceipt()

getRightsBoundAccountFromReceipt(receipt): `0x${string}`
Extracts the rights bound account from a transaction receipt.

Parameters

receipt
The transaction receipt to extract the rights bound account from
logs
object[]

Returns

`0x${string}` The rights bound account address if found, zero address otherwise

getAttestationDataFromReceipt()

getAttestationDataFromReceipt(receipt): object
Extracts attestation data from a transaction receipt.

Parameters

receipt
The transaction receipt to extract the attestation data from
logs
object[]

Returns

object The attestation data including UID and rights bound account
attestationUid
attestationUid: `0x${string}`
rightsBoundAccount
rightsBoundAccount: `0x${string}`

Throws

Error if the attestation UID is not found in the logs

generateSignatureParams()

generateSignatureParams(signature, signerAddress): object
Generates signature parameters required for delegated attestation

Parameters

signature
`0x${string}` The signed message signature
signerAddress
`0x${string}` The address of the signer

Returns

object Signature parameters object with signature, signer, v, r, and s values
signature
signature: `0x${string}`
signer
signer: `0x${string}`
v
v: number
r
r: `0x${string}`
s
s: `0x${string}`

signForDelegatedAttestation()

signForDelegatedAttestation(account): Promise<{ signature: `0x${string}`; signer: `0x${string}`; v: number; r: `0x${string}`; s: `0x${string}`; }>
Signs a message for delegated attestation and returns the signature parameters

Parameters

account
`0x${string}` The account performing the signature

Returns

Promise<{ signature: `0x${string}`; signer: `0x${string}`; v: number; r: `0x${string}`; s: `0x${string}`; }> Signature parameters object with signature, signer, v, r, and s values

signForBulkDelegatedAttestations()

signForBulkDelegatedAttestations(account, numberOfSignatures): Promise<object[]>
Generates multiple signatures for delegated attestations in bulk. This is useful when you need to sign for several attestations upfront, as each signature will use an incrementing nonce starting from the signer’s current nonce.

Parameters

account
`0x${string}` The account performing the signatures.
numberOfSignatures
number The total number of signatures to generate.

Returns

Promise<object[]> A promise that resolves to an array of signature parameters objects. Each object contains the signature, signer, v, r, and s values. These signatures must be used in the order they are returned, as they correspond to sequential nonces.

Throws

Error if the wallet client is not available or if numberOfSignatures is not positive.