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

# Railgun Relayer Unshield

Gasless unshield ERC20 tokens from Railgun private balance to any public address. B3OS relayer pays gas; fee deducted from token amount. No ETH required on recipient. Ideal for: anonymous gas funding, fresh wallet funding, privacy-preserving distributions.

![Railgun Relayer Unshield logo](https://cdn.b3.fun/b3os-icons/railgun.png)
Catalog action EVM Onchain railgun

Gasless unshield ERC20 tokens from Railgun private balance to any public address. B3OS relayer pays gas; fee deducted from token amount. No ETH required on recipient. Ideal for: anonymous gas funding, fresh wallet funding, privacy-preserving distributions.


## At a Glance

| Field | Value |
| --- | --- |
| Action ID | `railgun-unshield-via-relayer` |
| Category | EVM Onchain |
| Connector | `railgun` |
| Requires gas | No |
| Funds movement | None declared |
| Tags | `blockchain`, `privacy`, `railgun`, `unshield`, `zk`, `gasless`, `relay`, `wallet-funding` |

## Payload Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `chainId` | `number` | Yes | Chain ID. Supported: Ethereum \(1\), BNB Chain \(56\), Polygon \(137\), Arbitrum \(42161\) |
| `tokenAddress` | `string` | Yes | ERC20 token address to unshield \(e.g., WETH address\) |
| `amount` | `string` | Yes | Total amount to unshield in wei \(relayer fee is deducted, recipient receives amount minus fee\). When deductRelayerFee is true, the actual unshield total is reduced by the fee percentage first. |
| `recipientAddress` | `string` | Yes | Public address to receive unshielded tokens |
| `deductRelayerFee` | `boolean` | No | When true, subtracts the relayer fee from the input amount before unshielding. Use this when passing the full private balance as amount — ensures unshield succeeds by leaving room for the broadcaster fee. Without this flag, amount is treated as the total to unshield \(fee included\). |

## Result Schema

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | `string` | Yes | Status of the unshield operation |
| `transactionHash` | `string` | No | Transaction hash of the unshield on-chain |
| `blockNumber` | `number` | No | Block number where the transaction was confirmed |
| `relayerFee` | `string` | No | Fee deducted by relayer in token wei |
| `amountReceived` | `string` | No | Amount received by recipient after relayer fee \(in wei\) |
| `gasUsed` | `string` | No | Gas used for the unshield transaction |
| `proofTime` | `number` | No | Time taken to generate ZK proof in milliseconds |
| `errorCode` | `string` | No | Error code if status is error |
| `errorMessage` | `string` | No | Error message if status is error |

## Examples

**Workflow node**

```json
{
  "type": "railgun-unshield-via-relayer",
  "payload": {
    "chainId": 1,
    "tokenAddress": "0x0000000000000000000000000000000000000000",
    "amount": "1000000",
    "recipientAddress": "0x0000000000000000000000000000000000000000"
  },
  "children": [],
  "connector": {
    "type": "railgun",
    "id": "conn_railgun"
  }
}
```
  **Test with API**

```bash
curl -X POST "https://api.b3os.org/v1/actions/railgun-unshield-via-relayer/test" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "inputs": {
    "chainId": 1,
    "tokenAddress": "0x0000000000000000000000000000000000000000",
    "amount": "1000000",
    "recipientAddress": "0x0000000000000000000000000000000000000000"
  }
}'
```

**Use expressions for dynamic values**

Payload fields can use workflow expressions such as `{{$trigger.body.amount}}`, `{{$nodes.fetch.result.price}}`, and `{{$props.asset}}` when the value should come from a trigger, prior node, or reusable workflow prop.