# Mine on SN46

Turn your inference API keys into Bittensor earnings.

You bring a funded API key from a supported provider, and we bring the customers. Your key runs inside a secure enclave that nobody can look into, not even us, and every token it serves earns you a share of SN46 emission.

## How it works

1. **You deploy our proxy** to a confidential VM on Phala Cloud, with your provider keys sealed inside.
2. **Customers send requests** to the SN46 router, which verifies your enclave and routes them through your proxy.
3. **Your provider answers**, and the response streams straight back to the customer.
4. **You get paid** for every token served, through Bittensor weights every 6 hours.

## Requirements

- **A Bittensor wallet** with enough TAO to register a hotkey on SN46.
- **A funded API key** from at least one [supported provider](https://docs.instantnetwork.ai/miners/providers).
- **A Phala Cloud account** to run one small confidential VM.
- **A computer with Node.js 18+**, `btcli` and the `sn46-miner` CLI (Linux, x86_64 or aarch64).

## Quick start

Already have a funded provider key and a registered hotkey? You can be live in minutes.

```sh
# 1. Install the sn46-miner CLI
curl -fsSL https://raw.githubusercontent.com/Subnet46/v2-sn46-miner-proxy/dev/install.sh | sh

# 2. Log in to Phala
npx phala@1.2.8 auth login

# 3. Put your hotkey and provider keys in a private env file
cat > proxy.env <<'ENV'
SN46_HOTKEY=<your hotkey ss58 address>
SN46_KEYS_DEEPINFRA=<your key>
ENV
chmod 600 proxy.env

# 4. Deploy the proxy with the compose file the installer put in ~/.local/share/sn46
npx phala@1.2.8 deploy -n sn46-proxy -t tdx.small -c ~/.local/share/sn46/compose.yml -e proxy.env --wait

# 5. Register your proxy and check that it's live
sn46-miner register --endpoint <your proxy url> --wallet ~/.bittensor/wallets/<wallet>/hotkeys/<hotkey>
sn46-miner status --wallet ~/.bittensor/wallets/<wallet>/hotkeys/<hotkey>
```

Once `status` shows your proxy as live, traffic starts flowing your way. Then set up [automatic updates](https://docs.instantnetwork.ai/miners/auto-update) so your proxy stays on the current release.

## Step by step

1. [Install](https://docs.instantnetwork.ai/miners/install) the `sn46-miner` CLI.
2. [Deploy on Phala](https://docs.instantnetwork.ai/miners/deploy): the compose file, your env file and the deploy.
3. [Register](https://docs.instantnetwork.ai/miners/register) your proxy with your hotkey.
4. [Add your providers](https://docs.instantnetwork.ai/miners/providers), up to 8 keys each.
5. [Turn on auto-update](https://docs.instantnetwork.ai/miners/auto-update).

Then read how [earnings](https://docs.instantnetwork.ai/miners/earnings) work, what to do when something goes wrong in [troubleshooting](https://docs.instantnetwork.ai/miners/troubleshooting), and the [provider terms](https://docs.instantnetwork.ai/miners/provider-terms).
