DarkFi Testnet v0.3 alpha

DarkFi's v0.3 alpha testnet

Today we are releasing a new version of the DarkFi proof-of-work (PoW) alpha testnet. This milestone leads us another step toward the future we have envisioned. Anonymous, uncensored and sovereign: the future we were promised but don't yet have.

The main changes over the previous testnet version are:

  • User smart contracts deployment
  • Merge mining with p2pool
  • Improvements to all testnet-related native applications
  • Bug fixes and improvements from the previous testnet
  • P2P network hardening and improvements

All other areas have also seen substantial work.

User Smart Contracts Deployment

Building on the smart contract foundation from our previous testnet, this release delivers the complete tooling and documentation needed for users to deploy custom contracts. With this release, we're introducing full support for deploying user smart contracts. Users can now create their own custom smart contracts, deploy them on the DarkFi testnet, and interact with them. An example smart contract deployment guide is provided to make users familiar with the process. The full deployment native smart contract spec can be found here.

Smart contract

Deploying a custom smart contract

Merge Mining

In the previous release DarkFi promised to introduce merge-mining with Monero. With this release, we are delivering that promise. Users are now able to configure their darkfid instances to accept requests from p2pool in order to merge mine Monero and DarkFi blocks, giving us all the benefits of anonymous peer-to-peer mining without the security risk that comes with bootstrapping a brand new blockchain. Fun fact: you can also merge mine rewards direct into a DAO treasury!

Merge mining

Merge mining on DarkFi alongside a Monero node

Native applications

All testnet-related native applications have been updated with bug fixes found during the previous testnet. We also introduced new functionality after extensive testing.

darkfid

The main daemon for the DarkFi network has been made more efficient, with faster block verification times and improved communication with miners. darkfid is now only responsible for consensus, acting as a server where mining clients like xmrig and p2pool connect to request new blocks to mine. Syncing, reorg and transactions validation handling have all been improved to ensure daemon and network stability.

darkfid

The main DarkFi blockchain node: darkfid

minerd

In our previous release, we introduced minerd, DarkFi's native mining RandomX miner implementation. During the course of this update, the communication logic between darkfid and miners changed and minerd became solely responsible for mining DarkFi native blocks.

After many optimizations, we found that minerd was operating at a disadvantage relative to xmrig, the industry standard RandomX miner implementation. Because of this, we decided to replace minerd with xmrig directly. This levels the playing field, both in terms of performance and miner experience.

Miners don't have to use and maintain another piece of software. They can now use their trusty xmrig daemon to mine blocks for DarkFi, using their existing optimized configurations for their mining machine(s). All they have to do is configure it with their DarkFi mining wallet address to receive block rewards, and it will request new blocks from darkfid to mine, as described in the miner documentation.

Implementing our own native mining daemon was a great experience and gave us invaluable knowledge on the inner workings of RandomX, making the decision to sunset it bitter-sweet. We value performance over everything, always aiming to deliver the highest quality possible, and we believe this change is for the better for both our miners and the network as a whole.

RIP sweet prince!

Press F to pay respects

drk

The command-line client for darkfid was greatly improved in both performance and user experience. Scanning logic is now more efficient, since we only store wallet-relevant information. We introduced a new wallet address structure with a network prefix, allowing users to quickly identify mistakes when interacting with foreign wallets. We also added an interactive mode that makes the tool behave like a standalone shell, greatly improving user interaction experience. All other minor bugs have been fixed, and all features stabilized.

drk

drk command line client & wallet tool. Here we can see subcommands for issuing tokens, DAO, atomic swaps and transfers.

Vanity Addresses

The vanityaddr tool has been updated to use the new address format.

Vanity addresses

Fixes and improvements

Building on the previous testnet, this release incorporates comprehensive fixes and improvements.

Contracts State Monotree

DarkFi uses an optimized Sparse Merkle Tree implementation called Monotree to verify contract state after each block insertion and create proofs committing to that specific state. In the previous version, the global state tree contained the checksum of each contract state. In this version, each contract has its own Monotree containing all its hashed records, while the global tree is constructed using all contract state Monotree roots, along with the wasm bincodes Monotree root, excluding native contracts zkas tree and wasm bincodes. Further information is available here.

Transaction-local state

DarkFi DEP0008 was implemented, allowing users to define immediately spent coins on subsequent calls. Without it, transactions executing this kind of flow would potentially fail, since the Merkle inclusion proofs of such spent coins were verified against the global tree’s state, which depends on block ordering.

Blocks PoW verification

Nodes now use a cached key with their virtual machine(s) to verify RandomX PoW on each block. The key is selected as the hash of a block in the blockchain, called the key block. The key changes every 2048 blocks (~2.8 days) with a delay of 64 blocks (~2 hours) between the key block and the key change, as per RandomX recommendations. This greatly improves block verification time, and reduces overall sync times.

ZKVM Runtime

We increased the default WASM virtual machine stack size and removed the external wasm-strip dependency, allowing the use of the latest stable Rust version.

Anonymous DAO Smart Contract

We fixed a bug where building a propose or vote transaction while holding multiple governance tokens resulted in missing signatures.

ZK Tooling Enhancements

The DarkFi python SDK has been updated to the latest pyo3 version with complete bindings introduced, along with a full usage example.

P2P network upgrades

In this release, we focused on stabilizing the P2P module by introducing required upgrades and fixing issues found during the previous testnet.

Transports improvements

We improved both transports mixing and socks5 proxy setup to allow for easier configuration. With these additions, nodes running over nym are supported.

DoS Protections

The P2P module's existing DoS protections are now applied to all native application protocol messages, allowing applications to restrict traffic flooding and further protecting nodes from malicious attacks.

Version Message Info

We implemented DarkFi DEP0001, allowing nodes to immediately drop a connection if the protocol version is incorrect. In practice, this means nodes will now drop connections with other nodes if their application versions mismatch.

Network Profiles

We implemented DarkFi DEP0007, allowing for much more refined network configuration. Each supported transport now has its own configuration profile that can be configured individually.

dnet

We stabilized the Python-based tui by fixing all minor bugs that were found.

dnet

Visualizing DarkFi P2P networks with the dnet tool

Enter the Dark Forest

Enter the dark forest

Start using the testnet now!

Explore the current testnet via our deployed blockchain explorer. Updates and upgrades on DarkFi PoW alpha testnet will be published on DarkFi insights and on our social channels. Future upgrades will include alternative storage options, wallet integration into the GUI application, fully fledged fees and block rewards implementation, and many more apps and use cases.

DarkFi is providing the tools for the sci-fi future we were promised — without compromise. We build privacy-preserving tools using the tools that protect our rights and the freedoms of every user of DarkFi.

DarkFi is built by anonymous developers using P2P anonymous software.

Want to contribute? Join us.

About the release: This is the testnet code of the DarkFi network. It is being provided _as is_. We encourage everyone to try out the testnet and find bugs. Please send us feedback on IRC or via Codeberg. To be clear: no guarantee, representation or warranty is being made, express or implied, as to the safety or correctness of the testnet code. No assurances are given the testnet will work as intended and users may experience delays, failures, errors, omissions, financial loss or loss of transmitted information. By electing to use the testnet you are doing so at your own risk. Neither the authors and contributors to the testnet code nor any member of the DarkFi community shall be held responsible or liable in any manner. You hereby release them from all liability or responsibility for any loss of whatsoever due to the foregoing factors. We do not condone illegal or unethical behaviour. Nothing in this post should be construed as investment advice or legal advice. All testnet code is licensed under AGPL3.
Back to top
Back to dark.fi