# Selective Wallet Sharing

## Setup selective sharing for your app

{% stepper %}
{% step %}

### Create an internal webhook URL

In order for users to selectively share their wallets with your application, a webhook will need to be created to process `POST` requests coming from the user.

When wallets are shared with your application, you'll get the following `POST` payload:

```typescript
{
  "wallets": string[];
  "signer": string;
  "signature": string;
}
```

{% hint style="warning" %}
All signatures will be signed by `0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266`
{% endhint %}

To check the validity of the webhook requests, run the following code:

```typescript
const address = await recoverMessageAddress({
    message: JSON.stringify(selectedWallets),
    signature: attestation.signature as `0x${string}`
});
```

The `address` should match the `signer` .
{% endstep %}

{% step %}

### Retrieve a custom share URL for your app

Go to <https://clusters.xyz/share> where you will be prompted to enter the webhook URL that you just created.

{% hint style="info" %}
Your webhook URL may look something like this: `https://api.myapp.com/webhook/share`
{% endhint %}

Once you enter a URL, a unique share link can be created that you can send to your users.

<figure><img src="https://1252323684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlyBmjWRNMw3jAapqxrM%2Fuploads%2FfyaAoGCziU6SbdFsyheZ%2FClipboard-20250429-165801-011.gif?alt=media&#x26;token=e50dec80-197e-433a-8959-4aaab1d099b1" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

### Send users to the URL

They will be prompted to select which wallets they want to share. When they click "Share" the data will be sent to your webhook URL.&#x20;

Users can verify that they are sharing data to the right place but double checking the blue "Sharing with" label as seen below.

<figure><img src="https://1252323684-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FOlyBmjWRNMw3jAapqxrM%2Fuploads%2F9pbZ5tlVM6nHuo2oB8f4%2Fimage.png?alt=media&#x26;token=d9b9fea9-e6c3-48e7-b4d0-65547c33a8c1" alt=""><figcaption></figcaption></figure>
{% endstep %}
{% endstepper %}
