go-blockchain

command module
v0.0.0-...-41b04f3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2024 License: MIT Imports: 30 Imported by: 0

README

Go-Blockchain

Go-Blockchain is an advanced blockchain platform built using Go. It is designed to provide a robust, secure, and extensible framework for developing blockchain-based applications. The platform includes comprehensive features such as smart contracts, decentralised identity management (DID), multi-signature transactions, and a gamification system to incentivise user participation.

Key Features

1. Blockchain Core
  • Efficient Data Structure: Utilizes a Merkle tree for transaction validation and efficient data storage.
  • Consensus Mechanisms: Supports multiple consensus algorithms, including Proof of Work (PoW) and Proof of Stake (PoS).
  • Dynamic Difficulty Adjustment: Automatically adjusts mining difficulty based on network conditions.
  • Optimized Block Size: Configurable maximum block size for scalability and performance.
2. Smart Contracts
  • Custom DSL: Write and deploy smart contracts using a domain-specific language (DSL).
  • Contract Execution Engine: Executes contracts within a virtual machine, supporting functions like SET, ADD, and CALL.
  • Persistent State Management: Smart contracts can maintain state across transactions.
3. Decentralized Identity (DID)
  • DID Registry: Register and manage digital identities on the blockchain.
  • Authentication: Authenticate users using cryptographic signatures.
  • Attribute Management: Store and manage identity attributes securely on the blockchain.
4. Multi-Signature Transactions
  • Enhanced Security: Require multiple signatures for transaction approval, increasing security.
  • Flexible Configuration: Specify the number of required signatures and expiration times for transactions.
  • UTXO Integration: Validate multi-signature transactions against the UTXO (Unspent Transaction Output) set.
5. Gamification
  • User Engagement: Reward users with points for participating in the network (e.g., mining, voting, and transactions).
  • Cooldown Mechanism: Prevent abuse by enforcing cooldown periods between actions.
  • Pattern Detection: Detect and respond to suspicious patterns of activity.
6. Secure Networking
  • TLS Encryption: Ensure secure communication between nodes using TLS (Transport Layer Security).
  • Peer Discovery: Automatically discover and connect to other nodes in the network.

Getting Started

Prerequisites
  • Go: Make sure you have at least Go 1.23.0 installed. You can download it here.
Installation
  1. Clone the Repository:

    git clone https://github.com/Dyst0rti0n/go-blockchain.git
    cd go-blockchain
    
  2. Build the Project:

    go build -o go-blockchain
    
  3. Or Run:

    go run .
    
Running a Node
  1. Start a Node:

    ./go-blockchain -node localhost:8080
    
  2. Connect to Peers:

    ./go-blockchain -node localhost:8080 -peers "localhost:8081,localhost:8082"
    
Using the Blockchain
  1. Create a Transaction:

    Enter choice: 1
    Enter sender: alice
    Enter recipient: bob
    Enter amount: 50
    Enter fee: 1
    
  2. Mine a Block:

    Enter choice: 2
    
  3. Deploy a Smart Contract:

    Enter choice: 4
    Enter smart contract code: SET key value
    
  4. Execute a Smart Contract:

    Enter choice: 5
    Enter smart contract ID: <contract-id>
    Enter method name: CALL
    
  5. Print the Blockchain:

    Enter choice: 3
    
Contributing

We welcome contributions! Please see the Contributing Guidelines for more details on how to get started.

Supporting the Project

If you find this project useful, please consider supporting it. See SUPPORT.md for more details.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Contact

For any inquiries, please contact dystorti0n@proton.me.

Documentation

Overview

serialisation.go

token.go

utxo.go

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL