> ## Documentation Index
> Fetch the complete documentation index at: https://docs.opaque.cash/llms.txt
> Use this file to discover all available pages before exploring further.

# Utilities and exports

> Helper functions, types, and lower-level packages re-exported from @opaquecash/opaque.

## Key derivation

```ts theme={"dark"}
import {
  SETUP_MESSAGE,
  deriveKeysFromSignature,
  keysToStealthMetaAddress,
  stealthMetaAddressToHex,
  parseStealthMetaAddress,
  computeStealthAddressAndViewTag,
  recomputeStealthSendFromEphemeralPrivateKey,
  ephemeralPrivateKeyToCompressedPublicKey,
} from "@opaquecash/opaque";
```

| Export                            | Purpose                                         |
| --------------------------------- | ----------------------------------------------- |
| `SETUP_MESSAGE`                   | Canonical wallet message for HKDF entropy       |
| `deriveKeysFromSignature`         | Viewing + spending keys from signature hex      |
| `computeStealthAddressAndViewTag` | One-time destination from meta-address          |
| `stealthMetaAddressToHex`         | Encode meta-address to 98-byte hex              |
| `generateRandomMetaAddress`       | Fresh throwaway meta-address (decoy recipients) |

***

## Unified signer

```ts theme={"dark"}
import {
  requestSetupSignature,
  selectSigner,
} from "@opaquecash/opaque";

import type {
  UnifiedSigner,
  EvmUnifiedSigner,
  SolanaUnifiedSigner,
} from "@opaquecash/opaque";
```

One adapter shape over EIP-1193, viem `WalletClient`, and Solana wallet-adapter.
`requestSetupSignature(signer)` prompts for the `SETUP_MESSAGE` signature; pass the
same shapes to `OpaqueClient.fromWallet`. See [OpaqueClient overview](/sdk/opaque-client#unified-signer).

***

## Recipient resolution

```ts theme={"dark"}
import {
  parseMetaAddressValue,
  extractMetaAddressFromDidDocument,
  ipfsPathFromInput,
  isOnsNameInput,
  isSnsNameInput,
  resolveIpfsDidMetaAddress,
  resolveEnsMetaAddress,
  resolveSnsMetaAddress,
  OPAQUE_META_RECORD_KEY,      // "com.opaque.meta"
  META_ADDRESS_VALUE_PREFIX,   // "st:opq:"
  DEFAULT_IPFS_GATEWAYS,
} from "@opaquecash/opaque";

import type { ResolvedRecipient, ResolvedRecipientSource } from "@opaquecash/opaque";
```

Building blocks behind [`client.resolveRecipient`](/sdk/stealth-api#resolverecipientinput).
`parseMetaAddressValue` validates that both 33-byte halves are real curve points.
`isOnsNameInput(name, parentName)` gates the ONS path (depth-1 subnames of the parent
in force). The Solana mirror primitives (`fetchOnsMirrorRecord`, `getOnsMirrorRecordPda`,
`onsNameHash`, `decodeOnsMirrorRecord`, `fetchSnsTxtRecord`) live in
`@opaquecash/stealth-chain-solana`.

***

## Chain deployments

```ts theme={"dark"}
import {
  getSupportedChainIds,
  getChainDeployment,
  requireChainDeployment,
  NATIVE_TOKEN_ADDRESS,
} from "@opaquecash/opaque";

const ids = getSupportedChainIds();           // [11155111]
const dep = getChainDeployment(11155111);   // registry, announcer, verifier, tokens
```

These getters read the generated `@opaquecash/deployments` registry; import that
package directly for raw addresses, ABIs, and Solana program ids. See
[Deployments](/protocol/deployments).

***

## Indexer normalization

```ts theme={"dark"}
import {
  announcementToIndexerRow,
  indexerAnnouncementToScannerRecord,
  indexerAnnouncementsToScannerJson,
} from "@opaquecash/opaque";
```

***

## PSR codecs (`@opaquecash/psr-core`)

```ts theme={"dark"}
import {
  parseFieldDefs,
  fieldDefsToString,
  computeSchemaId,
  computeUid,
  encodeAttestationData,
  decodeAttestationData,
  encodeV2AttestationMetadata,
  randomNonce,
  buildActionScope,
  externalNullifierFromScope,
} from "@opaquecash/opaque";

import type { SchemaV2, AttestationV2, FieldDef, ProofData } from "@opaquecash/opaque";
```

***

## Chain adapters

```ts theme={"dark"}
import {
  EvmAdapter,
  SolanaAdapter,
  getSolanaDeployment,
  WORMHOLE_CHAIN_ETHEREUM,
  WORMHOLE_CHAIN_SOLANA,
} from "@opaquecash/opaque";

import type { ChainAdapter, Announcement, SolanaCluster } from "@opaquecash/opaque";
```

Use adapters directly only when bypassing `OpaqueClient.scan`. Most apps should use `client.scan`.

Starknet (testnet preview) ships its adapter and call builders in
`@opaquecash/stealth-chain-starknet`, PSR proof-verification/gating helpers in
`@opaquecash/psr-chain-starknet`, and resolves deployments via
`getStarknetDeployment("sepolia")`. See [Starknet](/concepts/starknet).

***

## Solana PSR (namespaced)

Avoids `computeSchemaId` name clash with psr-core:

```ts theme={"dark"}
import { solanaPsr } from "@opaquecash/opaque";

// solanaPsr.buildRegisterSchemaInstruction, deriveSchemaPda, ...
```

***

## Prover artifacts

```ts theme={"dark"}
import {
  DEFAULT_REPUTATION_ARTIFACT_PATHS,
  DEFAULT_REPUTATION_ARTIFACTS_ORIGIN,
} from "@opaquecash/opaque";
```

Default Groth16 wasm/zkey URLs point to opaque.cash `/circuits/...`.

***

## Types reference

| Type                                                    | Description                                                  |
| ------------------------------------------------------- | ------------------------------------------------------------ |
| `OpaqueClientConfig`                                    | Client construction                                          |
| `UnifiedSigner`                                         | One wallet shape for `fromWallet` / `requestSetupSignature`  |
| `ResolvedRecipient`                                     | `resolveRecipient` result with `source` tag                  |
| `DummyAnnouncement`                                     | Decoy announcement from `generateDummyAnnouncements`         |
| `OpaqueScanChain`                                       | `"ethereum" \| "solana" \| "starknet"`                       |
| `PsrChain`                                              | Same as `OpaqueScanChain`                                    |
| `UnifiedOwnedOutput`                                    | Scan result with chain + source tags                         |
| `OwnedStealthOutput`                                    | Owned stealth output from WASM filter                        |
| `IndexerAnnouncement`                                   | Normalized indexer row                                       |
| `PrepareStealthSendResult`                              | Stealth send derivation result                               |
| `SendStealthPaymentParams` / `SendStealthPaymentResult` | High-level send                                              |
| `CreateSchemaParams` / `CreateSchemaResult`             | Schema registration                                          |
| `IssueAttestationParams` / `IssueAttestationResult`     | Attestation issuance                                         |
| `VerifyReputationArgs`                                  | Proof verification payload                                   |
| `DiscoveredTrait`                                       | PSR trait from `discoverTraitsV2` or legacy `discoverTraits` |
| `TokenBalanceSummary`                                   | Aggregated token balance                                     |
| `OutputBalance`                                         | Per-output native balance                                    |
