Skip to main content

Ultra-lightweight DAG blockchain optimized for IoT devices and micropayments

Project description

🚀 MicroDAG

PyPI version Python 3.8+ License: MIT

Ultra-lightweight DAG blockchain optimized for IoT devices and micropayments.

MicroDAG is a revolutionary blockchain implementation that uses a Directed Acyclic Graph (DAG) structure to achieve unprecedented efficiency and speed, making it perfect for IoT devices, micropayments, and resource-constrained environments.

✨ Key Features

  • 🏃‍♂️ Ultra-fast: <100ms transaction confirmations
  • 🪶 Lightweight: <50MB memory usage, 59KB codebase
  • 💰 No fees: Only minimal PoW for spam protection
  • 🔗 DAG structure: Parallel transaction processing
  • 🤖 IoT optimized: Perfect for Raspberry Pi, ESP32, Arduino
  • High throughput: 16,800 TPS regionally, 4,200 TPS globally
  • 🔒 Secure: Cryptographically secure with spam resistance

📦 Installation

pip install microdag

That's it! MicroDAG is now ready to use.

🚀 Quick Start

1. Create Account

microdag account create

Output:

✅ Account created successfully!
   Address: micro_a1b2c3d4e5f6789...
   Private key: 0d3d9339a986e381f611d384f10ab039...

⚠️  IMPORTANT: Save your private key securely!

2. Start Node

microdag node start

3. Send Transaction

microdag send micro_recipient123... 10.5

4. Check Balance

microdag balance micro_your_address...

🐍 Python SDK

from microdag import MicroDAG

# Connect to local node
dag = MicroDAG("microdag.db")

# Send transaction
tx_hash = dag.send("micro_recipient", 10.5)
print(f"Transaction: {tx_hash}")

# Check balance
balance = dag.balance("micro_your_address")
print(f"Balance: {balance} MICRO")

🤖 IoT Integration

Perfect for IoT devices and micropayments:

import microdag

# Connect (convenience function for IoT)
dag = microdag.connect()

# Micropayment for sensor data (0.1 cent)
dag.send("micro_sensor_device", 0.001)

Raspberry Pi Example

# Lightweight mode for Pi Zero
microdag node start --lightweight --max-memory 50MB

🏗️ Architecture

MicroDAG uses a Directed Acyclic Graph (DAG) structure instead of traditional blockchain:

  • Parallel Processing: Multiple transactions processed simultaneously
  • No Mining: Transactions confirm each other through references
  • Scalable: Performance improves with network activity
  • Efficient: Minimal computational and storage requirements

💡 Use Cases

🏭 Industrial IoT

  • Pay for sensor data in real-time
  • Machine-to-machine micropayments
  • Supply chain tracking with micro-fees

🏠 Smart Home

  • Device-to-device payments
  • Energy trading between smart meters
  • Automated service payments

🌐 Edge Computing

  • Lightweight blockchain for edge devices
  • Decentralized data marketplaces
  • API call micropayments

💳 Micropayments

  • Sub-cent transactions with minimal overhead
  • Content monetization
  • Gaming and virtual economies

📊 Performance

Metric Value
Transaction Speed <100ms confirmations
Throughput 16,800 TPS (regional)
Memory Usage <50MB (IoT mode)
Codebase Size 59KB total
Network Overhead 7-byte message headers
Transaction Size 208 bytes fixed

🔧 Advanced Usage

CLI Commands

microdag account create          # Create new account
microdag node start [port]       # Start node (default: 7076)
microdag send <to> <amount>      # Send transaction
microdag balance [address]       # Check balance
microdag add-peer <ip:port>      # Add network peer
microdag stats                   # Show statistics

Python API

from microdag import MicroDAG, connect
from microdag.core import DAG, Transaction
from microdag.crypto.keys import generate_keypair

# Generate keypair
private_key, public_key = generate_keypair()

# Create transaction
tx = Transaction.create("micro_recipient", 10.5)

# Advanced DAG operations
dag = DAG()
dag.add_transaction(tx.hash)
stats = dag.get_stats()

🛡️ Security

  • Cryptographic Security: Ed25519 signatures, Blake2b hashing
  • Spam Resistance: Multi-layer defense with minimal PoW
  • Network Security: P2P with Byzantine fault tolerance
  • Data Integrity: Cryptographic validation of all transactions

🌟 Why MicroDAG?

Traditional Blockchain MicroDAG
Sequential blocks Parallel DAG
High energy usage Minimal energy
Slow confirmations <100ms confirmations
Large resource needs IoT-optimized
Transaction fees Fee-free
Limited throughput High throughput

📚 Documentation

🤝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

📄 License

MIT License - see LICENSE file for details.

🔗 Links


Built with ❤️ for the IoT and micropayments revolution.

MicroDAG: Making blockchain accessible to every device, everywhere.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

microdag-1.0.3.tar.gz (142.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

microdag-1.0.3-py3-none-any.whl (176.9 kB view details)

Uploaded Python 3

File details

Details for the file microdag-1.0.3.tar.gz.

File metadata

  • Download URL: microdag-1.0.3.tar.gz
  • Upload date:
  • Size: 142.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for microdag-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a44df914b8961d98d7e255f526c406986237f41ad64e2d524bf5d686cb22b7d3
MD5 95db9b15a034b21c1795df5406beac3a
BLAKE2b-256 a204e7db1d7d9ced1409b560f174cb3800d7ff8b5cc0f66fd745bdfe47e03bd4

See more details on using hashes here.

File details

Details for the file microdag-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: microdag-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 176.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for microdag-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8760d22b7da707c041b8956576a71ba6183ed90feacdd2cabfe4c4b8d95d3c20
MD5 107d6c91205bab8d26894a9c42ae808c
BLAKE2b-256 f5b7171b3a4f576ce9acfe3de639abbd53b2d3fd3e76db6bf579b85cb49b1d7c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page