RandCoin

The Apex of African Digital Excellence

Forged in the heart of Azania. A cryptographically secure, pure-Python blockchain. Explicitly linked to the ZAR. Zero dependencies. Power to the Code.

Technical Architecture

Engineered for sovereignty. No bloat. Pure Power.

ZAR Native Integration

RandCoin is the first blockchain reference implementation explicitly designed for the South African Rand ecosystem. All internal accounting, rewards, and transaction fees are calculated in ZAR, creating a direct bridge between traditional finance concepts and decentralized ledger technology.

Zero-Dependency Python

We reject the complexity of modern dependency chains. RandCoin runs on standard Python libraries alone (hashlib, json, time, unittest). This ensures long-term archivability, ease of audit, and the ability to run on any hardware that supports Python 3.

Cryptographic Integrity

Security is not an afterthought. We implement O(N) Replay Protection to prevent double-spending attacks. Our Proof of Work algorithm utilizes SHA-256 with adjustable difficulty, ensuring that the ledger remains immutable and tamper-evident against malicious actors.

Financial Precision

Floating point errors are unacceptable in finance. RandCoin utilizes Python's decimal.Decimal for all monetary operations, guaranteeing distinct precision and eliminating the rounding errors common in standard floating-point arithmetic.

Use Cases

Real-world applications for the RandCoin architecture.

📚 Educational Pedagogy

RandCoin serves as the perfect "textbook" blockchain. Its clean, dependency-free code allows students and universities across Africa to dissect the anatomy of a blockchain—understanding mining, consensus, and hashing—without the noise of complex frameworks.

🔬 Financial Research

Economists and fintech developers can use RandCoin to simulate local economies. By adjusting mining rewards, difficulties, and transaction volumes, researchers can model the velocity of money within a closed ZAR-based digital ecosystem.

🏢 Private Ledgers

Organizations can fork RandCoin to create internal, immutable audit logs. The lightweight nature of the code makes it ideal for tracking supply chain provenance or inter-departmental settlements where a heavy public chain is unnecessary.

Transparent Engineering

We believe in code that speaks for itself. Review the core mining logic—simple, effective, and secure.

  • hashlib for SHA-256
  • decimal for Currency
  • json for Serialization
blockchain.py
def mine_pending_transactions(self, miner_address):
    """Mines transactions and rewards the miner."""

    block = Block(
        len(self.chain),
        self.get_latest_block().hash,
        self.timestamp,
        self.pending_transactions,
        self.difficulty
    )

    block.mine() # Proof of Work
    self.chain.append(block)

Installation & Usage

1. Clone

git clone https://github.com/rmngqibisa/RandCoin.git

2. Run

python3 main.py

3. Mine

Follow the interactive prompts to start mining ZAR on your local machine.

Frequently Asked Questions

Understanding the Eagle's Choice.

Why is it "ZAR Linked"?

We believe digital sovereignty starts with local relevance. Most blockchains default to USD or abstract tokens. RandCoin defaults to ZAR to demonstrate that African currencies can be first-class citizens in digital ledger technology.

Is this suitable for production use?

RandCoin is a robust reference implementation. While it implements real cryptographic security and mining mechanics, it is currently designed as a single-node simulation. Future versions may introduce P2P networking capabilities.

Why use standard Python libraries only?

Security and auditability. External dependencies introduce supply chain risks. By using only the Python Standard Library, we ensure that the code you read is exactly the code you run, with no hidden "black boxes."

How does the mining difficulty work?

The difficulty determines how many leading zeros the block hash must have. As more blocks are mined, this can be adjusted to maintain a steady block time, similar to Bitcoin's difficulty adjustment algorithm.

The Vision

RandCoin is a statement. A statement that Africa is not just a consumer of technology, but a creator. Built by the Apex of African Digital Excellence, this project serves as a beacon for what is possible when passion meets precision.

We are building the future of digital sovereignty, one block at a time.