Skip to main content

What it does

This helper builds the single Solana instruction that links encrypted social identity data to a TIN registry.

How the flow works

1

Caller invokes the function

The caller provides the owner, registry PDA, identity type, encryption nonce, ciphertext, and optional metadata.
2

Validation

The SDK encodes the supplied strings and byte arrays; account and signature checks occur on chain.
3

Main work

It serializes the fields with instruction tag 9 and marks the owner and registry accounts correctly.
4

Result

The caller receives a TransactionInstruction to add to an owner-signed Solana transaction.

Signature

PublicKey
required
Owner signer and writable account.
PublicKey
required
TIN registry PDA.
string
required
Identity provider type.
string
Optional label; defaults to an empty string.
Uint8Array
required
Encryption nonce.
Uint8Array
required
Encrypted identity value.
string
Metadata JSON; defaults to {}.

Result and errors

Returns one instruction. Runtime account ownership, signer, and registry-state failures are enforced by the TIN program.
Source: tins.ts:907-931