Skip to content

anythinglord/Sigillum

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

11 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Sigillum, Simple Proof of Stake Blockchain in Go

πŸš€ Overview

This project is a simple implementation of a Proof of Stake (PoS) blockchain written in Go.
It demonstrates the basic concepts of block creation, chain validation, and validator selection based on stake (weight).


🧱 Features

  • Define a basic Block structure with fields like Index, Timestamp, Data, PreviousHash, Hash, and Validator.
  • Define a Blockchain that stores blocks in a slice.
  • Support multiple validators, each with a configurable stake.
  • Choose the validator for each new block based on their stake (weighted random selection).
  • Validate each block before adding it to the chain.
  • Simple hash generation using SHA-256.

βš–οΈ How Proof of Stake Works in This Project

  • Each validator has a stake (an integer value representing their tokens).
  • When a new block is to be added, a validator is selected randomly, but weighted by their stake.
  • The chosen validator "proposes" the new block.
  • The block is validated (index, hashes, etc.) and then appended to the blockchain.

πŸ’» How to Run

go run main.go

Future Improvements

  • Add digital signatures for validators.
  • Add dynamic stake updates (validators can increase or decrease their stake).
  • Implement validator slashing (penalties for malicious behavior).
  • Add networking to support multiple nodes and chain synchronization.

Contributing

Feel free to fork this project, open issues, or submit pull requests to improve the implementation or add new features!

πŸ“œ License

This project is open source and available under the MIT License.

About

Simple Proof of Stake BlockChain written in Go

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages