Back to Components

# Trade Exchange

AITBC exchange with QR payments, user management, and real-time trading capabilities

● Live
Launch Exchange

## Overview

The AITBC Trade Exchange is a crypto-only platform that enables users to exchange Bitcoin for AITBC tokens. It features a modern, responsive interface with user authentication, wallet management, and real-time trading capabilities.

### Key Features

- Bitcoin wallet integration with QR code payments
- User management with wallet-based authentication
- Real-time payment monitoring and confirmation
- Individual user wallets and balance tracking
- Transaction history and receipt management
- Mobile-responsive design

## How It Works

The Trade Exchange provides a simple, secure way to acquire AITBC tokens using Bitcoin.

#### 1. Connect Wallet

Click "Connect Wallet" to generate a unique wallet address and create your account

#### 2. Select Amount

Enter the amount of AITBC you want to buy or Bitcoin you want to spend

#### 3. Make Payment

Scan the QR code or send Bitcoin to the provided address

#### 4. Receive Tokens

AITBC tokens are credited to your wallet after confirmation

## User Management

The exchange uses a wallet-based authentication system that requires no passwords.

### Authentication Flow

- Users connect with a wallet address (auto-generated for demo)
- System creates or retrieves user account
- Session token issued for secure API access
- 24-hour automatic session expiry

### User Features

- Unique username and user ID
- Personal AITBC wallet with balance tracking
- Complete transaction history
- Secure logout functionality

## Exchange API

The exchange provides RESTful APIs for user management and payment processing.

### User Management Endpoints

`POST /api/users/login`

Login or register with wallet address

`GET /api/users/me`

Get current user profile

`GET /api/users/{id}/balance`

Get user wallet balance

`POST /api/users/logout`

Logout and invalidate session

### Exchange Endpoints

`POST /api/exchange/create-payment`

Create Bitcoin payment request

`GET /api/exchange/payment-status/{id}`

Check payment confirmation status

`GET /api/exchange/rates`

Get current exchange rates

## Security Features

The exchange implements multiple security measures to protect user funds and data.

### Authentication Security

- SHA-256 hashed session tokens
- 24-hour automatic session expiry
- Server-side session validation
- Secure token invalidation on logout

### Payment Security

- Unique payment addresses for each transaction
- Real-time blockchain monitoring
- Payment confirmation requirements (1 confirmation)
- Automatic refund for expired payments

### Privacy

- No personal data collection
- User data isolation
- GDPR compliant design

## Configuration

The exchange can be configured for different environments and requirements.

### Exchange Settings

    # Exchange Rate
    BTC_TO_AITBC_RATE=100000

    # Payment Settings
    MIN_CONFIRMATIONS=1
    PAYMENT_TIMEOUT=3600  # 1 hour
    MIN_PAYMENT=0.0001  # BTC
    MAX_PAYMENT=10      # BTC

    # Bitcoin Network
    BITCOIN_NETWORK=testnet
    BITCOIN_RPC_URL=http://localhost:8332
    BITCOIN_RPC_USER=user
    BITCOIN_RPC_PASS=password

## Getting Started

Start using the Trade Exchange in just a few simple steps.

### 1. Access the Exchange

Visit: https://aitbc.bubuit.net/Exchange/

### 2. Connect Your Wallet

Click the "Connect Wallet" button. A unique wallet address will be generated for you.

### 3. Get Testnet Bitcoin

For testing, get free testnet Bitcoin from:
testnet-faucet.mempool.co

### 4. Make Your First Purchase

- Enter the amount of AITBC you want
- Click "Create Payment Request"
- Send Bitcoin to the provided address
- Wait for confirmation
- Receive your AITBC tokens!

## Support & Resources

Find help and additional resources for using the Trade Exchange.

### Documentation

- Complete Trade Exchange Guide
- API Documentation

### Troubleshooting

- Payment not showing? Check for 1 confirmation
- Can't connect? Enable JavaScript and refresh
- Balance incorrect? Wait for blockchain sync

### Contact

- Email: andreas.fleckl@bubuit.net
- Discord: discord.gg/aitbc