You are here

GNUnet for Gentoo

In summer 2015 I started to package GNUnet for Gentoo as contributor to the youbroketheinternet-overlay.

This short post is to announce that, among other packages, you can now build and install GNUnet (and gnunet-gtk, gnurl) on Gentoo as easy as:

Read more Sunday, October 2, 2016 - 23:16 ng0

Videos from the GNU Hacker Meeting August 16-20 2016 (Rennes)

GHM 2016 is over. However, thanks to Alain Crenn's excellent recording work, you can find the recorded talks here.

(We also made them available to audio-video of GNU, but they have not yet posted them for some reason.)

Read more Tuesday, September 6, 2016 - 19:40 Christian Grothoff

libbrandt GSoC final evaluation

The Google Summer of Code is about to end and it's time for an update on the libbrandt development.

The code can be cloned from this repository:
git clone git://

Since the midterm evaluation I implemented the public outcome version of the algorithm for first price auctions and worked on the public library API. The public outcome algorithm uses libgnunetutil to compute a discrete logarithm and can be tested by calling `make check`. The API is not quite finished, so libbrandt is not yet in a usable state for applications. However I will continue to work on libbrandt and a GNUnet service using it in my upcoming masters thesis. The main features missing from the original plan for GSoC are:

  • M+1st price auction algorithm
  • Final API

A few minor todos are also left directly in the code, search for \todo or look at the todo list in the documentation.

The code is mostly documented, you can build the html documentation with doxygen by calling make full from the doc directory. Simple examples of how to use the code can be seen in the test_brandt.c and test_crypto.c files.

I also did a talk about libbrandt at the GNU hacker meeting last week. I'll edit this post to include the link to the recording after it is published.

I thank my Mentor Christian Grothoff for his guidance, technical insights and also some help with setting up the GNU autotools build system.

Read more Tuesday, August 23, 2016 - 09:20 Markus Teich

Rust implementation of GNUnet with GSoC - Final-term

This is the final week of the gnunet-rs project with Google Summer of Code. It has been challenging but also exceptionally rewarding. I hope to explain the final product and then touch on the future work. The repository can be found here, and my previous blog post here.

During the first half of GSoC working period, I changed the peerinfo service to use asynchronous IO (using gjio). I continued on that path and added two more services to make use of asynchronous IO - identity and GNS. I won't cover the complete API in this blog post since their usage can be found in the documentation comments in the code (cargo doc can be used to generate html docs); there are also a lot of examples. But I will highlight one of them because it demonstrates the strengths of a promise based API.

async::EventLoop::top_level(|wait_scope| -> Result {
    // set up and configuration code omitted
    let mut gns = GNS::connect(&config, &network)
            .wait(wait_scope, &mut event_port).unwrap();
    let promises = vec!["", "", ""]
            .into_iter().map(|d| {
    let addresses = async::Promise::all(promises)
            .wait(wait_scope, &mut event_port).unwrap();
    println!("{:?}", addresses);

This piece of code creates a vector of promises to the GNS lookup results, and then the all function transforms it into a promise to a vector of the results. Finally we wait for all the promises to resolve.

The all function is useful for aggregating the result of multiple promises, methods such as then and map (not demonstrated here) give the user a composible way to chain promises together. Overall, using these functions and the promise API, we arrive at an elegant and safe way to write asynchronous code.

Moving the original blocking API into an asynchronous API is certainly a step forward. However, Rust is evolving rapidly (impl Trait return just landed in Nightly), especially regarding asynchronous IO libraries (recently futures-rs was announced which feature "zero-cost futures and streams"). So there is still a lot to be explored regarding the API design.

I'd like to thank Jeff for being my mentor. Completing this project would not have been possible without his guidance and the insightful discussions.

Read more Wednesday, August 17, 2016 - 05:41 kc1212

libbrandt GSoC midterm status update


the GSoC midterm evaluation finished this week and it's time for a status update on the libbrandt auctioning library project.

In the past few weeks we decided to switch from RSA like crypto to Ed25519 due to performance reasons and it's generally more modern approach. Therefore we don't use libpari anymore, but libgcrypt instead. Ed25519 also has no need to validate each input value from other protocol participants.

Then I translated the three zero knowledge proofs and the first price auction protocol with a private outcome from this paper to Ed25519 and implemented them including unit tests. If you want to check out the source code, git clone git:// The majority of the current code can be found in crypto.c, the unit tests are in test_crypto.c

The next steps are to implement the higher level messaging state machine and the public library interface.

Read more Wednesday, June 29, 2016 - 12:54 Markus Teich

Rust implementation of GNUnet with GSoC - Mid-term progress

The GSoC mid-term evaluation is happening now, so this is a good time to write up the work I've done so far. My contributions are threefold. The files mentioned below can be found in the async branch (

1. Packed message structs
GNUnet messages are represented by packed C structures. Serialisation and deserialisation are thus straightforward, messages are simply sent byte for byte over the network. gnunet-rs did not do this initially. So I ported a couple of message structures from the C code into Rust and implemented ways to easily construct and send those messages. In the future we hope to automatically generate message structures from the C code using bindgen when it supports packed structures (

2. Removed dynamic links with the GNUnet C library
Previously gnunet-rs links with the C library to use the functions for converting between GNUnet's ASCII encoding and binary value. Linking with the C library only for a couple of functions creates unnecessary overhead. The Java library also doesn't link against the C library. Thus I ported those functions to Rust and wrote some simple test cases for them, those can be found in src/util/ This removes the need for linking with the C library.

3. Asynchronous peerinfo library with gjio
Finally, the most important contribution is asynchronous support using gjio ( gjio is a high-level asynchronous IO library based on event loop and promises. It supports most of the features in the GNUnet Scheduler such as timeout, cancellation and so on.

Currently three public functions for peerinfo are provided.

pub fn iterate_peers(cfg: &Cfg, network: &Network)
-> Promise<Peers, IteratePeersError>
pub fn get_peer(cfg: &Cfg, network: &Network, pk_string: String)
-> Promise<(Option<PeerIdentity>, Option<Hello>), NextPeerError>
pub fn self_id(cfg: &Cfg, network: &Network)
-> Promise<PeerIdentity, TransportServiceInitError>

Since they all return Promises<T, E>, we can perform asynchronous operations by creating multiple promises, chain them together if necessary, finally wait for all of them to evaluate. For instance, to check whether two specific peers are online, we can write the following.

EventLoop::top_level(|wait_scope| -> Result<(), ::std::io::Error> {
// setup config, network, etc.
let promise1 = get_peer(&config, &network, pk_string1)
let promise2 = get_peer(&config, &network, pk_string2)
let result = Promise::all(vec![promise1, promise2].into_iter()).wait(wait_scope, &mut event_port)
// process result

More usage examples can be found under examples/

The work so far presents a proof of concept of accessing the peerinfo service asynchronously. That is exactly what I aimed to achieve by mid-term evaluation in my original proposal.

However, the work is far from over. iterate_peers doesn't return an Iterator, the user must manually evaluate the promise on every iteration and check whether it has reached the end, I'm hoping to make it into Iterator trait. The current API was designed without paying much attention to the existing C or Java API, I'd like to introduce some consistency with the existing API both in terms of naming and functionality. The tests and documentation I have at the moment are minimal, so some work needs to be done to improve on those fronts. Finally, I'd like to implement a couple of other subsystems such as GNS and/or statistics.

Fortunately, summer holidays are finally starting in a couple of weeks, which substantially increases the amount of time that I can spend on GNUnet. I'm looking forward to the next 8 weeks!


Read more Wednesday, June 22, 2016 - 10:17 kc1212

Rust implementation of GNUnet with GSoC


I will be participating in Google Summer of Code this year with GNUnet. The project is on improving the Rust implementation of GNUnet utils. The primary objective is to add asynchronous IO in a way that is general, extensible and resemble the original GNUnet API. More details can be found here -

Jeff Burdges is my mentor and I will be working closely with him on this project.

All the code I produce will be on my own fork of gnunet-rs (on the gsoc branch) which can be found here -


Read more Wednesday, May 25, 2016 - 12:18 kc1212


Subscribe to Front page feed