This project is dedicated to the world community as an Open-source Post-quantum blockchain layer 1 project, means anyone can join and contribute based on his/ her passion and skills. SPHINX is a blockchain protocol designed to provide secure and scalable solutions in the post-quantum era. The project aims to develop a robust and decentralized network using a Proof of Work (PoW) consensus algorithm initiated by the community.
This repository contains code for the SPHINXMiner project, which is a mining
module for the SPHINX blockchain. The SPHINXMiner aims to provide a Proof of Work (PoW) algorithm for mining blocks in the SPHINX blockchain.
The mineBlock
function is responsible for mining a new block by finding a valid proof-of-work. It takes the previous block's hash and the reward address as input parameters. The function iterates through nonce values until it finds a hash that meets the required difficulty level. Once a valid hash is found, the function creates a new block, adds the reward transaction, and sets the block's timestamp.
The calculateProofOfWork
function is used to calculate the proof-of-work for a given block data and difficulty level. It takes the block data and difficulty as input parameters. The function iterates through nonce values and calculates the hash of the block data. It checks if the calculated hash meets the difficulty requirement by comparing it with a target hash. Once a valid proof-of-work is found, the function returns it.
The performMining
function is responsible for the mining process. It includes two scenarios: the Developer Mining Phase and the Normal Mining Phase. In the Developer Mining Phase, a certain number of crypto assets are mined by developers with reduced difficulty. Once the developer mining goal is reached, the function transitions to the Normal Mining Phase where all miners participate with the regular difficulty. The function continues mining until all crypto assets are mined or the process is terminated.
The updateReward
function is used to update the mining reward based on the block height. It checks if the block height reaches a reward halving interval. If the interval is reached, the function halves the reward amount.
To get started with the SPHINXMiner project, follow these steps:
- Clone the repository:
git clone https://github.com/your-username/SPHINXMiner.git
- Install the necessary dependencies.
- Explore the codebase to understand the project structure and components.
- Use the provided functions to mine blocks in the SPHINX blockchain.
This repository is part of the SPHINXPoW
Please note that the code in this repository is a part of the SPHINXPoW algorithm, which is currently in development and not fully integrated or extensively tested for functionality. The purpose of this repository is to provide a framework and algorithm for the mining scheme in the SPHINX blockchain project.
As the project progresses, further updates and enhancements will be made to ensure the code's stability and reliability. We encourage contributors to participate in improving and refining the SPHINXPoW algorithm by submitting pull requests and providing valuable insights.
We appreciate your understanding and look forward to collaborative efforts in shaping the future of the SPHINX blockchain project.
To get started with the SPHINX blockchain project, follow the instructions below:
- Clone the repository:
git clone https://github.com/ChyKusuma/SPHINXPoW.git
- Install the necessary dependencies (List the dependencies or provide a link to the installation guide).
- Explore the codebase to understand the project structure and components.
- Run the project or make modifications as needed.
We welcome contributions from the developer community to enhance the SPHINX blockchain project. If you are interested in contributing, please follow the guidelines below:
- Fork the repository on GitHub.
- Create a new branch for your feature or bug fix:
git checkout -b feature/your-feature-name
orgit checkout -b bugfix/your-bug-fix
. - Make your modifications and ensure the code remains clean and readable.
- Write tests to cover the changes you've made, if applicable.
- Commit your changes:
git commit -m "Description of your changes"
. - Push the branch to your forked repository:
git push origin your-branch-name
. - Open a pull request against the main repository, describing your changes and the problem it solves.
- Insert your information (i.e name, email) in the authors space.
Specify the license under which the project is distributed (MIT License).
If you have any questions, suggestions, or feedback regarding the SPHINX blockchain project, feel free to reach out to us at [email protected].