Bitcoin Forum
June 04, 2026, 04:02:43 AM *
News: Latest Bitcoin Core release: 31.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: I learned Rust from scratch in 2 months by building a Post-Quantum, Tor-native l  (Read 51 times)
ohmdesbois (OP)
Newbie
*
Offline

Activity: 1
Merit: 0


View Profile
June 02, 2026, 01:33:29 PM
 #1

Hello,
First of all, I apologize if this isn’t the right place to post this, but I don’t see many places where I can reach out to true purists—real developers who can understand what I’m trying to do.
You might not want my post here, and I’d understand if it gets deleted like it has elsewhere, since Bitcoin is transparent—so talking about an anonymous, post-quantum project here is probably not appropriate.
Anyway, I’d like to know if I can talk about my project built in Rust. I started by making prototypes inspired by Bitcoin, and then by Monero. If you give me the chance, I’ll tell you more, but since my posts keep getting deleted, I don’t dare anymore.

I'm here because I feel this is one of the few places where I'd be understood if I talked about a fair project for everyone, a fully decentralized system, HTLC contracts, low-level security, open source, bounties for finding white-hat hackers, and building a robust blockchain, etc....


My background is strictly in C—I love low-level architecture and manual memory management. Last year, I started diving into blockchain architectures by poking around and forking Go-Ethereum. It was a great learning experience, but it made me realize something: to build a truly robust, low-level architecture with inflexible safety guarantees (like Bitcoin), I needed to use Rust.

Here is the catch: I didn't know a single line of Rust before April 9th of this year.

For the past two months, it's been just me, the Rust compiler, a bunch of cryptographic papers, and a lot of late nights. I actually scrapped my entire architecture 3 days in when I realized coupling the node and the wallet in the same core was a terrible design, and I rewrote everything to separate the components properly.

Today, I'm open-sourcing Wattcoin V2 (GPLv3). It might not be the most battle-tested production software in the world yet, but it's a solid Proof of Concept and I'm incredibly proud of it as my first real Rust project.

The Tech Stack & Architecture:

- Networking: tokio for async runtime, warp for the local node API, and arti-client for native Tor routing. Every node operates natively as an Onion Hidden Service to ensure privacy.

- Consensus: Proof of Work using randomx-rs (CPU-mining optimized, ASIC resistant).

- Cryptography: 100% Post-Quantum. I use pqcrypto (Dilithium3 for signatures, Kyber768 for key encapsulation) combined with AES-256-GCM. I also implemented Learning With Errors (LWE) commitments for transaction amount masking.

- Wallet: tauri + React + reqwest.

Interesting Rust Challenges I Faced:

1) Native Tor via Arti: Getting arti-client to work reliably for both exposing a hidden service and routing outbound requests through a custom SOCKS5 proxy implementation inside the same binary.

2) FFI & Thread Safety with RandomX: RandomX relies heavily on C pointers. To pre-calculate the 2GB dataset for the next mining epoch without halting the main mining thread, I had to build a WarmUpContainer and carefully use unsafe impl Send and Sync to pass ownership safely across thread boundaries.

3) Concurrency: Managing the Mempool, Blockchain state, and P2P connections concurrently using Arc<Mutex<T>>. I had to be extremely careful to avoid deadlocks when receiving blocks and validating transactions simultaneously.

4) Cross-chain logic: Implementing an on-chain Frequent Batch Auction (FBA) DEX and Bitcoin-compatible HTLCs (Hash Time Locked Contracts) for atomic swaps.

Repo: https://github.com/lohmdesbois-source/wattcoin (V2.0.8 branch/push coming very soon!)

The Telegram channel : https://t.me/WATTCOINNETWORK

Since this is my first real dive into Rust, I am mostly looking for feedback on:

- My usage of tokio::spawn and async state management (are my Arc<Mutex> holding locks for too long?).

- The way I structured the P2P message serialization (serde_json).

- General Rust idiomatic improvements (how to make my code look more like native Rust and less like C).

I'd really appreciate any code review, critiques, or suggestions. Thanks!

Thank you for reading.

L'ohm des bois
gall00tech
Newbie
*
Offline

Activity: 26
Merit: 0


View Profile
June 02, 2026, 10:00:20 PM
 #2

looks like the other projects that have been poping lately just to result in crypto stealers , cargo+rust, RandomX algo,post quantum, no website, etc. Plus Wattcoin network already exists.  Undecided
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!