abitCoin is a full-stack blockchain simulation for learning how secure digital transactions work. It combines a Node.js and Express API with an Angular dashboard to demonstrate wallet creation, encrypted and digitally signed transactions, proof-of-work mining, blockchain validation, tamper detection, block restoration, and simulated peer synchronization.
Educational use only: abitCoin is a learning project, not a production cryptocurrency or a system for protecting real funds and sensitive data.
- Digital wallets — generates secp256k1 public and private key pairs.
- Secure transaction demonstrations — encrypts transaction payloads with AES and authenticates transfers with ECDSA signatures.
- Proof-of-work blockchain — mines pending transactions into linked blocks and issues configurable mining rewards.
- Ledger validation — checks transaction signatures, encrypted payloads, block hashes, previous-hash links, and timestamps.
- Security evaluation — demonstrates transaction, signature, previous-hash, and timestamp tampering, then restores the original block.
- Wallet explorer — calculates balances and displays confirmed transaction history for an address.
- Network simulation — shows one miner and two full nodes synchronizing their in-memory ledgers.
- Full-stack dashboard — provides pages for blocks, transactions, wallets, mining settings, security evaluation, and network status.
- Automated verification — runs backend tests and builds the Angular application in GitHub Actions.
Angular dashboard (localhost:4200)
│
│ /api through the development proxy
▼
Node.js and Express API (localhost:3000)
│
▼
Blockchain core ──► Miner node ──► Two simulated full nodes
The Angular development server removes the /api prefix before forwarding requests to the Express API. The backend owns the main ledger and simulates delayed synchronization to the two follower nodes.
abitcoin/ Node.js API and blockchain implementation
├── blockchain.js Transactions, blocks, mining, validation, and tampering
├── network.js Three-node network and synchronization simulation
├── server.js Express API routes
├── keygenerator.js Standalone wallet key-pair generator
├── test/ Backend automated tests
└── .env.example Safe local configuration template
abitcoinui/ Angular browser application
├── src/app/pages/ Dashboard feature pages
├── src/app/components/ Reusable block and transaction views
├── src/app/services/ API and local blockchain services
├── src/app/config/ Browser demo cryptography configuration
└── proxy.conf.json Local `/api` proxy configuration
.github/workflows/ci.yml GitHub Actions verification workflow
package.json Repository-level setup, run, and check commands
- Node.js 20.19+, 22.12+, or 24.x (recommended)
- npm 10 or newer
Clone the repository and enter its directory:
git clone https://github.com/Lokezy/ABITCOIN.git
cd ABITCOINOn macOS or Linux, create the local environment file and install both applications:
cp abitcoin/.env.example abitcoin/.env
npm run setupOn Windows PowerShell:
Copy-Item abitcoin/.env.example abitcoin/.env
npm run setupnpm run setup installs the locked backend and frontend dependencies with npm ci.
The backend reads these values from abitcoin/.env:
| Variable | Default | Purpose |
|---|---|---|
AES_SECRET_KEY |
Public development key | Encrypts and decrypts transaction payloads in the demonstration |
PORT |
3000 |
Express API port |
CORS_ORIGIN |
http://localhost:4200 |
Comma-separated browser origins allowed to call the API |
The local demo key must match DEMO_AES_KEY in abitcoinui/src/app/config/crypto.config.ts. The included value is intentionally public so a fresh clone works locally. Any key delivered in browser code can be inspected by users and must not be treated as confidential.
Open two terminals in the repository root.
Terminal 1 — start the backend:
npm run start:backendTerminal 2 — start the frontend:
npm run start:frontendOpen http://localhost:4200. The API is available directly at http://localhost:3000.
- Open Create transaction. The browser creates a temporary wallet key pair when the application starts.
- Copy the public wallet address and create a signed transfer to another public address.
- Open Pending transactions and mine the transfer. The mining reward is sent to the selected reward address.
- Inspect the new block, its transactions, hashes, validation results, and wallet balances.
- Open the block's Security evaluation page and run a tampering scenario.
- Observe the failed security checks, then restore the block from its demonstration backup.
- Open Network to watch the miner and two full nodes synchronize.
- Use Settings to adjust mining difficulty and set a positive mining reward.
Refreshing the browser creates a new temporary UI wallet. To generate a standalone wallet key pair from the command line, run:
npm run keygen --prefix abitcoinKeep every generated private key secret. Only the public key should be shared as a wallet address.
The Angular application calls these routes through /api. When calling the backend directly, omit that prefix.
| Method | Route | Purpose |
|---|---|---|
GET |
/blocks |
Return all confirmed blocks |
GET |
/pendingTransactions |
Return transactions waiting to be mined |
POST |
/transactions |
Validate and add a signed transaction |
POST |
/mine |
Mine pending user transactions and start node synchronization |
GET |
/wallet/:address |
Return an address balance and transaction history |
GET, POST |
/settings |
Read or update mining difficulty and reward |
GET |
/security-status/:index |
Return validation results for a block |
POST |
/tamper/.../:index |
Run a transaction, signature, hash, or timestamp tampering scenario |
POST |
/restore/block/:index |
Restore a modified block from its in-memory backup |
GET |
/network |
Return the simulated nodes and synchronization state |
From the repository root, run:
npm run checkThis command runs the Node.js backend test suite and creates a production build of the Angular application. The same checks run automatically for pushes and pull requests through GitHub Actions.
Blockchain, pending transaction, wallet, backup, and simulated network data are stored in memory. Restarting the backend resets the ledger and all network state. Refreshing the frontend replaces its temporary browser wallet.
- Transaction authenticity is demonstrated with ECDSA signatures on the secp256k1 curve.
- AES payload encryption uses one shared demo key in both the API and browser application. Because browser-delivered keys are visible to users, this design does not provide real end-to-end confidentiality.
- The peer network is simulated inside one Node.js process; it is not a decentralized peer-to-peer network.
- The ledger has no database, durable wallet storage, distributed consensus, authentication, rate limiting, or production key management.
- Tampering and restoration routes are intentionally exposed for classroom security demonstrations.
- Do not use this project for real cryptocurrency, real funds, personal information, or other sensitive data.
If adapting the project for a private deployment:
- Forward
/api/*from the web server to the Node API and remove the/apiprefix. - Set
AES_SECRET_KEY,PORT, andCORS_ORIGINthrough the hosting environment. - Store backend secrets in the hosting provider's secret manager and never commit
.env. - Replace the browser-visible shared-key design before handling confidential information.
- Add persistent storage, authentication, authorization, request limits, monitoring, and an appropriate consensus model.
The first public project snapshot is available as abitCoin v1.0.0. Release assets such as screenshots or a demonstration video are optional and can be added later.