HER0xMINABLE SUBCURRENCY MODELLED ON BITCOIN

Partnering with HeroGrown (formerly Grow4Vets), PUFFScoin core will launch HER0x, an ERC20 token residing on the PUFFScoin blockchain. HER0x is designed as an adaptation of the 0xBitcoin project, deployed on the Ethereum main network, but following the PUFFScoin Core cynosure towards philanthropy. While HER0x will remain fully decentralized, with the tokens sealed and distributed by its governing smart contract, 5% of every block reward will be apportioned towards a wallet registered and verified through the PUFFSnet name server to the HeroGrown Foundation.

To provide utility for this project, PUFFScoin will position it’s multi-vendor decentralized marketplace, [AREA420], to operate with HER0x as its native token. As PUFFS are the computational fuel that powers the PUFFScoin blockchain, and will be integrated into the operational blueprint of our parent dispensary, The Leafy Cauldron Apothecary, we feel it is important to have a method of asset transfer as a commodity and trade good running on top of the PUFFScoin blockchain to manage an open community marketplace, with the ability to communicate seamlessly to other dApps and token exchanges.

HER0x is a truly minable token, similar to common altcoins, and is distributed using “Proof of Work” mining built upon the Bitcoin consensus and distribution model. HER0x shares Bitcoin’s principles and basic protocols, such as a 21 million unit hard cap to the currency although improved to a one minute block time. HER0x acts exactly as a transparent and permanent digital record of value and possesses a similar fingerprint to Bitcoin, yet has the advantages of being further secured by the speed and scalability of the PUFFSnet, is compatible with all ERC20 token services deployed on the PUFFScoin blockchain, and is fully interoperable with other smart contracts running on the PUFFScoin ecosystem.

HER0x will be natively compatible will any PUFFScoin Core released wallet or browser extension, users will need to simply call a Watch Token function in their wallet to interact directly with the HER0x governing smart contract.

HER0x will also have native representation built into the [weedEX] decentralized token exchange on PUFFScoin, paired with PUFFS and other on-chain digital assets.

MINING

The majority of ERC20 tokens released are constructed so as to grant the full balance of tokens to the owner upon deployment. Many development projects will then engage in an ICO where investors can send Ether to the contract for an initial offering of tokens. This strategy centralizes the project wealth in the hands of the contract owner and presents many options for malfeasant activity. Indeed, several projects that have launched as tokens on the Ethereum blockchain have been led by individuals whose sole determination was to bilk investors of money with false promises.

Within the HER0x smart contract, the protocol insists that all HER0x tokens are locked within the smart contract itself at Genesis. These tokens are dispensed to the miner or mining pool which solves the cryptographic block hash. Thie block reward blueprint for HER0x follows the reward halving scheme found in BTC and will begin at 50 HER0x. Of this, the 5% levy to the HeroGrown wallet of 2.5 HER0x will be deducted from the reward, calling the reward_levy element, and 47.5 HER0x will be minted in the account wallet of the successful miner.

The controlled supply parameters for HER0x enforce a 50% reduction in block rewards every 210,000 blocks. With an average block time set to 1 minute, these events should occur approximately once every 6 months. Thus, when HER0x mints block 210,001 sometime in 2019, the block reward will be halved to 25 HER0x (23.75 HER0x to the miner and 1.25 HER0x to the HeroGrown Foundation). At that point, 10,500,000 HER0x will have been minted by individual and pool miners, just over 500,000 of those being used to directly assist veterans and first responders through HeroGrown initiatives.

In 2020, at block 420,001 the block reward will again be halved to 12.5 HER0x. Conceivably, this distribution model could maintain itself until Reward Era 28, about 14 years, when the block reward would be reduced to 0.00000037 HER0x, allowing for 0.00000001 HER0x to be sent to the HeroGrown Foundation wallet.

The block reward is immediately assigned to the successful miner’s wallet address and the ‘tokens minted count’ is incremented within the smart contract for any other software to monitor.

Mining is done, at the protocol level, by calling the MINT function in the contract and using Proof of Work to solve the cryptographic block hash. The methodology behind the mining process uses the Keccak256 algorithm thusly:

keccak256(nonce, minerEthAddress, challengeNumber) < difficultyTarget

The nonce is a deterministically pseudorandom number selected by the user’s mining software. This application “mines” to try to find a valid nonce. If the above statement evaluates to true, then the nonce is a valid solution to the blocks cryptographic hash and satisfies the PoW requirements to receive the scheduled block reward. The challengeNumber is just a recent Ethereum block hash. Every round, the challengeNumber updates to the most recent Ethereum block hash.

The miner’s PUFFScoin Address is part of the hashed solution so that when a nonce solution is found, it is only valid for that particular miner and man-in-the-middle attacks cannot develop. This protocol also enables pool mining. The difficulty target reduces automatically as more hashpower is added to the network to ensure that a consistent block time is established.

Alongside the original Ethereum main-net deployment of this category of minable token, several open source CPU- and GPU-mining programs specific to this protocol for home computers have been developed and made available. This allows for an accessible entry for even casual users without expansive cryptocurrency mining set-ups to participate in the token consensus mechanism, especially by participating in pooled mining. Where available, the PUFFScoin Core development group will ensure that these are adapted and accessible for use with HER0x.

Pooled mining, where users pool their computational resources and take a share of found block rewards proportionate to their total work compared to the whole work performed by all participants of the mining pool. Pooled, or communal mining fits the use-case for HER0x very well. This is because when mining HER0x, whenever a miner submits a solution, the miner must pay a small gas fee in order to execute the PUFFScoin resident smart contract code for the mint() function.

If the gas fee is too low, the solution will take too long to be validated on the PUFFScoin blockchain, and another mint() solution from another miner paying a higher gas fee will likely be mined first, granting the second miner the reward. The original miner’s solution is now invalid and the transaction reverts. For solo mining efforts on HER0x, loading one’s mining account with just a few PUFFS will cover the gas fees pretty much indefinitely.

To alleviate the gas fees for miners, they can instead mine into a pool. Mining pools are generally third-party developments and have different pricing schemes to recoup the gas and server costs, generally a small percentage of each block reward. The mining pool will submit the cryptographic hash solutions to the smart contract and pay the gas fee on behalf of its users.

PUFFScoin will host a Core sponsored HER0x mining pool, with as low a fee structure as possible. It is our hope that HeroGrown will also host a HER0x mining pool.

Because the successful block miner’s PUFFScoin address is incorporated in the PoW solution, pools require that miners participate using the pool’s PUFFScoin address. This prevents malicious miners from submitting full solutions to the contract while only giving partial solutions to the pool. If a malicious miner is mining on behalf of the pool (using the pools address in the PoW algorithm), it will not be able to submit those solutions to the smart contract without a revert(). Pools will be allowed to operate without being cheated by the miners.

Typically, a pool will accept ‘partial solutions’ from miners which means the miners will receive ‘shares’ from the pool for solutions that are close to valid but not quite valid. This follows the same methodology as Bitcoin and Ethereum Proof of Work pool mining. Probability theory states that, given enough close solutions, a full solution will eventually be found.

 

MINING DIFFICULTY CALCULATION AND ADJUSTMENT

After every block is minted, the smart contract will determine if it is time to adjust the difficulty. This occurs every 1024 mined blocks. Just before this occurs, the contract increments the reward era if necessary – this is if the tokens minted count has exceeded the maximum era supply which is calculated via a simple halving algorithm:

max_era_supply = total_supply – total_supply / 2 pow reward_era + 1

The reward era is used to calculate the mining reward. Next, the her0X smart contract adjusts the difficulty by first determining how many PUFFScoin blocks had been mined since the last adjustment. If < 1024*60 PUFFScoin blocks had been mined, HER0x is being mined too quickly and the difficulty will increase. This is accomplished by reducing the size of the ‘target’. When the target is smaller, valid nonces for minting are rarer and are harder to find for future mining rounds. Alternatively, if HER0x is being mined too slowly the target will increase in value in order to make minting more easy to accomplish.

HER0x will launch in late May 2018.

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.

> 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.

> event Mint(address indexed from, uint reward_amount, uint reward_levy, uint epochCount, bytes32 newChallengeNumber);

getChallengeNumber
Recent PUFFScoin block hash used to prevent pre-mining future blocks.

> 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.Return the current reward amount. Depending on the algorithm, typically rewards are divided every reward era as tokens are mined to provide scarcity.

> 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.

> function getMiningReward() public constant returns (uint)

“It’s our turn to fight for them.”

HeroGrown arose from the Grow4Vets project. Its founder, Roger Martin, a U.S. Army veteran and former law enforcement officer, launched and held the world’s first veteran cannabis giveaway in 2014 in Denver, Colorado. He had used cannabis edibles to detox from opioids and dedicated his life to helping other veterans access cannabis to treat PTSD, pain, and addiction.

By 2015, Grow4Vets was helping tens of thousands of veterans across the United States, expanding into state chapters. This model proved to be unsustainable, and HeroGrown was born as a more centralized administration, built to help veterans and first responders who choose cannabis as a safe alternative to the deadly prescription drugs that cause so much documented harm.

Over 50 veterans and first responders die everyday from suicide, prescription drug, and illicit drug overdoses. Conservative estimates set the proportion of returning veterans that have served in Operation Enduring Freedom and Operation Iraqi Freedom who are diagnosed with combat-related PTSD at 20%. Consider that 1.7 million American soldiers served during those conflicts, a conservative estimate of those suffering from acute Post Traumatic Stress Disorder at 340,000 veterans.

HeroGrown has been established to help veterans access cannabis and is currently involved in “CBD airdrops” for veterans. Since 2015, they have given over 2 million dollars in cannabis to veterans and first responders. PUFFScon hopes to help them give even more away.