From 6b5e0e0aeae120105240a959ae92fde36131360a Mon Sep 17 00:00:00 2001 From: Jay Logelin Date: Wed, 7 Mar 2018 23:28:01 -0400 Subject: [PATCH 1/6] Create eip-541.md --- EIPS/eip-541.md | 137 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 EIPS/eip-541.md diff --git a/EIPS/eip-541.md b/EIPS/eip-541.md new file mode 100644 index 00000000000000..ad3d10d7d636b0 --- /dev/null +++ b/EIPS/eip-541.md @@ -0,0 +1,137 @@ +# Preamble + + EIP: + Title: Mineable Token Standard + Author: Jay Logelin + Type: Standard + Category: ERC + Status: Draft + Created: 2018-03-07 + Requires: ERC-20 + +# Simple Summary +A standard interface for mineable tokens. + +# Abstract +The following standard allows for the implementation of a standard API for mineable tokens within smart contracts. This standard provides basic functionality to mine and reward ERC20 tokens using a Proof of Work scheme. + +# Motivation +A standard interface allows any Mineable ERC20 Tokens on Ethereum to be handled by general-purpose applications. Tokens within the Ethereum ecosystem may still require economic incentivization that proof of work mining provides. Specifically, the smart contract implementation will allow for Mineable ERC20 tokens to be tracked in standardized wallets, traded on exchanges, and interfaced with standardized third party mining software and equipment. + +# Specification +## Token +### ERC-20 compatibility Methods + +#### name + +Returns the name of the token - e.g. `"0xBitcoin Token"`. + +OPTIONAL - This method can be used to improve usability, +but interfaces and other contracts MUST NOT expect these values to be present. + +``` js +function name() constant returns (string name) +``` + +#### symbol + +Returns the symbol of the token. e.g. `"0xBTC"`. + +OPTIONAL - This method can be used to improve usability, +but interfaces and other contracts MUST NOT expect these values to be present. + +``` js +function symbol() constant returns (string symbol) +``` +#### totalSupply + +Returns the total token supply. + +``` js +function totalSupply() constant returns (uint256 totalSupply) +``` + +#### balanceOf + +Returns the account balance of another account with address `_owner`. + +``` js +function balanceOf(address _owner) constant returns (uint256 balance) +``` + +### Mining Operations + + +#### mint + +Returns a flag indicating a successful hash digest verification. In order to prevent MiTM attacks, it is recommended that the digest include a recent ethereum block hash and msg.sender's address. Once verified, the mint function calculates and delivers a mining reward to the sender and performs internal accounting operations on the contract's supply. + +``` js +function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success) +``` + +##### *Mint Event* + +Upon successful verification and reward the mint method dispatches a Mint Event indicating the reward address, the reward amount, the epoch count and newest challenge number. + +``` js +event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber); +``` + +#### getChallengeNumber + +Recent ethereum block hash, used to prevent pre-mining future blocks. + +``` js +function getChallengeNumber() public constant returns (bytes32) +``` + +#### getMiningDifficulty + +The number of digits that the digest of the PoW solution requires which typically auto adjusts during reward generation. + +``` js +function getMiningDifficulty() public constant returns (uint) +``` + +#### getMiningReward + +Return the current reward amount. Depending on the algorithm, typically rewards are divided every reward era as tokens are mined to provide scarcity. + +``` js +function getMiningReward() public constant returns (uint) +``` + +### Mining Debug Operations + + +#### getMintDigest + +Returns a test digest using the same hashing scheme used when minting new tokens. + +``` js +function getMintDigest(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number) public view returns (bytes32 digesttest) +``` +OPTIONAL - This method can be used to improve usability, +but interfaces and other contracts MUST NOT expect these values to be present. + + +#### checkMintSolution + +Verifies a sample solution using the same scheme as the mint method. + +``` js +function checkMintSolution(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number, uint testTarget) public view returns (bool success) +``` +OPTIONAL - This method can be used to improve usability, +but interfaces and other contracts MUST NOT expect these values to be present. + +## Implementation + +At the time of writing this specification there is only one known reference implemention of this protocol available, 0xbitcoin. + +#### An example implementation is available at +- https://github.com/0xbitcoin/0xbitcoin-token/blob/master/contracts/_0xBitcoinToken.sol + +## Copyright +Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From fa33c541a7408465d8a957b9d6f70274cc9456d3 Mon Sep 17 00:00:00 2001 From: Jay Logelin Date: Wed, 14 Mar 2018 14:21:54 -0300 Subject: [PATCH 2/6] Added proofOfWork and getDifficultyAdjustmentPeriod --- EIPS/eip-541.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/EIPS/eip-541.md b/EIPS/eip-541.md index ad3d10d7d636b0..29acd328b82ef0 100644 --- a/EIPS/eip-541.md +++ b/EIPS/eip-541.md @@ -43,6 +43,7 @@ but interfaces and other contracts MUST NOT expect these values to be present. ``` js function symbol() constant returns (string symbol) ``` + #### totalSupply Returns the total token supply. @@ -88,7 +89,8 @@ function getChallengeNumber() public constant returns (bytes32) #### getMiningDifficulty -The number of digits that the digest of the PoW solution requires which typically auto adjusts during reward generation. +The number of digits that the digest of the PoW solution requires which typically auto adjusts during reward generation.Return the current reward amount. Depending on the algorithm, typically rewards are divided every reward era as tokens are mined to provide scarcity. + ``` js function getMiningDifficulty() public constant returns (uint) From 5c9c48b8585c8579c930f737f20cec9862eb0587 Mon Sep 17 00:00:00 2001 From: Jay Logelin Date: Tue, 20 Mar 2018 20:23:27 -0300 Subject: [PATCH 3/6] Updated EIP number Updated EIP number to reflect PR --- EIPS/{eip-541.md => eip-918.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename EIPS/{eip-541.md => eip-918.md} (100%) diff --git a/EIPS/eip-541.md b/EIPS/eip-918.md similarity index 100% rename from EIPS/eip-541.md rename to EIPS/eip-918.md From 19a8b67ab2f7856bafddf00d13161137084be44b Mon Sep 17 00:00:00 2001 From: Jay Logelin Date: Tue, 27 Mar 2018 20:27:53 -0300 Subject: [PATCH 4/6] Several functional updates Upon review from a wider audience, this commit includes an interface definition of minimum functionality for mined tokens, a more comprehensive abstract contract that defines required behavior for 4 separate internal phases of solution verification, difficulty modification, epoch period updates, and token reward. Additionally added an example mining program and several simple and complex examples are referenced. Included main net deployed implementation contract addresses 0xbitcoin and PoWAdv. Updated new header format per EIP standardization. --- EIPS/eip-918.md | 237 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 177 insertions(+), 60 deletions(-) diff --git a/EIPS/eip-918.md b/EIPS/eip-918.md index 29acd328b82ef0..8bf5e117d4cd09 100644 --- a/EIPS/eip-918.md +++ b/EIPS/eip-918.md @@ -1,74 +1,128 @@ -# Preamble +--- +eip: +title: Mineable Token Standard +author: Jay Logelin, Infernal_toast, Michael Seiler +discussions-to: jlogelin@fas.harvard.edu, admin@0xbitcoin.org, mgs33@cornell.edu +status: Draft +type: Standards Track +category: ERC +created: 2018-03-07 +--- + +### Simple Summary - EIP: - Title: Mineable Token Standard - Author: Jay Logelin - Type: Standard - Category: ERC - Status: Draft - Created: 2018-03-07 - Requires: ERC-20 +A specification for a standardized Mineable Token that uses a Proof of Work algorithm for distribution. -# Simple Summary -A standard interface for mineable tokens. +### Abstract -# Abstract -The following standard allows for the implementation of a standard API for mineable tokens within smart contracts. This standard provides basic functionality to mine and reward ERC20 tokens using a Proof of Work scheme. +This specification describes a method for initially locking tokens within a token contract and slowly dispensing them with a mint() function which acts like a faucet. This mint() function uses a Proof of Work algorithm in order to minimize gas fees and control the distribution rate. Additionally, standardization of mineable tokens will give rise to standardized CPU and GPU token mining software, token mining pools and other external tools in the token mining ecosystem. -# Motivation -A standard interface allows any Mineable ERC20 Tokens on Ethereum to be handled by general-purpose applications. Tokens within the Ethereum ecosystem may still require economic incentivization that proof of work mining provides. Specifically, the smart contract implementation will allow for Mineable ERC20 tokens to be tracked in standardized wallets, traded on exchanges, and interfaced with standardized third party mining software and equipment. +### Motivation -# Specification -## Token -### ERC-20 compatibility Methods +Token distribution via the ICO model and it's derivatives is susceptable to illicit behavior by human actors. Furthermore, new token projects are centralized because a single entity must handle and control all of the initial coins and all of the the raised ICO money. By distributing tokens via an 'Initial Mining Offering' (or IMO), the ownership of the token contract no longer belongs with the deployer at all and the deployer is 'just another user.' As a result, investor risk exposure utilizing a mined token distribution model is significantly diminished. This standard is intended to be standalone, allowing maximum interoperability with ERC20, ERC721, and others. -#### name +### Specification -Returns the name of the token - e.g. `"0xBitcoin Token"`. - -OPTIONAL - This method can be used to improve usability, -but interfaces and other contracts MUST NOT expect these values to be present. +#### Interface +The general behavioral specification includes a primary function that defines the token minting operation, an optional merged minting operation for issuing multiple tokens, getters for challenge number, mining difficulty, mining target and current reward, and finally a Mint event, to be emitted upon successful solution validation and token issuance. At a minimum, contracts must adhere to this interface (save the optional merge operation). It is recommended that contracts interface with the more behaviorally defined Abstract Contract described below, in order to leverage a more defined construct, allowing for easier external implementations via overridden phased functions. (see 'Abstract Contract' below) ``` js -function name() constant returns (string name) -``` +interface EIP918Interface { -#### symbol + function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success); -Returns the symbol of the token. e.g. `"0xBTC"`. + function getChallengeNumber() public constant returns (bytes32); + + function getMiningDifficulty() public constant returns (uint); -OPTIONAL - This method can be used to improve usability, -but interfaces and other contracts MUST NOT expect these values to be present. + function getMiningTarget() public constant returns (uint); -``` js -function symbol() constant returns (string symbol) + function getMiningReward() public constant returns (uint); + + event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber); + + // Optional + function merge(uint256 nonce, bytes32 challenge_digest, address[] mineTokens) public returns (bool success); + +} ``` -#### totalSupply +#### Abstract Contract -Returns the total token supply. +The Abstract Contract adheres to the EIP918 Interface and extends behavioral definition through the introduction of 4 internal phases of token mining and minting: hash, reward, epoch and adjust difficulty, all called during the mint() operation. This construct provides a balance between being too general for use while providing amply room for multiple mined implementation types. + +### Fields + +#### challengeNumber +The current challenge number. It is expected tha a new challenge number is generated after a new reward is minted. ``` js -function totalSupply() constant returns (uint256 totalSupply) +bytes32 public challengeNumber; ``` -#### balanceOf +#### difficulty +The current mining difficulty which should be adjusted via the \_adjustDifficulty minting phase -Returns the account balance of another account with address `_owner`. +``` js +uint public difficulty; +``` + +#### tokensMinted +Cumulative counter of the total minted tokens, usually modified during the \_reward phase ``` js -function balanceOf(address _owner) constant returns (uint256 balance) +uint public tokensMinted; ``` ### Mining Operations - #### mint -Returns a flag indicating a successful hash digest verification. In order to prevent MiTM attacks, it is recommended that the digest include a recent ethereum block hash and msg.sender's address. Once verified, the mint function calculates and delivers a mining reward to the sender and performs internal accounting operations on the contract's supply. +Returns a flag indicating a successful hash digest verification, and reward allocation to msg.sender. In order to prevent MiTM attacks, it is recommended that the digest include a recent ethereum block hash and msg.sender's address. Once verified, the mint function calculates and delivers a mining reward to the sender and performs internal accounting operations on the contract's supply. + +The mint operation exists as a public function that invokes 4 separate phases, represented as internal functions \_hash, \_reward, \_newEpoch, and \_adjustDifficulty. In order to create the most flexible implementation while adhering to a necessary contract protocol, it is recommended that token implementors override the internal methods, allowing the base contract to handle their execution via mint. + +This externally facing function is called by miners to validate challenge digests, calculate reward, +populate statistics, mutate epoch variables and adjust the solution difficulty as required. Once complete, +a Mint event is emitted before returning a boolean success flag. ``` js -function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success) +// cumulative counter of the total minted tokens +uint public tokensMinted; + +// track read only minting statistics +struct Statistics { + address lastRewardTo; + uint lastRewardAmount; + uint lastRewardEthBlockNumber; + uint lastRewardTimestamp; +} + +Statistics public statistics; + +function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success) { + // perform the hash function validation + _hash(nonce, challenge_digest); + + // calculate the current reward + uint rewardAmount = _reward(); + + // increment the minted tokens amount + tokensMinted += rewardAmount; + + uint epochCount = _newEpoch(nonce); + + _adjustDifficulty(); + + //populate read only diagnostics data + statistics = Statistics(msg.sender, rewardAmount, block.number, now); + + + // send Mint event indicating a successful implementation + Mint(msg.sender, rewardAmount, epochCount, challengeNumber); + + return true; +} ``` ##### *Mint Event* @@ -79,6 +133,48 @@ Upon successful verification and reward the mint method dispatches a Mint Event event Mint(address indexed from, uint reward_amount, uint epochCount, bytes32 newChallengeNumber); ``` +#### merge + +*Optional* + +Operationally similar to mint, except the merge function offers a list of token target addresses intended to be used to merge multiple token rewards. + +``` js +function merge(uint256 nonce, bytes32 challenge_digest, address[] mineTokens) public returns (bool success); +``` + +#### \_hash + +Internal interface function \_hash, meant to be overridden in implementation to define hashing algorithm and validation. Returns the validated digest + +``` js +function _hash(uint256 nonce, bytes32 challenge_digest) internal returns (bytes32 digest); +``` + +#### \_reward + +Internal interface function \_reward, meant to be overridden in implementation to calculate and allocate the reward amount. The reward amount must be returned by this method. + +``` js +function _reward() internal returns (uint); +``` + +#### \_newEpoch + +Internal interface function \_newEpoch, meant to be overridden in implementation to define a cutpoint for mutating mining variables in preparation for the next phase of mine. + +``` js +function _newEpoch(uint256 nonce) internal returns (uint); +``` + +#### \_adjustDifficulty + +Internal interface function \_adjustDifficulty, meant to be overridden in implementation to adjust the difficulty (via field difficulty) of the mining as required + +``` js +function _adjustDifficulty() internal returns (uint); +``` + #### getChallengeNumber Recent ethereum block hash, used to prevent pre-mining future blocks. @@ -104,36 +200,57 @@ Return the current reward amount. Depending on the algorithm, typically rewards function getMiningReward() public constant returns (uint) ``` -### Mining Debug Operations +### Example mining function +A general mining function written in python for finding a valid nonce for mined token 0xbitcoin, is as follows: +``` +def mine(challenge, public_address, difficulty): + while True: + nonce = generate_random_number() + hash1 = int(sha3.keccak_256(challenge+public_address+nonce).hexdigest(), 16) + if hash1 < difficulty: + return nonce, hash1 +``` +Once the nonce and hash1 are found, these are used to call the mint() function of the smart contract to receive a reward of tokens. -#### getMintDigest +### Rationale -Returns a test digest using the same hashing scheme used when minting new tokens. +A keccak256 algoritm does not have to be used, but it is recommended since it is a cost effective one-way algorithm to perform in the EVM and simple to perform in solidity. The nonce is the solution that miners try to find and so it is part of the hashing algorithm. A challengeNumber is also part of the hash so that future blocks cannot be mined since it acts like a random piece of data that is not revealed until a mining round starts. The msg.sender address is part of the hash so that a nonce solution is valid only for a particular Ethereum account and so the solution is not susceptible to man-in-the-middle attacks. This also allows pools to operate without being easily cheated by the miners since pools can force miners to mine using the pool's address in the hash algo. -``` js -function getMintDigest(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number) public view returns (bytes32 digesttest) -``` -OPTIONAL - This method can be used to improve usability, -but interfaces and other contracts MUST NOT expect these values to be present. +The economics of transferring electricity and hardware into mined token assets offers a flourishing community of decentralized miners the option to be involved in the Ethereum token economy directly. By voting with hashpower, an economically pegged asset to real-world resources, miners are incentivized to participate in early token trade to revamp initial costs, providing a bootstrapped stimulus mechanism between miners and early investors. +One community concern for mined tokens has been around energy use without a function for securing a network. Although token mining does not secure a network, it serves the function of securing a community from corruption as it offers an alternative to centralized ICOs. Furthermore, an initial mining offering may last as little as a week, a day, or an hour at which point all of the tokens would have been minted. -#### checkMintSolution -Verifies a sample solution using the same scheme as the mint method. +### Backwards Compatibility -``` js -function checkMintSolution(uint256 nonce, bytes32 challenge_digest, bytes32 challenge_number, uint testTarget) public view returns (bool success) -``` -OPTIONAL - This method can be used to improve usability, -but interfaces and other contracts MUST NOT expect these values to be present. +Backwards incompatibilities are not introduced. + +### Test Cases +(Test cases for an implementation are mandatory for EIPs that are affecting consensus changes. Other EIPs can choose to include links to test cases if applicable.) + + +### Implementation + +Simple Example: + +https://github.com/0xbitcoin/EIP918-Mineable-Token/blob/master/contracts/SimpleERC918.sol + +Complex Examples: + +https://github.com/0xbitcoin/EIP918-Mineable-Token/blob/master/contracts/0xdogeExample.sol +https://github.com/0xbitcoin/EIP918-Mineable-Token/blob/master/contracts/0xdogeExample2.sol +https://github.com/0xbitcoin/EIP918-Mineable-Token/blob/master/contracts/0xBitcoinBase.sol + +0xBitcoin Token Contract: +https://etherscan.io/address/0xb6ed7644c69416d67b522e20bc294a9a9b405b31 -## Implementation +MVI OpenCL Token Miner +https://github.com/mining-visualizer/MVis-tokenminer/releases -At the time of writing this specification there is only one known reference implemention of this protocol available, 0xbitcoin. +PoWAdv Token Contract: +https://etherscan.io/address/0x1a136ae98b49b92841562b6574d1f3f5b0044e4c -#### An example implementation is available at -- https://github.com/0xbitcoin/0xbitcoin-token/blob/master/contracts/_0xBitcoinToken.sol -## Copyright +### Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/). From c194adb5abd7de2ad9da86b27580edd65054b23d Mon Sep 17 00:00:00 2001 From: Jay Logelin Date: Fri, 6 Apr 2018 20:11:31 -0300 Subject: [PATCH 5/6] Attempt at format fix trying to address : Incremental build: disabled. Enable with --incremental Generating... Liquid Exception: Liquid error (/home/travis/build/ethereum/EIPs/_includes/eiptable.html line 11): comparison of Array with Array failed included in all.html jekyll 3.6.2 | Error: Liquid error (/home/travis/build/ethereum/EIPs/_includes/eiptable.html line 11): comparison of Array with Array failed included The command "bash -ex .travis-ci.sh" exited with 1. --- EIPS/eip-918.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/EIPS/eip-918.md b/EIPS/eip-918.md index 8bf5e117d4cd09..8cc4f49d3cecb3 100644 --- a/EIPS/eip-918.md +++ b/EIPS/eip-918.md @@ -1,11 +1,10 @@ --- -eip: +eip: 918 title: Mineable Token Standard -author: Jay Logelin, Infernal_toast, Michael Seiler -discussions-to: jlogelin@fas.harvard.edu, admin@0xbitcoin.org, mgs33@cornell.edu -status: Draft +author: Jay Logelin , Infernal_toast , Michael Seiler type: Standards Track category: ERC +status: Draft created: 2018-03-07 --- From ee9bdfabbd330e71e9f5efd42849eb93e18909dd Mon Sep 17 00:00:00 2001 From: Jay Logelin Date: Mon, 23 Apr 2018 17:48:35 -0300 Subject: [PATCH 6/6] Abstract contract update Added full Mineable Abstract contract code to illustrate a more behaviourally specific implementation to the relatively general EIP918 interface. --- EIPS/eip-918.md | 100 +++++++++++++++++++++++++++++++++++------------- 1 file changed, 74 insertions(+), 26 deletions(-) diff --git a/EIPS/eip-918.md b/EIPS/eip-918.md index 8cc4f49d3cecb3..4dd10f9f752a1f 100644 --- a/EIPS/eip-918.md +++ b/EIPS/eip-918.md @@ -86,41 +86,89 @@ populate statistics, mutate epoch variables and adjust the solution difficulty a a Mint event is emitted before returning a boolean success flag. ``` js -// cumulative counter of the total minted tokens -uint public tokensMinted; + contract AbstractERC918 is EIP918Interface { + + // generate a new challenge number after a new reward is minted + bytes32 public challengeNumber; -// track read only minting statistics -struct Statistics { - address lastRewardTo; - uint lastRewardAmount; - uint lastRewardEthBlockNumber; - uint lastRewardTimestamp; -} + // the current mining target + uint public miningTarget; + + // cumulative counter of the total minted tokens + uint public tokensMinted; -Statistics public statistics; + // number of blocks per difficulty adjustment + uint public blocksPerReadjustment; -function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success) { - // perform the hash function validation - _hash(nonce, challenge_digest); + uint public epochCount;//number of 'blocks' mined + + // track read only minting statistics + struct Statistics { + address lastRewardTo; + uint lastRewardAmount; + uint lastRewardEthBlockNumber; + uint lastRewardTimestamp; + } - // calculate the current reward - uint rewardAmount = _reward(); + Statistics public statistics; - // increment the minted tokens amount - tokensMinted += rewardAmount; + /* + * Externally facing mint function that is called by miners to validate challenge digests, calculate reward, + * populate statistics, mutate epoch variables and adjust the solution difficulty as required. Once complete, + * a Mint event is emitted before returning a success indicator. + **/ + function mint(uint256 nonce, bytes32 challenge_digest) public returns (bool success) { + require(msg.sender != address(0)); + + // perform the hash function validation + _hash(nonce, challenge_digest); + + // calculate the current reward + uint rewardAmount = _reward(); + + // increment the minted tokens amount + tokensMinted += rewardAmount; + + uint epochCount = _epoch(); + + //every so often, readjust difficulty. Dont readjust when deploying + if(epochCount % blocksPerReadjustment == 0){ + _adjustDifficulty(); + } + + //populate read only diagnostics data + statistics = Statistics(msg.sender, rewardAmount, block.number, now); + + // send Mint event indicating a successful implementation + emit Mint(msg.sender, rewardAmount, epochCount, challengeNumber); + + return true; + } - uint epochCount = _newEpoch(nonce); + /* + * Internal interface function _hash. Overide in implementation to define hashing algorithm and + * validation + **/ + function _hash(uint256 nonce, bytes32 challenge_digest) internal returns (bytes32 digest); - _adjustDifficulty(); + /* + * Internal interface function _reward. Overide in implementation to calculate and return reward + * amount + **/ + function _reward() internal returns (uint); - //populate read only diagnostics data - statistics = Statistics(msg.sender, rewardAmount, block.number, now); - - - // send Mint event indicating a successful implementation - Mint(msg.sender, rewardAmount, epochCount, challengeNumber); + /* + * Internal interface function _newEpoch. Overide in implementation to define a cutpoint for mutating + * mining variables in preparation for the next epoch + **/ + function _epoch() internal returns (uint); - return true; + /* + * Internal interface function _adjustDifficulty. Overide in implementation to adjust the difficulty + * of the mining as required + **/ + function _adjustDifficulty() internal returns (uint); + } ```