Mine & Mint Proof-of-Work Tokens on Avalanche 
The THOR, LOKI and ODIN members of the XPower token family are all proof-of-work tokens that have not been pre-mined or pre-minted. Their contracts run on the Avalanche C-Chain, and anyone can mint them by presenting a valid $nonce$ number. Once minted, they function like regular tokens.
Motivation
Both Proof-of-Work (PoW) and Proof-of-Stake (PoS) serve as sybil protection mechanisms for establishing identity in a decentralized environment. We are troubled by the polarization between PoW and PoS in the blockchain space, and believe both methods are valid.
PoW is effective at distributing value because the energy required to mine PoW coins and tokens is pre-distributed by nature. Everyone has equal access to the energy of the sun (and its derivatives, to a limited extent).
PoS systems are excellent at transmitting value between participants with minimal energy and effort. When done correctly, like in Avalanche
, they are ideal for exchanging value and building large-scale economies.
Instead of being limited to a choice between PoW and PoS, why not have both? PoW tokens can be mined, then minted and transmitted on a PoS system. This is the concept behind the XPower token family. We hope that XPower will bring the energy of the sun into the Avalanche ecosystem and contribute to its success.
Overview
Below, you find the various parts and milestones of the project. Please note, that everything upto but excluding lending & borrowing has already been realized:
Project Overview
The entire process begins with mining and minting XPower tokens, of which three variants exist: THOR (yellow), LOKI (green) and ODIN (cyan). Also, with each mint some amount is allocated for the project’s treasury.
Further, by burning XPower they can be converted into NFTs, which can be staked to earn rewards in the form of APower tokens i.e. aged XPower: aTHOR (blue), aLOKI (magenta) and aODIN (red).
Also, each APower reward wraps one-to-one an XPower token, but only if the treasury holds enough XPower; otherwise, the global wrap-ratio (i.e. collateralization) sinks below one. By burning an APower the contained XPower can get unwrapped — in accordance with the current collateralization at the time of the burn.
Further, in the near future borrowing XPower against APower tokens (and vice versa) will become possible.
Token Supply
The maximum supply consists of about $\bold{1.157T}$ $\times$ $\bold{10^{64}}$ for THOR, $\bold{1.240T}$ $\times$ $\bold{10^{64}}$ for LOKI and $\bold{796.794T}$ $\times$ $\bold{10^{64}}$ for the ODIN tokens, where the amount per mint is determined by the number of $\text{leading-zeros}$ of the $hash$ of the provided $nonce$ number. Further, each $hash$ can only be used once which effectively puts a hard limit on the total supply. However, due to these limits being very high, for all practical purposes the supply of each token can be treated as infinite — similarly for the aTHOR, aLOKI and aODIN tokens.
Mining and Minting
To be able to mint XPower, a valid $nonce$ number needs to be presented. The process of finding such a number is called mining, where the algorithm for verifying whether the work has actually been performed (or not) consists of first calculating the $hash$ value of:
$$hash = \text{keccak256}(\lbrace address, blockhash, nonce \rbrace)$$
…where $\text{keccak256}$ is a standard hashing function, the $nonce$ a (random) number and where the $address$ is the beneficiary of the XPower tokens.
Apart from the $nonce$ number, the $address$ is also hashed to avoid the former from being stolen by front-runners, who otherwise would observe a transaction with a valid $nonce$ and who would then try to get their own transaction with the same $nonce$ validated first. By hashing the $address$ such an attempt will result in a different value, because the front-runner would have a different $address$.
Obviously, a miner could pre-mine valid $nonce$ numbers and then try to mint as many tokens as fast as possible: By including a recent $blockhash$ this scenario is avoided, where the $blockhash$ needs to be cached for the current interval (hour) — before minting.
Once a $hash$ is produced, its leading number of zeros is counted and then the $\text{amount}$ of XPower tokens (to be minted) calculated according to the following formulae:
Amount rewarded for THOR tokens
For the THOR tokens, the rewarded amount grows proportionally in the number of $\text{leadings-zeros}$ of the $hash$ value:
$$amount = \text{leadings-zeros}(hash)$$
Since the hash is an hexadecimal value, the amount should be an exponentiation w.r.t. a base of $16$ (instead of a simple linear function). However, for THOR tokens we deliberately chose to undervalue hashes with more zeros to strongly negate the advantage of miners with access to better technology.
Amount rewarded for LOKI tokens
For the LOKI tokens, the rewarded amount grows exponentially (w.r.t. to a base of $2$) in the number of $\text{leadings-zeros}$ of the $hash$ value:
$$amount = 2^{\text{leadings-zeros}(hash)}-1$$
Again, since the hash is an hexadecimal value, the actual exponentiation base should be $16$ (instead of $2$), because finding one with for example two $\text{leading-zeros}$ is statistically $16$ times less likely than finding one with just one initial zero. However again, we deliberately chose to undervalue hashes with more zeros to partially negate the advantage of miners with access to better technology.
Amount rewarded for ODIN tokens
For the ODIN tokens, the rewarded amount grows exponentially (w.r.t. to a base of $16$) in the number of $\text{leadings-zeros}$ of the $hash$ value:
$$amount = 16^{\text{leadings-zeros}(hash)}-1$$
Here, the rewarded amount corresponds one-to-one to the effort of miners, resulting in a distribution in favor of those with access to better technology.
Co-Minting for Project Treasury
With each newly minted XPower an extra amount of tokens are co-minted for the project treasury, where this $amount_Θ$ is calculated according to the following formula:
$$amount_Θ = \lfloor amount / 2 \rfloor$$
So, it is calculated has half of the $amount$ minted, which results in $33.3\%$ of the THOR, LOKI or ODIN tokens being co-minted for the treasury (in case the entire supply were to be mined and minted).
Note that this upper limit of $33.3\%$ does not take token burn events into consideration! However, if such tokens — that have (for any purpose) been burned — are all accounted for then the limit would still hold.
XPower NFTs
The blockchain ecosystem is full of various NFT projects most of which cater to artistic expressions.
We use XPower NFTs to represent various denominations as “bills”, while combining them with “art” that remotely resembles what we see on today’s banknotes. For each of the THOR, LOKI and ODIN tokens we issue three separate collections: yellow, green and blue ones respectively (plus another three for staking).
Such art changes yearly, and the relative rarity of these NFTs depends on how many such bills get minted per issue — by burning the corresponding XPower.
Further, each of the three NFT collections come in nine different levels named after the standard SI prefixes: unit, kilo, mega, giga, tera, peta, exa, zetta and yotta (by default the user interface does not show the latter three levels).
Minting each next level requires $1’000$ times more XPower to be burned than the previous one: So, UNIT NFTs can already be minted by burning a single token, while KILO NFTs can only be minted by burning $1’000$ tokens etc.
These stakeable THOR, LOKI and ODIN NFTs offer rewards with an extra 1% APR per level (starting from 0%) — distributed as APower tokens (and financed by the project’s treasury).
Further, older issues fetch an extra 1‱ APR for each year passed. Hence, the NFTs can succinctly be described as “perpetual bonds” with the rewards increasing over time.
UNIT THOR NFT
ROI on XPower NFTsProtocol Parametrization
The protocol contains three important economic parameters: a) The co-minting share for the treasury (defaults to a ratio of 2:1), b) the APR per NFT level (defaults to a value of 1%), and c) the APR bonus per NFT issue (defaults to a value of 1‱). Each of these parameters can be tuned, which necessitates a framework to avoid abuse. Hence, the following rules that govern their change have been put into place:
Each parameter target can only be at most doubled or halved — at most once per month. Also, these targets do not get activated immediately, but the current value of the parameter asymptotically approaches the newly set target value.
APR Reparametrization: from 1% to 2%These simple rules allow the protocol to be flexibly re-parametrized while preventing arbitrary changes, offering each participant in the protocol enough time to investigate whether the targets are set reasonably or not, giving them an opportunity to protest or exit.
The flexiblity and protection these rules offer is illustrated in the example diagram below, where the upper curve shows the target value getting doubled each month, and the lower curve — the current value — trailing the target. In the first half the actual APR barely increases, while in the second it slowly starts moving towards the target.
APR Reparametrization: 24 consecutive twofold increases
Note, that the rights to change the protocol’s parameters — subject to the aforementioned rules — can be granted to a person, group or a smart contract like a DAO, revoked or even renounced completely.
Auto-minting
While manually minting mined XPower tokens is “cute” (by clicking for each mined token the corresponding mint button), the user interface also allows auto-minting: For this purpose a minter wallet can be pre-loaded with some AVAX to pay for fees. Also, there are terminal based miners with built-in wallets (to again auto-pay for fees).
Roadmap
As Marc Andreessen has famously put it in his essay “Why Software is Eating the World”, there is a big opportunity here, and we are acting upon it. So, being a software project there are infinitely many improvements and extensions that may (or may not) be pursued. Below, is a list of some of them we have in mind to deliver upon — but not necessarily in the same given order:
Lending & Borrowing
By putting up APower as collateral it will be possible to borrow XPower, where the latter will be provided by the project’s treasury — if it holds enough funds! Otherwise, the treasury can be replenished via mining XPower tokens (and the co-minting process).
Avalanche Subnet?
At the moment, Avalanche subnets are being fleshed out. Once they reach a certain maturity and if the GINI coefficient of the XPower tokens is sufficiently low (i.e. wide distribution), we may — as a proper citizen of the Avalanche ecosystem — consider launching our own subnet.
Risks
Anyone participating in the blockchain space needs to be aware of at least the following risks:
Avalanche is a relatively young ecosystem: Looking back, in the short little amount of time so far much has happened and improved upon! Still, anyone starting to mine and mint XPower tokens needs to be aware of this fact.
Contract Risk
The XPower smart contracts have not been audited (yet) and may contain bugs, though we put a lot of effort to ensure that they do not, by deliberating keeping them short and avoiding any unnecessary scope creep. We relied also on the industry-standard OpenZeppelin libraries.
Further, please ensure that you interact with the correct contracts: You can find an “Add XPower token” icon in the footer, which you can use to import the tokens’ meta-information into your Metamask wallet.
Upgrade Policy
In case of an unintended contract breach, our recovery policy will rely on 1) determining at what block height it happened, 2) fixing the bug and deploying new contract(s), and 3) allowing the migration of XPower tokens up to the block height of the breach.
Anyone, not happy with any of the decisions taken in the steps above, is free to continue interacting with the old (and breached) contract(s): The entire migration process is voluntary.
Price Risk
There is no assurance regarding the price of the XPower or APower tokens (w.r.t. to any other currency or commodity). It is completely up to the invisible hand of the free market to decide that. Further, any forward looking statement expressed in this document may be subject to change and is not to be relied on.
Privacy Risk
You have no privacy: Blockchains are open public ledgers anyone can inspect upon gaining knowledge of your address. Do not share it, avoid KYC and try to pay fees with AVAX which have been sanitized.
If you want to further improve your privacy, setup your own Avalanche validator and then connect your Metamask wallet to it. Try to route your transactions through a proxy node, instead of broadcasting the validator’s presence to the entire world.
You can also download this web user interface (see the footer) and run it locally, so your IP address does not get tracked by any infrastructure provider we use to deliver it to your browser; or you can simply use a VPN.
Acknowledgments
Despite our occasional constructive critisisms, we are incredibly grateful to the entire Avalanche community for having produced a fantastic blockchain, and we are looking forward to continue with our various contributions.