> For the complete documentation index, see [llms.txt](https://developer.branta.pro/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.branta.pro/tech/api/receive.md).

# Receive

{% openapi src="/files/gQ1HTpwMEPLktk3mMzZ9" path="/payments" method="post" %}
[openapi-receive.json](https://2482615079-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FWfLyw4XD5FjUVq3GxTZN%2Fuploads%2Fgit-blob-a225e601e4436cc24d828058e685a6500626536f%2Fopenapi-receive.json?alt=media)
{% endopenapi %}

## Zero Knowledge

Encrypt the destination before `POST`. A send lookup of a bare address is `unknown`. The [SDK](https://github.com/BrantaOps/docs/tree/main/sdk.md) encrypts for you. HTTP callers use this algorithm:

```javascript
async function encrypt(value, secret) {
  const keyData = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(secret));
  const key = await crypto.subtle.importKey('raw', keyData, { name: 'AES-GCM' }, false, ['encrypt']);

  const iv = crypto.getRandomValues(new Uint8Array(12));
  const encrypted = await crypto.subtle.encrypt(
    { name: 'AES-GCM', iv: iv },
    key,
    new TextEncoder().encode(value)
  );

  const combined = new Uint8Array(iv.length + encrypted.byteLength);
  combined.set(iv, 0);
  combined.set(new Uint8Array(encrypted), iv.length);

  return btoa(String.fromCharCode(...combined));
}
```

```javascript
const address = '1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa';
const secret = crypto.randomUUID();

await encrypt(address, secret);
// Result:
// LQdBBewrzglmPYwUVoSjBJihA/Br8o+T1ArXGLaAuh7yJiW2dClzSBSUbUH1zhPo1WUBtr7JaFQ7wkK7CG4=
```
