> ## Documentation Index
> Fetch the complete documentation index at: https://trust-link-tsn.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# buildLinkVerifiedSocialIdentityInstructions — Link proof

> Build the Ed25519 proof and TIN registry instructions needed to link a platform-verified encrypted social identity.

## What it does

This helper returns two instructions: an Ed25519 verification instruction for the platform signature and a TIN registry instruction that stores the encrypted identity link.

## How the flow works

<Steps>
  <Step title="Caller invokes the function">The caller supplies the owner, registry, platform public key and signature, proof message, encrypted payload, and metadata.</Step>
  <Step title="Validation">The platform proof is placed first so the registry program can inspect the instruction sysvar and verify it.</Step>
  <Step title="Main work">The SDK encodes the identity fields and creates the platform proof plus registry instruction.</Step>
  <Step title="Result">The caller adds both returned instructions to one transaction and has the owner sign it.</Step>
</Steps>

## Signature

```ts theme={null}
export function buildLinkVerifiedSocialIdentityInstructions(params: {
  owner: PublicKey; registry: PublicKey; platformPubkey: PublicKey;
  platformSignature: Uint8Array; proofMessage: Uint8Array;
  identityType: TinSocialIdentityType; label?: string; nonce: Uint8Array;
  ciphertext: Uint8Array; metadata?: string; platformRegistry?: PublicKey;
  programId?: PublicKey | string | null;
}): TransactionInstruction[]
```

<ParamField path="owner" type="PublicKey" required>Owner signer and writable identity authority.</ParamField>
<ParamField path="registry" type="PublicKey" required>TIN identity registry PDA.</ParamField>
<ParamField path="platformSignature" type="Uint8Array" required>Ed25519 signature over `proofMessage`.</ParamField>
<ParamField path="proofMessage" type="Uint8Array" required>Canonical platform proof message.</ParamField>
<ParamField path="identityType" type="string" required>Social identity provider type.</ParamField>
<ParamField path="label" type="string" required={false}>Optional public label; defaults to an empty string.</ParamField>
<ParamField path="nonce" type="Uint8Array" required>Encryption nonce.</ParamField>
<ParamField path="ciphertext" type="Uint8Array" required>Encrypted identity value.</ParamField>
<ParamField path="metadata" type="string" required={false}>Metadata JSON; defaults to `{}`.</ParamField>

## Result and errors

The result is two Solana instructions. The function itself has no named error branch; invalid instruction data or an invalid platform proof is rejected during transaction execution.

```ts theme={null}
const instructions = buildLinkVerifiedSocialIdentityInstructions(params);
transaction.add(...instructions);
```

Source: [`tins.ts:982-1023`](https://github.com/Trustlink-Labs/TSN-Protocol/blob/main/tsn-protocol/sdks/tsn-sdk/src/tins.ts#L982-L1023)
