An open API service indexing awesome lists of open source software.

https://github.com/fabricioricard/bigchain

๐Ÿš€ Revolutionary blockchain that rewards users for sharing bandwidth. First proof-of-bandwidth cryptocurrency with P2P mining and real-time rewards.
https://github.com/fabricioricard/bigchain

bandwidth-sharing bigchain bigfoot-connect blockchain cryptocurrency decentralized distributed-computing earning golang internet-sharing mining p2p-network peer-to-peer proof-of-work rewards

Last synced: 23 days ago
JSON representation

๐Ÿš€ Revolutionary blockchain that rewards users for sharing bandwidth. First proof-of-bandwidth cryptocurrency with P2P mining and real-time rewards.

Awesome Lists containing this project

README

          

# ๐Ÿš€ BIGchain - BIGFOOT Connect

**A first-of-its-kind blockchain that rewards users for sharing bandwidth!**

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Go Version](https://img.shields.io/badge/Go-1.21+-blue.svg)](https://golang.org/dl/)
[![Build Status](https://img.shields.io/badge/Build-Passing-brightgreen.svg)](#)

## ๐ŸŒŸ What is BIGchain?

BIGchain is a revolutionary blockchain that combines traditional cryptocurrency mining with **real bandwidth sharing rewards**. Users earn BIG tokens by:

- ๐Ÿ—๏ธ **Mining blocks** (Proof-of-Work) - Earn 50 BIG per block
- ๐Ÿ“ก **Sharing bandwidth** - Earn BIG based on data served to peers
- ๐ŸŒ **Running P2P nodes** - Support the decentralized network

## โœจ Key Features

### ๐ŸŽฏ Unique Innovation
- **Proof-of-Bandwidth**: First blockchain to reward bandwidth sharing
- **Dual Rewards**: Mining + bandwidth sharing = double income
- **Real P2P Network**: True decentralized architecture

### ๐Ÿ”ง Technical Features
- **Pure Go Implementation**: No external dependencies
- **Thread-Safe**: Concurrent mining and P2P operations
- **REST API**: HTTP endpoints for external integration
- **Auto-Discovery**: Peer discovery and blockchain sync
- **Real-Time Monitoring**: Live bandwidth statistics

### ๐Ÿ’ฐ Economic Model
- **Mining Reward**: 50 BIG per block
- **Bandwidth Reward**: Dynamic based on MB/s ร— time ร— peers
- **Address Format**: All addresses start with "big"

## ๐Ÿš€ Quick Start

### Prerequisites
- Go 1.21 or higher
- Open ports 8333 (P2P) and 8334 (Bandwidth)

### Installation

```bash
# Clone the repository
git clone https://github.com/fabricioricard/BIGchain.git
cd BIGchain

# Build
go build -o bigchain .

# Run (Windows)
.\bigchain.exe

# Run (Linux/Mac)
./bigchain
```

### Using Make (Optional)
```bash
make build # Build the binary
make run # Run directly
make help # See all commands
```

## ๐Ÿ“– Usage

### Interactive Commands

Once BIGchain is running, you can use these commands:

- `status` - Show blockchain status
- `balance` - Show your BIG token balance
- `send` - Send BIG tokens to another address
- `connect` - Connect to a peer node
- `peers` - Show connected peers count
- `bandwidth` - Show bandwidth sharing statistics
- `help` - Show all available commands
- `quit` - Exit the node

### Example Session

```
BIGchain> status
=== BIGchain Status ===
Blocks: 5
Difficulty: 4
Is Mining: true
Node ID: big3fb0ee00539b9dd1ccb412a685150aa2
Latest Block Hash: abc123...

BIGchain> balance
Your balance: 150.75 BIG

BIGchain> send
Enter recipient address: big456...
Enter amount: 25.0
Transaction sent: 25.00 BIG to big456...
```

## ๐ŸŒ Network Ports

BIGchain uses three ports:

- **8333**: P2P network communication
- **8334**: Bandwidth sharing HTTP server
- **8080**: REST API (optional)

### Bandwidth Sharing

Your node automatically serves data on port 8334:

- `http://your-ip:8334/status` - Node statistics
- `http://your-ip:8334/data/{id}` - Serve data to peers
- `POST http://your-ip:8334/upload` - Upload data for caching

## ๐Ÿ”— REST API

BIGchain provides a REST API for external integration:

### Endpoints

- `GET /status` - Blockchain and network status
- `GET /balance?address=big123...` - Check balance
- `POST /transaction` - Submit new transaction
- `GET /mine?miner=big123...` - Mine a block
- `GET /chain` - Get full blockchain
- `GET /peers` - Get peer count
- `POST /connect` - Connect to peer

### Example API Usage

```bash
# Check status
curl http://localhost:8080/status

# Check balance
curl http://localhost:8080/balance?address=big123...

# Send transaction
curl -X POST http://localhost:8080/transaction \
-H "Content-Type: application/json" \
-d '{
"from_address": "big123...",
"to_address": "big456...",
"amount": 10.5,
"tx_type": "transfer"
}'
```

## ๐Ÿ’ป Architecture

### Core Components

- **blockchain.go** - Main blockchain logic and mining
- **block.go** - Block structure and hashing
- **transaction.go** - Transaction handling
- **bandwidth.go** - Bandwidth proof system
- **p2p.go** - Peer-to-peer network
- **bandwidth_monitor.go** - Real bandwidth monitoring
- **network.go** - REST API server
- **utils.go** - Utilities and persistence

### Data Flow

```
User Activity โ†’ Bandwidth Monitor โ†’ Proof Generation โ†’ Blockchain โ†’ P2P Broadcast โ†’ Network Rewards
```

## ๐Ÿ—๏ธ Building from Source

### Standard Build
```bash
go build -o bigchain .
```

### Production Build
```bash
make build-prod
```

### Multi-Platform Build
```bash
make build-all
```

This creates binaries for:
- Linux (AMD64, ARM64)
- Windows (AMD64)
- macOS (AMD64, ARM64)

## ๐Ÿณ Docker Support

### Build Docker Image
```bash
make docker
```

### Run with Docker
```bash
make docker-run
```

### Manual Docker Commands
```bash
docker build -t bigchain .
docker run -p 8333:8333 -p 8334:8334 -p 8080:8080 bigchain
```

## ๐Ÿค How to Earn BIG Tokens

### 1. Automatic Mining
- Keep your node running
- Automatic mining when transactions are available
- Earn 50 BIG per block mined

### 2. Bandwidth Sharing
- Your node serves data to other peers
- Automatic bandwidth monitoring
- Rewards based on: `bandwidth ร— time ร— peers_served`

### 3. Network Participation
- Connect to other nodes
- Help maintain network decentralization
- Receive transaction fees (future feature)

## ๐ŸŒ Connecting to the Network

### Join Existing Network
```
BIGchain> connect
Enter peer address (host:port): 192.168.1.100:8333
```

### Share Your Node
Give others your address: `YOUR_IP:8333`

### Network Growth
As more nodes join:
- Network becomes more decentralized
- More bandwidth sharing opportunities
- Higher earning potential

## ๐Ÿ”ง Configuration

### Environment Variables
- `BIG_DIFFICULTY` - Mining difficulty (default: 4)
- `BIG_REWARD` - Mining reward (default: 50)
- `BIG_P2P_PORT` - P2P port (default: 8333)
- `BIG_BANDWIDTH_PORT` - Bandwidth port (default: 8334)

### Config File
Create `config.json`:
```json
{
"mining_reward": 50.0,
"difficulty": 4,
"bandwidth_multiplier": 0.1,
"p2p_port": 8333,
"bandwidth_port": 8334
}
```

## ๐Ÿงช Testing

### Run Tests
```bash
make test
```

### Benchmark
```bash
make benchmark
```

### Test Bandwidth Sharing
```bash
curl http://localhost:8334/status
curl http://localhost:8334/data/test123
```

## ๐Ÿ“Š Monitoring

### Real-Time Stats
- Use `bandwidth` command for live statistics
- Monitor `/status` endpoint
- Check blockchain growth with `status` command

### Logging
BIGchain provides detailed logging:
- P2P connections
- Mining progress
- Bandwidth proofs
- Transaction processing

## ๐Ÿ›ก๏ธ Security

### Best Practices
- Run on dedicated ports
- Use firewall rules for protection
- Regular blockchain backups
- Monitor peer connections

### Backup Your Data
```bash
# Manual backup
cp blockchain.json backup_$(date +%Y%m%d).json

# Automated backup (Linux/Mac)
make backup
```

## ๐Ÿค Contributing

We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md).

### Development Setup
```bash
make setup # Install dependencies and run checks
make format # Format code
make lint # Run linter
make test # Run tests
```

### Reporting Issues
Please use GitHub Issues to report bugs or request features.

## ๐Ÿ“„ License

BIGchain is released under the MIT License. See [LICENSE](LICENSE) file for details.

## ๐ŸŽฏ Roadmap

### Phase 1 (Current)
- โœ… Core blockchain functionality
- โœ… P2P network
- โœ… Bandwidth sharing rewards
- โœ… Mining system

### Phase 2 (Coming Soon)
- ๐Ÿ”„ Enhanced peer discovery
- ๐Ÿ”„ Mobile wallet app
- ๐Ÿ”„ Block explorer web interface
- ๐Ÿ”„ Smart contracts (basic)

### Phase 3 (Future)
- ๐Ÿ“‹ Advanced smart contracts
- ๐Ÿ“‹ Decentralized storage
- ๐Ÿ“‹ Cross-chain bridges
- ๐Ÿ“‹ Governance system

## ๐Ÿ†˜ Support

- **Documentation**: Check this README and inline code comments
- **Issues**: [GitHub Issues](https://github.com/fabricioricard/BIGchain/issues)
- **Discussions**: [GitHub Discussions](https://github.com/fabricioricard/BIGchain/discussions)

## ๐Ÿ† Why BIGchain?

BIGchain isn't just another cryptocurrency - it's a **new economic model** that:

1. **Rewards Real Value**: Bandwidth sharing provides actual utility
2. **Encourages Participation**: Multiple ways to earn rewards
3. **Builds Community**: P2P network grows through cooperation
4. **Innovates Technology**: First proof-of-bandwidth blockchain

**Join the revolution! Start earning BIG tokens today!** ๐Ÿš€

---

**Made with โค๏ธ for the decentralized future**