Use Cases
Real-world examples of using Inkognito Network for privacy-preserving applications.
1. Anonymous Wallet Balance Checker
Check any wallet's balance without revealing that you're the one checking.
Why it matters: Traditional RPC providers can see which wallets you're querying, revealing your interest in specific addresses.
1import { InkognitoClient } from '@inkognito/client';
2
3async function checkBalanceAnonymously(address: string) {
4 const client = new InkognitoClient({
5 endpoint: 'https://rpc.inkognito.network',
6 mode: 'zk',
7 commitment: yourCommitment,
8 });
9
10 const balance = await client.request('getBalance', [address]);
11
12 return {
13 address,
14 sol: balance.value / 1e9,
15 lamports: balance.value,
16 };
17}
18
19// Check multiple wallets without linking queries
20const wallet1 = await checkBalanceAnonymously('Addr1...');
21const wallet2 = await checkBalanceAnonymously('Addr2...');
22const wallet3 = await checkBalanceAnonymously('Addr3...');Privacy benefit: The RPC provider cannot link these three queries together or identify who's checking.
2. Private DeFi Portfolio Tracker
Track your DeFi positions across multiple protocols without revealing your identity.
1interface DeFiPosition {
2 protocol: string;
3 tokenAccount: string;
4 balance: number;
5 usdValue: number;
6}
7
8async function getPrivateDeFiPortfolio(
9 tokenAccounts: string[]
10): Promise<DeFiPosition[]> {
11 const client = new InkognitoClient({
12 endpoint: 'https://rpc.inkognito.network',
13 mode: 'zk',
14 commitment: yourCommitment,
15 });
16
17 const positions: DeFiPosition[] = [];
18
19 for (const account of tokenAccounts) {
20 const accountInfo = await client.request('getAccountInfo', [
21 account,
22 { encoding: 'jsonParsed' }
23 ]);
24
25 if (accountInfo.value) {
26 const parsed = accountInfo.value.data.parsed;
27 positions.push({
28 protocol: 'Raydium', // Detect from owner
29 tokenAccount: account,
30 balance: parsed.info.tokenAmount.uiAmount,
31 usdValue: 0, // Calculate from price oracle
32 });
33 }
34 }
35
36 return positions;
37}
38
39// Usage
40const myTokenAccounts = [
41 'TokenAccount1...',
42 'TokenAccount2...',
43 'TokenAccount3...',
44];
45
46const portfolio = await getPrivateDeFiPortfolio(myTokenAccounts);
47console.log('Total positions:', portfolio.length);
48console.log('Portfolio:', portfolio);Privacy benefit: Your DeFi activity isn't tracked by the RPC provider.
3. Anonymous NFT Collection Monitor
Monitor NFT collections and floor prices without revealing which collections you're interested in.
1interface NFTCollection {
2 name: string;
3 floorPrice: number;
4 volume24h: number;
5 holders: number;
6}
7
8async function monitorNFTCollections(
9 collectionAddresses: string[]
10): Promise<NFTCollection[]> {
11 const client = new InkognitoClient({
12 endpoint: 'https://rpc.inkognito.network',
13 mode: 'zk',
14 commitment: yourCommitment,
15 });
16
17 const collections: NFTCollection[] = [];
18
19 for (const address of collectionAddresses) {
20 // Get collection stats
21 const programAccounts = await client.request('getProgramAccounts', [
22 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', // Token program
23 {
24 filters: [
25 { dataSize: 165 },
26 { memcmp: { offset: 0, bytes: address } }
27 ]
28 }
29 ]);
30
31 collections.push({
32 name: 'Collection Name', // Parse from metadata
33 floorPrice: 1.5, // Calculate from listings
34 volume24h: 100.5,
35 holders: programAccounts.length,
36 });
37 }
38
39 return collections;
40}
41
42// Monitor multiple collections anonymously
43const collections = await monitorNFTCollections([
44 'DeGod...',
45 'SMB...',
46 'Claynosaurz...',
47]);Privacy benefit: NFT marketplaces can't track which collections you're interested in.
4. Private Transaction History Viewer
View transaction history without revealing which wallet is yours.
1interface TransactionSummary {
2 signature: string;
3 blockTime: number;
4 status: 'success' | 'failed';
5 type: 'transfer' | 'swap' | 'stake' | 'other';
6 amount?: number;
7}
8
9async function getPrivateTransactionHistory(
10 address: string,
11 limit: number = 50
12): Promise<TransactionSummary[]> {
13 const client = new InkognitoClient({
14 endpoint: 'https://rpc.inkognito.network',
15 mode: 'zk',
16 commitment: yourCommitment,
17 });
18
19 // Get signatures
20 const signatures = await client.request('getSignaturesForAddress', [
21 address,
22 { limit }
23 ]);
24
25 // Get transaction details
26 const transactions: TransactionSummary[] = [];
27
28 for (const sig of signatures) {
29 const tx = await client.request('getTransaction', [
30 sig.signature,
31 { encoding: 'jsonParsed', maxSupportedTransactionVersion: 0 }
32 ]);
33
34 if (tx) {
35 transactions.push({
36 signature: sig.signature,
37 blockTime: sig.blockTime,
38 status: sig.err ? 'failed' : 'success',
39 type: detectTransactionType(tx),
40 amount: extractAmount(tx),
41 });
42 }
43 }
44
45 return transactions;
46}
47
48function detectTransactionType(tx: any): string {
49 // Analyze instructions to determine type
50 const instructions = tx.transaction.message.instructions;
51 // ... logic to detect transfer, swap, stake, etc.
52 return 'transfer';
53}
54
55// Usage
56const history = await getPrivateTransactionHistory('YourAddress...');
57console.log(`Found ${history.length} transactions`);
58history.forEach(tx => {
59 console.log(`${tx.type}: ${tx.signature.slice(0, 8)}...`);
60});Privacy benefit: Your transaction analysis happens privately without revealing which wallet you're auditing.
5. Anonymous AI Agent
AI agents that need to query blockchain data without revealing their purpose or ownership.
1class PrivateAIAgent {
2 private client: InkognitoClient;
3
4 constructor(commitment: bigint) {
5 this.client = new InkognitoClient({
6 endpoint: 'https://rpc.inkognito.network',
7 mode: 'zk',
8 commitment,
9 });
10 }
11
12 async analyzeWalletBehavior(address: string) {
13 // Get all transactions
14 const signatures = await this.client.request('getSignaturesForAddress', [
15 address,
16 { limit: 1000 }
17 ]);
18
19 // Analyze patterns
20 const hourly Activity = this.analyzeTimePatterns(signatures);
21 const transactionTypes = await this.categorizeTransactions(signatures);
22 const interactedProtocols = await this.findProtocols(signatures);
23
24 return {
25 totalTransactions: signatures.length,
26 hourlyActivity,
27 transactionTypes,
28 interactedProtocols,
29 riskScore: this.calculateRiskScore(signatures),
30 };
31 }
32
33 async findSimilarWallets(targetAddress: string) {
34 // Analyze behavior
35 const behavior = await this.analyzeWalletBehavior(targetAddress);
36
37 // Find similar patterns in other wallets
38 // ... AI logic ...
39
40 return similarWallets;
41 }
42
43 private analyzeTimePatterns(sigs: any[]) {
44 const hours = new Array(24).fill(0);
45 sigs.forEach(sig => {
46 const hour = new Date(sig.blockTime * 1000).getHours();
47 hours[hour]++;
48 });
49 return hours;
50 }
51
52 // ... other analysis methods ...
53}
54
55// Usage
56const agent = new PrivateAIAgent(agentCommitment);
57const analysis = await agent.analyzeWalletBehavior('TargetWallet...');
58console.log('Analysis:', analysis);Privacy benefit: AI agent activity is completely untraceable, preventing competitors from reverse-engineering your strategies.
6. Anonymous Blockchain Explorer
Build a blockchain explorer that doesn't track user queries.
1class PrivateBlockchainExplorer {
2 private client: InkognitoClient;
3
4 constructor(commitment: bigint) {
5 this.client = new InkognitoClient({
6 endpoint: 'https://rpc.inkognito.network',
7 mode: 'zk',
8 commitment,
9 });
10 }
11
12 async searchAddress(query: string) {
13 // Check if valid Solana address
14 try {
15 const pubkey = new PublicKey(query);
16
17 // Get account info
18 const accountInfo = await this.client.request('getAccountInfo', [
19 query,
20 { encoding: 'jsonParsed' }
21 ]);
22
23 // Get balance
24 const balance = await this.client.request('getBalance', [query]);
25
26 // Get recent transactions
27 const signatures = await this.client.request('getSignaturesForAddress', [
28 query,
29 { limit: 25 }
30 ]);
31
32 return {
33 address: query,
34 exists: accountInfo.value !== null,
35 balance: balance.value / 1e9,
36 owner: accountInfo.value?.owner,
37 executable: accountInfo.value?.executable,
38 recentTransactions: signatures,
39 };
40 } catch {
41 return { error: 'Invalid address' };
42 }
43 }
44
45 async searchTransaction(signature: string) {
46 const tx = await this.client.request('getTransaction', [
47 signature,
48 { encoding: 'jsonParsed', maxSupportedTransactionVersion: 0 }
49 ]);
50
51 if (!tx) {
52 return { error: 'Transaction not found' };
53 }
54
55 return {
56 signature,
57 blockTime: new Date(tx.blockTime * 1000),
58 slot: tx.slot,
59 success: !tx.meta?.err,
60 fee: tx.meta?.fee,
61 instructions: tx.transaction.message.instructions,
62 };
63 }
64}
65
66// Usage - Privacy-preserving explorer
67const explorer = new PrivateBlockchainExplorer(userCommitment);
68
69// Search without being tracked
70const address = await explorer.searchAddress('SomeAddress...');
71const transaction = await explorer.searchTransaction('SomeSignature...');Privacy benefit: Users can explore the blockchain without being profiled by the explorer service.
7. Private Airdrop Checker
Check if you're eligible for airdrops without revealing your wallet addresses.
1interface AirdropEligibility {
2 protocol: string;
3 eligible: boolean;
4 amount?: number;
5 claimed?: boolean;
6}
7
8async function checkAirdropEligibility(
9 walletAddress: string,
10 airdropPrograms: string[]
11): Promise<AirdropEligibility[]> {
12 const client = new InkognitoClient({
13 endpoint: 'https://rpc.inkognito.network',
14 mode: 'zk',
15 commitment: yourCommitment,
16 });
17
18 const eligibility: AirdropEligibility[] = [];
19
20 for (const program of airdropPrograms) {
21 // Check if eligible account exists
22 const [airdropPDA] = await PublicKey.findProgramAddress(
23 [Buffer.from('airdrop'), new PublicKey(walletAddress).toBuffer()],
24 new PublicKey(program)
25 );
26
27 const accountInfo = await client.request('getAccountInfo', [
28 airdropPDA.toString(),
29 { encoding: 'jsonParsed' }
30 ]);
31
32 eligibility.push({
33 protocol: program,
34 eligible: accountInfo.value !== null,
35 amount: accountInfo.value ? parseAirdropAmount(accountInfo.value) : undefined,
36 claimed: accountInfo.value ? parseClaimedStatus(accountInfo.value) : undefined,
37 });
38 }
39
40 return eligibility;
41}
42
43// Check all major airdrops anonymously
44const eligibility = await checkAirdropEligibility(
45 'YourWallet...',
46 [
47 'JupiterAirdrop...',
48 'DriftAirdrop...',
49 'MarginfiAirdrop...',
50 ]
51);
52
53console.log('Eligible airdrops:', eligibility.filter(e => e.eligible));Privacy benefit: Airdrop hunters can check eligibility without revealing which wallets they own.
Best Practices for Privacy
1. Use Different Commitments
1// Different commitments for different use cases
2const portfolioCommitment = generateCommitment();
3const nftCommitment = generateCommitment();
4const airdropCommitment = generateCommitment();
5
6const portfolioClient = new InkognitoClient({ commitment: portfolioCommitment });
7const nftClient = new InkognitoClient({ commitment: nftCommitment });
8const airdropClient = new InkognitoClient({ commitment: airdropCommitment });2. Combine with Tor/VPN
1// Use with Tor or VPN for IP privacy
2const client = new InkognitoClient({
3 endpoint: 'https://rpc.inkognito.network',
4 mode: 'zk',
5 commitment: yourCommitment,
6 // Route through Tor
7 proxyUrl: 'socks5://127.0.0.1:9050',
8});3. Batch Unrelated Queries
1// Batch queries to make traffic analysis harder
2const results = await Promise.all([
3 client.request('getBalance', [wallet1]),
4 client.request('getBalance', [unrelatedWallet]),
5 client.request('getAccountInfo', [randomAccount]),
6 client.request('getBalance', [wallet2]),
7]);Next Steps
- Integration Guide - Implement these examples
- API Reference - All available methods
- Privacy Best Practices - Maximize privacy