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.0.tar.gz (142.0 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.0-py3-none-any.whl (176.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: microdag-1.0.0.tar.gz
  • Upload date:
  • Size: 142.0 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.0.tar.gz
Algorithm Hash digest
SHA256 1a347b6e02c9215cdd575ffc2db75fb0dd255876d3f4cfb0597eda1c5babd541
MD5 ead0a41cb341dd1a36ff8d93f1d9a16f
BLAKE2b-256 b76000e05e21ebd0069035804944120676820cf2283b7ac0f138c1621d4cc597

See more details on using hashes here.

File details

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

File metadata

  • Download URL: microdag-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 176.6 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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc153a3c9571040561ac2adae02b81bc560529ec48559bacce5fb9ad2250c108
MD5 3d4487cbcb8e1ce5b1c3efec8f43a548
BLAKE2b-256 61d83f8c7225d2fa63c7865910e6a36d58f0d8c7ce76e5874166a46901f2640b

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