# BizChannel -- Decentralized Ad Marketplace

BizChannel is a Pro-only feature of BizNode(TM) that lets you participate in a decentralized advertising marketplace. Pro nodes submit ad proposals, quote on others' proposals, and earn BZeUSD/MATIC for completed deals.

All communication happens through Telegram groups and email. No public IP address or port forwarding is required.

---

## How It Works

1. **Submit a proposal** -- Describe your ad, set a budget, and submit it to the network.
2. **PDF generated** -- A branded PDF proposal is created automatically.
3. **Broadcast** -- The proposal is sent to the admin Telegram group and via email.
4. **OTP verification** -- You verify the submission with a one-time password.
5. **Other nodes quote** -- Pro nodes on the network can submit quotes on your proposal.
6. **Accept a quote** -- Choose the best quote and accept it.
7. **Payment** -- Settlement via BZeUSD or MATIC on the Polygon network.

---

## Bot Commands

All BizChannel commands start with `/bo`.

| Command | Description |
|---------|-------------|
| `/bo` | Show BizChannel help and available commands |
| `/bo submit` | Submit a new ad proposal (interactive flow) |
| `/bo quote <ref> <amount>` | Submit a quote on a proposal by reference ID |
| `/bo status [ref]` | Check the status of a proposal or quote |
| `/bo proposals` | List all your submitted proposals |
| `/bo quotes` | List all your submitted quotes |
| `/bo earnings` | View your earnings summary |

---

## Submitting a Proposal

Run `/bo submit` in the bot. You will be prompted for:

- **Title** -- Short name for the ad campaign
- **Description** -- What you are advertising and your goals
- **Category** -- The ad category (e.g., product, service, event)
- **URL** -- Landing page or website for the ad
- **Budget** -- Maximum amount you are willing to pay (in BZeUSD)

After submission, a PDF is generated and sent to the admin group for review.

---

## Quoting on a Proposal

When you see a proposal from another node, submit a quote:

```
/bo quote REF-12345 50
```

This submits a quote of 50 BZeUSD on proposal REF-12345. The proposal owner will be notified and can accept or decline.

---

## Configuration

Set the following in your `.env` file:

```
# Telegram group for BizChannel proposals
BIZNODE_GROUP_ID=-100xxxxxxxxxx

# Your email for receiving proposals and notifications
OWNER_EMAIL=you@example.com

# Polygon wallet for receiving payments
POLYGON_WALLET=0xYourWalletAddress
```

- `BIZNODE_GROUP_ID` -- The Telegram group where proposals are broadcast. You will receive this ID when onboarded to the BizChannel network.
- `OWNER_EMAIL` -- Used for email delivery of proposals and quote notifications.
- `POLYGON_WALLET` -- Your wallet address on the Polygon network for BZeUSD and MATIC payments.

---

## PDF Output

Generated proposals and quotes are saved locally in:

```
bizchannel/client/outbox/
```

Each document is a branded PDF containing the full proposal or quote details. These are also sent to the Telegram group and via email.

---

## Payment Flow

All payments are settled on the Polygon network:

- **BZeUSD** -- The primary payment token for BizChannel transactions.
- **MATIC** -- Used for gas fees and as an alternative payment method.

Payments are verified on-chain. The system checks Polygonscan for transaction confirmation before marking a deal as complete.

---

## Troubleshooting

- `/bo` commands not working: See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) item 1.
- Crypto payments not processing: See [TROUBLESHOOTING.md](TROUBLESHOOTING.md) item 3.
- For other issues, contact biznodesupport@1bz.biz.
