> For the complete documentation index, see [llms.txt](https://suiverify.gitbook.io/suiverify/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://suiverify.gitbook.io/suiverify/suiverify-sdk.md).

# SuiVerify SDK

For Protocols Building on SuiVerify

## SuiVerify SDK

The SuiVerify SDK enables protocols to cryptographically verify identity attestations created by SuiVerify's Nautilus enclaves. Whether you're building DeFi, gaming, or social protocols that require verified identities, this SDK provides the tools to ensure DID NFTs are authentic and untampered.\
Installation

```
npm i suiverify-sdk
```

\
**How Signature Verification Works**\
\
The Verification Chain\
mermaidgraph TD\
A\[User Submits KYC] --> B\[Nautilus Enclave Verifies]\
B --> C\[Creates Cryptographic Signature]\
C --> D\[Stores in DID NFT on Sui]\
D --> E\[Protocol Uses SDK to Verify]\
E --> F\[Confirms Authenticity]\
What Gets Signed and Verified\
When Nautilus verifies an identity, it creates a deterministic message structure:\
\\

```typescript
interface SignedMessage {
intent: 1, // Fixed value for identity verification
timestamp_ms: number, // When verification occurred
payload: {
user_wallet: string, // User's Sui address
did_id: string, // Type of verification (1 = Aadhaar)
result: "verified", // Verification result
evidence_hash: Uint8Array, // Hash of verified documents
verified_at: string // ISO timestamp
}
}

```

\
\
Quick Start\
Basic Verification\\

```typescript
typescriptimport { SuiVerifySDK } from 'suiverify-sdk';
import { SuiClient } from '@mysten/sui.js/client';

// Initialize
const suiClient = new SuiClient({ url: '
https://fullnode.testnet.sui.io:443
' });
const sdk = new SuiVerifySDK({
suiClient,
network: 'testnet'
});

// Verify a DID NFT
const isValid = await sdk.verifyDIDNFT('0xnft_object_id');
console.log('NFT is authentic:', isValid);
Detailed Verification with Metadata
typescript// Get full verification details
const result = await sdk.verifyDIDNFTWithDetails('0xnft_object_id');

if (result.isValid) {
console.log('

 Verified NFT Details:');
console.log('Owner:', result.metadata.owner);
console.log('DID Type:', result.metadata.didType);
console.log('Verified At:', result.metadata.verifiedAt);
console.log('Evidence Hash:', result.metadata.evidenceHash);
} else {
console.log('

 Verification failed:', result.error);
}



 Advanced Usage
Batch Verification
typescript// Verify multiple NFTs at once
const nftIds = ['0xnft1', '0xnft2', '0xnft3'];
const results = await sdk.verifyBatch(nftIds);

results.forEach((result, index) => {
console.log(NFT ${nftIds[index]}: ${result.isValid ? '

' : '

'});
});
Custom Enclave Configuration
typescript// Use specific enclave for verification
const sdk = new SuiVerifySDK({
suiClient,
network: 'testnet',
enclaveId: '0xb0269ec10025c47c1fe9493d2f9389d4547d6a8b24d0bf16886a499bf1aa2abf'
});
Verification with Caching
typescript// Enable caching for repeated verifications
const sdk = new SuiVerifySDK({
suiClient,
network: 'testnet',
cacheResults: true,
cacheTTL: 3600 // Cache for 1 hour
});
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://suiverify.gitbook.io/suiverify/suiverify-sdk.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
