XenBlocks is the Proof of Work (PoW) component of the X1 blockchain based on the Argon2 algorithm that is resistant to ASICs. It’s Jack Levin’s attempt at creating a more approachable mining project that involves the use of CPUs and GPUs, allowing regular users to use standard desktops to mine blocks. The XEN Crypto founder is on a mission to create the most decentralized, low-enery, secure, and lowest barrier of entry merged PoW-PoS blockchain.
XEN Matrix has you... pic.twitter.com/rR2K00omsC
— Jack Levin 🟧🦇🟦 (@mrJackLevin) September 9, 2023
On September 8th, Jack Levin created the first commit to his Xenminer repository and announced it on X as an “evening project”.
“Evening project, XEN Miner: https://github.com/jacklevin74/xenminer/blob/main/miner.py…
What it does is use Fair Proof of Work to mine blocks, by finding special sequence ‘XEN1’ in a hash produced by the Argon2ID encryption algorithm. If you like cryptography, and want to show up on a leaderboard here: http://xenminer.mooo.com/leaderboard , download the file, install missing modules. Change account to your Ethereum address (something fresh). Start mining…. You win if you get into top 100 miners.”
Evening project, XEN Miner https://t.co/IvKjtOEf2w
— Jack Levin 🟧🦇🟦 (@mrJackLevin) September 8, 2023
What it does, uses Fair Proof of Work to mine blocks, by finding special sequence 'XEN1' in a hash produced by Argon2ID encryption algorithm. If you like cryptography, and want to show up on a leaderboard here:… pic.twitter.com/T4ZzCovOC8
Since then, the Xenminer project has managed to attract 18,424 unique miners, and the XenBLOCKs Telegram group has already garnered 2,500 members. Xenminer is built in Python, which is one of the easiest programming languages and that’s what made it so successful. In a few days, people who had no previous experience with code or mining started downloading the repository and running the code on their machines, while others built tools like an explorer, stats, and charts and miners for different operating systems and for GPUs. The miners use desktop computers, laptops, phones, Raspberry Pis, virtual private servers, dedicated servers, and bare metal rigs to mine XenBlocks. After 10 days, the hash rate is 358 khash/sec and the difficulty’s at 67,500.
XenBlocks milestone, 14 days, 1000 members, over 1M blocks mined! Probably one of the most fun XEN chats https://t.co/fRjUB2Imgc pic.twitter.com/bh8Z5PpLzt
— Jack Levin 🟧🦇🟦 (@mrJackLevin) September 23, 2023
What is Xenminer
XenMiner is the engine of the XenBlocks chain and is centered around the utilization of the Argon2 key derivation function. This function is employed for the purpose of mining blocks, which are subsequently validated and incorporated into a blockchain.
The inception of this project stemmed from an initial experiment aiming to assess the feasibility of integrating Argon2id, an encryption algorithm initially designed for password protection, into the cryptographic hash function of a blockchain. The motivation behind this endeavour was the capacity to adjust its parameters, not only to ensure resistance against ASIC (Application-Specific Integrated Circuit) mining but also to resist GPU (Graphics Processing Unit) mining. The ultimate goal here, as described by Mr. Jack Levin, is to achieve what is referred to as ‘fair mining.’
One way to perceive this undertaking is as a developmental process with active community involvement, potentially resulting in the creation of a component that could be incorporated into the X1 chain.
As part of this ongoing process, early contributors and participants have the opportunity to mine Super blocks, which serve as both a reward for their assistance and, potentially, a means to acquire their own .xen domain name through the Ethereum Name Service (ENS).
The miner operates on a hybrid model using a combination of two different algorithms: SHA-256 for private key generation and the Argon2 CPU mining algorithm for XEN11 and super block search. This combination allows for efficient mining while ensuring security and resistance against ASIC mining.
Here’s how the miner works:
Private Key Generation:
The miner’s primary task is to generate private keys. Private keys are typically used to sign transactions and provide ownership of cryptocurrencies. In this case, the miner generates these private keys as fast as possible using the SHA-256 algorithm. SHA-256 is the same cryptographic hash function used in Bitcoin.
Hybrid Mining:
After the private key is derived from random input using SHA-256, it is submitted to the Argon2 CPU mining algorithm. Argon2 is primarily used for XEN11 mining and super block search. This hybrid approach combines the use of SHA-256 for key generation with Argon2 for the actual mining process.
Dynamic Difficulty Adjustment:
The miner employs a dynamic difficulty adjustment mechanism. This means that the mining difficulty will not remain constant but will vary based on network conditions. The miner aims to maintain a global block production of around 60 blocks per minute. If the network’s hashrate increases or decreases, the miner adjusts its difficulty to match this target.
ASIC Resistance:
The dynamic difficulty increase serves another important purpose of increasing memory usage for the miner. By adjusting the memory requirements, the miner can effectively introduce more ASIC resistance. This is a strategy to prevent the dominance of ASIC (Application-Specific Integrated Circuit) miners, which tend to be more powerful and efficient but can centralize mining operations.
How does the difficulty adjustment work
The miner is fetching every million attempts. If, during those million attempts, the XEN11 sequence is found, that means the block has been mined and confirmed. If instead that block hasn’t been found within that range, the miner will stop mining with the old memory cost, adjust to the new cost, and restart faster or slower depending on the difficulty. The difficulty is updated asynchronously.
The Argon2 algorithm is known to be memory hard which means that it consumes a significant amount of memory during its execution. Its hardness meant that mining with GPUs and ASICs would be inefficient; however, the Xenblocks miners proved that the peculiarity of difficulty adjustment combined with Argon2 and a relatively low cost of equipment is not disadvantageous to GPU miners. ASICs often have limited memory compared to general-purpose CPUs, which, in theory, would make a memory-hard algorithm more expensive and less efficient, but it will be up to the Xenblocks miners to prove it.
In Xenblocks, difficulty adjustment occurs once every 10 minutes. The network examines how quickly blocks come and slows them down or speeds them by issuing the difficulty value. A difficulty increase is an increase in memory usage by the miner, where the memory cost represents the number of KiB that should be consumed during hashing. It renders the miner slower as more memory is needed for computation. Difficulty adjustment, however, doesn’t mean that the progress the miner made is lost because there’s no state with a history of incorrect hashes. The ideal speed of the network must match 1 block rate per second shared amongst all miners, which means that it’s really fast.
Unlike traditional proof of work, where miners add blocks to the blockchain if they mined them, Jack Levin proposes a different approach where blocks are proposed by a mempool. Validators’ job is to build a block with a hash of the previous block, create a new hash, and add it to the blockchain.
Regular blocks, XUNI, super blocks
While the mining part is already figured out, Mr. Levin is still thinking about the game theory of blocks and super blocks and the consensus mechanism as well. Regular blocks containing the XEN11 sequence are going to be used as gas. Adjusting XEN11 to XEN111 would make the mining process harder by about 100x and reducing it to XEN1 would make it very easy, and that’s exactly what happened at the beginning when mining with CPU was a thing.
Super block or X.BLK, is harder to mine because it must contain a XEN11 sequence and at least 65 capitalized letters in the hash. There are some very rare super blocks containing 71 and 74 capital letters.
Blocks with the XUNI sequence are collectibles. Their distribution is innovative in the blockchain space because it’s time-limited. They can be mined solely within a 10-minute frame window, starting 5 minutes before the full hour and ending 5 minutes after. Their supply is unlimited; however, increasing difficulty will make them harder to mine.
Regular blocks are the Xenblocks chain currency, and they’re called XENIUM, where 1 block equals 10 XENIUM in the first year of the chain’s existence. It’s been initially proposed that 10,000 XENIUM should equal 1 X.BLK.
Regular and super blocks proposed utility extends to the validation process, as they could be required for someone to become a validator. The proposed number of XENIUM is 10,000. Staking XENUIM or X.BLK means that a miner can validate all discovered blocks in the mempool and each successful validation will contribute to an increase in overall hashing power for that individual miner.
Mr. Levin is keen on introducing miners’ reputation which will take into account time spent on mining and the number of accurate blocks. The reputation introduces security to the network as it helps preserve it from bad actors by slowing them down and reducing their rewards.
“Miners with a high reputation will be able to run faster. Reputation score can drop and your miner will run slower if you submit wrong block solutions” wrote Mr. Levin in the official Xenblocks Telegram group.
This mechanism would effectively introduce individual difficulty for miners.
Super blocks could also have the right to purchase <name>.xen namespace. Their total supply is not fixed but their mining rate shows that they’re very rare. After 1 year of mining, there’s a total of ~30 million blocks mined so far and ~37k super blocks.
With the possibility to use the hashing algorithm to search for different sequences at the same time, we effectively obtain something called merged mining. Although XUNI is mined the same way as a regular block, it’s not counted as a block in itself but rather as an unhackable token contract with a unique PoW distribution based on time.
The tokenomics of XENIUM
XENIUM is a token based on the first principles of crypto which means that it has no founder allocation, is decentralized, started at supply 0, and is mined entirely by the community of miners. The supply is 620 million, although it’s not hard capped but rather the result of a log function. The supply undergoes yearly halvings, which make it a scarce token very early. Half of the entire supply is going to be mined during the first year, when the difficulty is the lowest. The indefinite halvenings cause the supply to remain at the 619 million mark with .999… decimal spaces even after 800 years. 99% of the entire XENIUM supply will be mined within 9 years from launch.
There are around 30 million XenBlocks produced during the first year, at a rate of 60 XenBlocks per minute. The first halving cuts it to 15 million next year at 30 blocks per minute.
#XENIUM #XENBLOCKS pic.twitter.com/N52OqMAbpj
— Xen.pub (@jarosciak) October 7, 2023
How does the validation work
Block validation means that the validator must ensure that all transactions are valid and the block’s header references the correct parent block. To validate a transaction in a block, a node only needs to have the transaction data, the root hash of the Merkle tree of transactions in that block (found in the block header), and the Merkle path (a list of sibling nodes) for that transaction. The Merkle tree is a fundamental data structure in Bitcoin and Ethereum. It plays a crucial role in ensuring the integrity and security of transaction data. The Merkle tree is used to summarize all the transactions within a specific block in a way that enables efficient and secure verification. When a new block is added to the blockchain, it will have its own Merkle tree with the total set of transactions. It’s also proof that all transactions in a block are valid.
In Xenblocks, all blocks are saved into the mempool. When the miner reaches 10 blocks, they are flushed into a database. The validators pick these blocks in batches of 100 and seal them, creating a sealed block. This kind of batching makes the server run faster.
Xenblocks uses a Merkle Patricia tree to store the state of all accounts. To validate the state of an account (e.g., check an account’s balance), the node can start from the root of the Patricia tree and traverse it by following the hashes in a manner similar to Merkle trees.
When a transaction is included in a block or in the global state, there’s a Merkle Proof for that. The Merkle path (list of sibling nodes) is presented along with the transaction or state data.
The Xenblocks tech
Xenblocks is written mainly in Python and C++ and has MetaMask integration, which increases the likelihood of adoption in the larger crypto space.
Xenblocks is a fusion of PoW and PoS; that’s why there’s both mining and staking involved in the process. The founder also wrote a Solidity contract simulator in Python for token names and balance retrieval, but Mr. Levin claims that he can “write anything in Python to take MetaMask input and act on it as if it were Solidity. Metamask doesn’t know it’s talking to Python. For example, I can handle token sending to a different address, and it will just work. It’s like Solidity clone that makes the wallet think it’s talking to a smart contract. Python allows you to write minimal code to achieve maximum impact but we can write it in any language”.
He also said that the P2P code is written in Go language which is also the base language of Google. P2P is just a connectivity layer to share syncnode data, with miners joining a mesh of servers and replicating the blockchain.db. Xenblocks then becomes much like BitTorrent.
The first Google backend architect said that “it’s possible X1 will become the execution layer for EVM compatible contracts and secured by Xenblocks”.
Conclusions
Xenblocks is Jack Levin’s attempt at creating merged PoW-PoS chains to take the best parts from both worlds and unite them into one. The mining process has already attracted many users from within the XEN community and from outside as well. The attractiveness of a new algorithm with ASIC resistance, peculiar tokenomics, and large participation make Xenblocks a budding ecosystem capable of becoming successful. Much time was spent educating people about mining with CPUs and GPUs on computers, phones, and cloud servers. Many lessons have been learned when it comes to Linux, blockchain structure, Python, and computer specifications. Although XNM has no value and is still in a very early stage of development, the enthusiasm of the community is pushing the project forward.