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.1.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.1-py3-none-any.whl (176.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: microdag-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 6d4f43a63b4cee7ffece02c271f1b0dfc6a295560865f7b4bb8ad1134882979e
MD5 8ac642ff0629148cc8212350d8b96e8e
BLAKE2b-256 d945818bd33186362c6b573c2b8086c8f5979d2a434eaf6cd0f9a38a03e12668

See more details on using hashes here.

File details

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

File metadata

  • Download URL: microdag-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 cebaaa0317620d8827b504c68db35e6b6c2d2359209708fe323d089eefdb86e5
MD5 8390177be835951dee4a09cca2a8800c
BLAKE2b-256 a0e831811d5b88e3fa6f9cb3eec35ebc5cae59135a72afac11636755ea189fa1

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