BitOre is an innovative blockchain mining project that implements a sophisticated Proof-of-Work (PoW) system. It introduces a dynamic, epoch-based mining mechanism with adaptive difficulty and a unique reward system based on miners' historical gas usage. This project aims to create a more efficient and fair mining environment while maintaining network security.
interface IBitOreProtocol {
function mintEpoch(address to, uint256 epoch, bytes32 nonce, uint256 epochMinersLimit) external;
function mintChip(address to, uint256 epoch, bytes32 nonce, uint256 position, uint256 epochBlock, uint256 epochMinersLimit) external;
}
- Features
- Smart Contracts
- Technical Details
- Getting Started
- Usage
- Configuration
- Development
- Contributing
- License
- Disclaimer
- Epoch-based mining system with adaptive length
- Dynamic difficulty adjustment for optimal mining pace
- Gas-usage based mining rewards to incentivize efficiency
- Multiple token minting support for flexible reward structures
- Reentrancy protection for enhanced security
- Automatic adjustment of allowed miners per epoch
- Gaussian distribution target for balanced network participation
The core of this project is the BitOrePow.sol contract, which manages the entire mining process. It interacts with an IBitOreToken interface for minting rewards.
- Epoch System: Mining occurs in epochs, targeting 60 seconds length but adjustable based on network conditions.
- Dynamic Difficulty: The mining difficulty (
miningTarget) adjusts based on network participation and mining speed. - Miner Allowance: The contract dynamically adjusts the number of allowed miners per epoch to balance participation.
- Gas-Based Rewards: A unique feature where miners' rewards are influenced by their historical gas usage, promoting efficient mining practices.
- Multi-Token Minting: Supports minting multiple token types as rewards for successful miners.
- Epochs start and end based on block numbers
- New epochs trigger difficulty adjustments and miner allowance updates
- Difficulty increases if 68.2% of allowed miners participate in less than half the epoch time
- Adjustments aim to maintain optimal epoch length and network security
- Miners' rewards are multiplied based on their historical gas usage
- A base multiplier is adjusted up to a maximum multiplier to reward efficient miners
- Reentrancy guard to prevent exploits
- Checks to ensure miners only participate once per epoch
To set up the BitOre project:
Install dependencies:
npm install
Compile the contracts:
npm compile
Run tests:
npm test
Miners can participate by calling the mine function:
function mine(bytes32 nonce, address[] calldata mintAddresses) public nonReentrant
nonce: A unique value to solve the mining puzzlemintAddresses: Array of token addresses to mint as rewards
Key configurable parameters:
epochLengthOptimal: Target epoch length (default: 60 seconds)adjustmentInterval: Frequency of major adjustments (default: every 4 epochs)allowedMiners: Maximum number of miners per epoch (dynamically adjusted)miningTarget: Current mining difficulty targetbaseMultiplierandmaxMultiplier: Control the range of reward multipliers
To contribute to BitOre development:
- Fork the repository
- Create a new branch for your feature
- Implement your changes
- Write or update tests as necessary
- Submit a pull request
We recommend using Hardhat for local development and testing.
Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.
This project is licensed under the MIT License. See the LICENSE file for details.
This project is experimental and for educational purposes only. Use at your own risk. The authors and contributors are not responsible for any loss or damage arising from the use of this software.