aboutsummaryrefslogtreecommitdiff
path: root/doc/handbook/chapters/user.texi
diff options
context:
space:
mode:
Diffstat (limited to 'doc/handbook/chapters/user.texi')
-rw-r--r--doc/handbook/chapters/user.texi2508
1 files changed, 0 insertions, 2508 deletions
diff --git a/doc/handbook/chapters/user.texi b/doc/handbook/chapters/user.texi
deleted file mode 100644
index 0b44ab57c..000000000
--- a/doc/handbook/chapters/user.texi
+++ /dev/null
@@ -1,2508 +0,0 @@
1@node Using GNUnet
2@chapter Using GNUnet
3
4
5This tutorial is supposed to give a first introduction for users
6trying to do something real with GNUnet. Installation and
7configuration are specifically outside of the scope of this tutorial.
8Instead, we start by briefly checking that the installation works, and
9then dive into uncomplicated, concrete practical things that can be done
10with the framework provided by GNUnet.
11
12In short, this chapter of the ``GNUnet Reference Documentation'' will
13show you how to use the various peer-to-peer applications of the
14GNUnet system.
15As GNUnet evolves, we will add new sections for the various
16applications that are being created.
17
18Comments on the content of this chapter, and extensions of it are
19always welcome.
20
21
22@menu
23* Start and stop GNUnet::
24* First steps - Using the GNU Name System::
25* First steps - Using GNUnet Conversation::
26* First steps - Using the GNUnet VPN::
27* File-sharing::
28* The GNU Name System::
29* reclaimID Identity Provider::
30* Using the Virtual Public Network::
31* Using the GNUnet Messenger::
32@end menu
33
34@node Start and stop GNUnet
35@section Start and stop GNUnet
36
37Prior to using any GNUnet-based application, one has to start a node:
38
39@example
40$ gnunet-arm -s -l gnunet.log
41@end example
42
43To stop GNUnet:
44
45@example
46$ gnunet-arm -e
47@end example
48
49@node First steps - Using the GNU Name System
50@section First steps - Using the GNU Name System
51
52
53@menu
54* Preliminaries::
55* Managing Egos::
56* The GNS Tab::
57* Creating a Record::
58* Resolving GNS records::
59* Integration with Browsers::
60* Creating a Business Card::
61* Be Social::
62* Backup of Identities and Egos::
63* Revocation::
64* What's Next?::
65@end menu
66
67@node Preliminaries
68@subsection Preliminaries
69
70
71``.pin'' is a default zone which points to a zone managed by gnunet.org.
72Use @code{gnunet-config -s gns} to view the GNS configuration, including
73all configured zones that are operated by other users. The respective
74configuration entry names start with a ``.'', e.g. ``.pin''.
75
76You can configure any number of top-level domains, and point them to
77the respective zones of your friends! For this, simply obtain the
78respective public key (you will learn how below) and extend the
79configuration:
80
81@example
82$ gnunet-config -s gns -o .myfriend -V PUBLIC_KEY
83@end example
84
85@node Managing Egos
86@subsection Managing Egos
87
88In GNUnet, identity management is about managing egos. Egos can
89correspond to pseudonyms or real-world identities. If you value your
90privacy, you are encouraged to use separate egos for separate
91activities.
92
93Technically, an ego is first of all a public-private key pair, and
94thus egos also always correspond to a GNS zone. Egos are managed by
95the IDENTITY service. Note that this service has nothing to do with
96the peer identity. The IDENTITY service essentially stores the
97private keys under human-readable names, and keeps a mapping of which
98private key should be used for particular important system functions.
99The existing identities can be listed using the command
100@command{gnunet-identity --display}
101
102@example
103gnu - JTDVJC69NHU6GQS4B5721MV8VM7J6G2DVRGJV0ONIT6QH7OI6D50
104rules - GO0T87F9BPMF8NKD5A54L2AH1T0GRML539TPFSRMCEA98182QD30
105@end example
106
107
108@node The GNS Tab
109@subsection The GNS Tab
110
111
112Maintaining your zones is through the NAMESTORE service and is discussed
113here. You can manage your zone using @command{gnunet-identity} and
114@command{gnunet-namestore}, or most conveniently using
115@command{gnunet-namestore-gtk}.
116
117We will use the GTK+ interface in this introduction. Please start
118@command{gnunet-gkt} and switch to the GNS tab, which is the tab in
119the middle with the letters "GNS" connected by a graph.
120
121Next to the ``Add'' button there is a field where you can enter the
122label (pseudonym in IDENTITY subsystem speak) of a zone you would like
123to create. Pushing the ``Add'' button will create the zone.
124Afterwards, you can change the label in the combo box below at any
125time. The label will be the top-level domain that the GNU Name System
126will resolve using your zone. For the label, you should pick
127a name by which you would like to
128be known by your friends (or colleagues). You should pick a label that
129is reasonably unique within your social group. Be aware that
130the label will be published together with every record in that zone.
131
132Once you have created a first zone, you should see a QR code for the
133zone on the right. Next to it is a "Copy" button to copy the public
134key string to the clipboard. You can also save the QR code image to
135disk.
136
137Furthermore, you now can see the bottom part of the dialog. The
138bottom of the window contains the existing entries in the selected zone.
139
140@node Creating a Record
141@subsection Creating a Record
142
143
144We will begin by creating a simple record in your master zone.
145To do this, click on the text "<new name>" in the table. The field is
146editable, allowing you to enter a fresh label. Labels are restricted
147to 63 characters and must not contain dots. For now, simply enter
148"test", then press ENTER to confirm. This will create a new (empty)
149record group under the label "test". Now click on "<new record>" next
150to the new label "test". In the drop-down menu, select "A" and push
151ENTER to confirm. Afterwards, a new dialog will pop up, asking to enter
152details for the "A" record.
153
154"A" records are used in the @dfn{Domain Name System} (DNS) to specify
155IPv4 addresses. An IPv4 address is a number that is used to identify
156and address a computer on the Internet (version 4). Please enter
157"217.92.15.146" in the dialog below "Destination IPv4 Address" and
158select "Record is public". Do not change any of the other options.
159Note that as you enter a (well-formed) IPv4 address, the "Save"
160button in the bottom right corner becomes sensitive. In general, buttons
161in dialogs are often insensitive as long as the contents of the dialog
162are incorrect.
163
164Once finished, press the "Save" button. Back in the main dialog, select
165the tiny triangle left of the "test" label. By doing so, you get to see
166all of the records under "test". Note that you can right-click a record
167to edit it later.
168
169
170@node Resolving GNS records
171@subsection Resolving GNS records
172
173
174Next, you should try resolving your own GNS records. The method we
175found to be the most uncomplicated is to do this by explicitly
176resolving using @code{gnunet-gns}. For this exercise, we will assume
177that you used the string ``gnu'' for the pseudonym (or label) of your
178GNS zone. If you used something else, replace ``.gnu'' with your real
179pseudonym in the examples below.
180
181In the shell, type:
182
183@example
184$ gnunet-gns -u test.gnu # what follows is the reply
185test.gnu:
186Got `A' record: 217.92.15.146
187@end example
188
189@noindent
190That shows that resolution works, once GNS is integrated with
191the application.
192
193@node Integration with Browsers
194@subsection Integration with Browsers
195
196
197While we recommend integrating GNS using the NSS module in the
198GNU libc Name Service Switch, you can also integrate GNS
199directly with your browser via the @code{gnunet-gns-proxy}.
200This method can have the advantage that the proxy can validate
201TLS/X.509 records and thus strengthen web security; however, the proxy
202is still a bit brittle, so expect subtle failures. We have had reasonable
203success with Chromium, and various frustrations with Firefox in this area
204recently.
205
206The first step is to start the proxy. As the proxy is (usually)
207not started by default, this is done as a unprivileged user
208using @command{gnunet-arm -i gns-proxy}. Use @command{gnunet-arm -I}
209as a unprivileged user to check that the proxy was actually
210started. (The most common error for why the proxy may fail to start
211is that you did not run @command{gnunet-gns-proxy-setup-ca} during
212installation.) The proxy is a SOCKS5 proxy running (by default)
213on port 7777. Thus, you need to now configure your browser to use
214this proxy. With Chromium, you can do this by starting the browser
215as a unprivileged user using
216@command{chromium --proxy-server="socks5://localhost:7777"}
217For @command{Firefox} (or @command{Icecat}), select "Edit-Preferences"
218in the menu, and then select the "Advanced" tab in the dialog
219and then "Network":
220
221Here, select "Settings..." to open the proxy settings dialog.
222Select "Manual proxy configuration" and enter @code{localhost}
223with port 7777 under SOCKS Host. Furthermore, set the
224checkbox ``Proxy DNS when using SOCKS v5'' at the bottom of
225the dialog. Finally, push "OK".
226
227You must also go to about:config and change the
228@code{browser.fixup.alternate.enabled} option to @code{false},
229otherwise the browser will autoblunder an address like
230@code{@uref{http://www.gnu/, www.gnu}} to
231@code{@uref{http://www.gnu.com/, www.gnu.com}}. If you want
232to resolve @@ in your own TLDs, you must additionally
233set @code{browser.fixup.dns_first_use_for_single_words} to @code{true}.
234
235After configuring your browser, you might want to first confirm that it
236continues to work as before. (The proxy is still experimental and if you
237experience "odd" failures with some webpages, you might want to disable
238it again temporarily.) Next, test if things work by typing
239"@uref{http://test.gnu/}" into the URL bar of your browser.
240This currently fails with (my version of) Firefox as Firefox is
241super-smart and tries to resolve "@uref{http://www.test.gnu/}" instead of
242"@uref{test.gnu}". Chromium can be convinced to comply if you explicitly
243include the "http://" prefix --- otherwise a Google search might be
244attempted, which is not what you want. If successful, you should
245see a simple website.
246
247Note that while you can use GNS to access ordinary websites, this is
248more an experimental feature and not really our primary goal at this
249time. Still, it is a possible use-case and we welcome help with testing
250and development.
251
252@pindex gnunet-bcd
253@node Creating a Business Card
254@subsection Creating a Business Card
255@c FIXME: Which parts of texlive are needed? Some systems offer a modular
256@c texlive (smaller size).
257Before we can really use GNS, you should create a business card.
258Note that this requires having @command{LaTeX} installed on your system.
259If you are using a Debian GNU/Linux based operating system, the
260following command should install the required components.
261Keep in mind that this @b{requires 3GB} of downloaded data and possibly
262@b{even more} when unpacked. On a GNU Guix based system texlive 2017 has
263returns a DAG size of 5032.4 MiB.
264The packages which are confirmed to be required are:
265
266@itemize @bullet
267@item texlive-units
268@item texlive-labels
269@item texlive-pst-barcode
270@item texlive-luatex85
271@item texlive-preview
272@item texlive-pdfcrop
273@item texlive-koma-script
274@end itemize
275
276
277@b{We welcome any help in identifying the required components of the
278TexLive Distribution. This way we could just state the required components
279without pulling in the full distribution of TexLive.}
280
281@example
282apt-get install texlive-full
283@end example
284
285@noindent
286Start creating a business card by clicking the "Copy" button
287in @command{gnunet-namestore-gtk}. Next, you should start
288the @command{gnunet-bcd} program (in the terminal, on the command-line).
289You do not need to pass any options, and please be not surprised if
290there is no output:
291
292@example
293$ gnunet-bcd # seems to hang...
294@end example
295
296@noindent
297Then, start a browser and point it to @uref{http://localhost:8888/}
298where @code{gnunet-bcd} is running a Web server!
299
300First, you might want to fill in the "GNS Public Key" field by
301right-clicking and selecting "Paste", filling in the public key
302from the copy you made in @command{gnunet-namestore-gtk}.
303Then, fill in all of the other fields, including your @b{GNS NICKname}.
304Adding a GPG fingerprint is optional.
305Once finished, click "Submit Query".
306If your @code{LaTeX} installation is incomplete, the result will be
307disappointing.
308Otherwise, you should get a PDF containing fancy 5x2 double-sided
309translated business cards with a QR code containing your public key
310and a GNUnet logo.
311We'll explain how to use those a bit later.
312You can now go back to the shell running @code{gnunet-bcd} and press
313@b{CTRL-C} to shut down the Web server.
314
315
316@node Be Social
317@subsection Be Social
318
319
320Next, you should print out your business card and be social.
321Find a friend, help them install GNUnet and exchange business cards with
322them. Or, if you're a desperate loner, you might try the next step with
323your own card. Still, it'll be hard to have a conversation with
324yourself later, so it would be better if you could find a friend.
325You might also want a camera attached to your computer, so
326you might need a trip to the store together.
327
328Before we get started, we need to tell @code{gnunet-qr} which zone
329it should import new records into. For this, run:
330
331@pindex gnunet-identity
332@example
333$ gnunet-identity -s namestore -e NAME
334@end example
335where NAME is the name of the zone you want to import records
336into. In our running example, this would be ``gnu''.
337
338@pindex gnunet-qr
339Henceforth, for every business card you collect, simply run:
340@example
341$ gnunet-qr
342@end example
343
344@noindent
345to open a window showing whatever your camera points at.
346Hold up your friend's business card and tilt it until
347the QR code is recognized. At that point, the window should
348automatically close. At that point, your friend's NICKname and their
349public key should have been automatically imported into your zone.
350
351Assuming both of your peers are properly integrated in the
352GNUnet network at this time, you should thus be able to
353resolve your friends names. Suppose your friend's nickname
354is "Bob". Then, type
355
356@pindex gnunet-gns
357@example
358$ gnunet-gns -u test.bob.gnu
359@end example
360
361@noindent
362to check if your friend was as good at following instructions
363as you were.
364
365
366@node Backup of Identities and Egos
367@subsection Backup of Identities and Egos
368
369
370One should always backup their files, especially in these SSD days (our
371team has suffered 3 SSD crashes over a span of 2 weeks). Backing up peer
372identity and zones is achieved by copying the following files:
373
374The peer identity file can be found
375in @file{~/.local/share/gnunet/private_key.ecc}
376
377The private keys of your egos are stored in the
378directory @file{~/.local/share/gnunet/identity/egos/}.
379They are stored in files whose filenames correspond to the zones'
380ego names. These are probably the most important files you want
381to backup from a GNUnet installation.
382
383Note: All these files contain cryptographic keys and they are
384stored without any encryption. So it is advisable to backup
385encrypted copies of them.
386
387
388@node Revocation
389@subsection Revocation
390
391Now, in the situation of an attacker gaining access to the private key of
392one of your egos, the attacker can create records in the respective
393GNS zone
394and publish them as if you published them. Anyone resolving your
395domain will get these new records and when they verify they seem
396authentic because the attacker has signed them with your key.
397
398To address this potential security issue, you can pre-compute
399a revocation certificate corresponding to your ego. This certificate,
400when published on the P2P network, flags your private key as invalid,
401and all further resolutions or other checks involving the key will fail.
402
403@pindex gnunet-revocation
404A revocation certificate is thus a useful tool when things go out of
405control, but at the same time it should be stored securely.
406Generation of the revocation certificate for a zone can be done through
407@command{gnunet-revocation}. For example, the following command (as
408unprivileged user) generates a revocation file
409@file{revocation.dat} for the zone @code{zone1}:
410@command{gnunet-revocation -f revocation.dat -R zone1}
411
412The above command only pre-computes a revocation certificate. It does
413not revoke the given zone. Pre-computing a revocation certificate
414involves computing a proof-of-work and hence may take up to 4 to 5 days
415on a modern processor. Note that you can abort and resume the
416calculation at any time. Also, even if you did not finish the
417calculation, the resulting file will contain the signature, which is
418sufficient to complete the revocation process even without access to
419the private key. So instead of waiting for a few days, you can just
420abort with CTRL-C, backup the revocation certificate and run the
421calculation only if your key actually was compromised. This has the
422disadvantage of revocation taking longer after the incident, but
423the advantage of saving a significant amount of energy. So unless
424you believe that a key compromise will need a rapid response, we
425urge you to wait with generating the revocation certificate.
426Also, the calculation is deliberately expensive, to deter people from
427doing this just for fun (as the actual revocation operation is expensive
428for the network, not for the peer performing the revocation).
429
430
431@c FIXME: The Manual should give away the command using an example that is
432@c very likely to never exist.
433To avoid TL;DR ones from accidentally revocating their zones, we are not
434giving away the command, but it is uncomplicated: the actual revocation is
435performed by using the @command{-p} option of @command{gnunet-revocation}.
436
437
438@node What's Next?
439@subsection What's Next?
440
441
442This may seem not like much of an application yet, but you have
443just been one of the first to perform a decentralized secure name
444lookup (where nobody could have altered the value supplied by your
445friend) in a privacy-preserving manner (your query on the network
446and the corresponding response were always encrypted). So what
447can you really do with this? Well, to start with, you can publish your
448GnuPG fingerprint in GNS as a "CERT" record and replace the public
449web-of-trust with its complicated trust model with explicit names
450and privacy-preserving resolution. Also, you should read the next
451chapter of the tutorial and learn how to use GNS to have a
452private conversation with your friend. Finally, help us
453with the next GNUnet release for even more applications
454using this new public key infrastructure.
455
456@pindex gnunet-conservation-gtk
457@node First steps - Using GNUnet Conversation
458@section First steps - Using GNUnet Conversation
459
460
461First, you should launch the graphical user interface. You can do
462this from the command-line by typing
463
464@example
465$ gnunet-conversation-gtk
466@end example
467
468@menu
469* Testing your Audio Equipment::
470* GNS Zones::
471@end menu
472
473@node Testing your Audio Equipment
474@subsection Testing your Audio Equipment
475
476
477First, you should use @code{gnunet-conversation-test} to check that your
478microphone and speaker are working correctly. You will be prompted to
479speak for 5 seconds, and then those 5 seconds will be replayed to you.
480The network is not involved in this test. If it fails, you should run
481your pulse audio configuration tool to check that microphone and
482speaker are not muted and, if you have multiple input/output devices,
483that the correct device is being associated with GNUnet's audio tools.
484
485@node GNS Zones
486@subsection GNS Zones
487
488
489@code{gnunet-conversation} uses GNS for addressing. This means that
490you need to have a GNS zone created before using it. Information
491about how to create GNS zones can be found here.
492
493
494@menu
495* Picking an Identity::
496* Calling somebody::
497@end menu
498
499@node Picking an Identity
500@subsubsection Picking an Identity
501
502
503To make a call with @code{gnunet-conversation}, you first
504need to choose an identity. This identity is both the caller ID
505that will show up when you call somebody else, as well as the
506GNS zone that will be used to resolve names of users that you
507are calling. Run
508
509@pindex gnunet-conversation
510@example
511gnunet-conversation -e zone-name
512@end example
513
514@noindent
515to start the command-line tool. You will see a message saying
516that your phone is now "active on line 0". You can connect
517multiple phones on different lines at the same peer. For the
518first phone, the line zero is of course a fine choice.
519
520Next, you should type in @command{/help} for a list of
521available commands. We will explain the important ones
522during this tutorial. First, you will need to type in
523@command{/address} to determine the address of your
524phone. The result should look something like this:
525
526@example
527/address
5280-PD67SGHF3E0447TU9HADIVU9OM7V4QHTOG0EBU69TFRI2LG63DR0
529@end example
530
531@noindent
532Here, the "0" is your phone line, and what follows
533after the hyphen is your peer's identity. This information will
534need to be placed in a PHONE record of
535your GNS master-zone so that other users can call you.
536
537Start @code{gnunet-namestore-gtk} now (possibly from another
538shell) and create an entry home-phone in your master zone.
539For the record type, select PHONE. You should then see the
540PHONE dialog:
541
542@image{images/gnunet-namestore-gtk-phone,5in,,Dialog to publish a PHONE record}
543
544Note: Do not choose the expiry time to be 'Never'. If you
545do that, you assert that this record will never change and
546can be cached indefinitely by the DHT and the peers which
547resolve this record. A reasonable period is 1 year.
548
549Enter your peer identity under Peer and leave the line
550at zero. Select the first option to make the record public.
551If you entered your peer identity incorrectly,
552the "Save" button will not work; you might want to use
553copy-and-paste instead of typing in the peer identity
554manually. Save the record.
555
556@node Calling somebody
557@subsubsection Calling somebody
558
559
560Now you can call a buddy. Obviously, your buddy will have to have GNUnet
561installed and must have performed the same steps. Also, you must have
562your buddy in your GNS master zone, for example by having imported
563your buddy's public key using @code{gnunet-qr}. Suppose your buddy
564is in your zone as @code{buddy.mytld} and they also created their
565phone using a label "home-phone". Then you can initiate a call using:
566
567@example
568/call home-phone.buddy.mytld
569@end example
570
571It may take some time for GNUnet to resolve the name and to establish
572a link. If your buddy has your public key in their master zone, they
573should see an incoming call with your name. If your public key is not
574in their master zone, they will just see the public key as the caller ID.
575
576Your buddy then can answer the call using the "/accept" command. After
577that, (encrypted) voice data should be relayed between your two peers.
578Either of you can end the call using @command{/cancel}. You can exit
579@code{gnunet-conversation} using @command{/quit}.
580
581
582@node First steps - Using the GNUnet VPN
583@section First steps - Using the GNUnet VPN
584
585
586
587@menu
588* VPN Preliminaries::
589* GNUnet-Exit configuration::
590* GNS configuration::
591* Accessing the service::
592* Using a Browser::
593@end menu
594
595@node VPN Preliminaries
596@subsection VPN Preliminaries
597
598
599To test the GNUnet VPN, we should first run a web server.
600The easiest way to do this is to just start @code{gnunet-bcd},
601which will run a webserver on port @code{8888} by default.
602Naturally, you can run some other HTTP server for our little tutorial.
603
604If you have not done this, you should also configure your
605Name System Service switch to use GNS. In your @code{/etc/nsswitch.conf}
606you should fine a line like this:
607
608@example
609hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4
610@end example
611
612@noindent
613The exact details may differ a bit, which is fine. Add the text
614@code{gns [NOTFOUND=return]} after @code{files}:
615
616@example
617hosts: files gns [NOTFOUND=return] mdns4_minimal [NOTFOUND=return] dns mdns4
618@end example
619
620@c TODO: outdated section, we no longer install this as part of the
621@c TODO: standard installation procedure and should point out the manual
622@c TODO: steps required to make it useful.
623@noindent
624You might want to make sure that @code{/lib/libnss_gns.so.2} exists on
625your system, it should have been created during the installation.
626If not, re-run
627
628@example
629$ configure --with-nssdir=/lib
630$ cd src/gns/nss; sudo make install
631@end example
632
633@noindent
634to install the NSS plugins in the proper location.
635
636@node GNUnet-Exit configuration
637@subsection GNUnet-Exit configuration
638
639
640Stop your peer (as user @code{gnunet}, run @command{gnunet-arm -e}) and
641run @command{gnunet-setup}. In @command{gnunet-setup}, make sure to
642activate the @strong{EXIT} and @strong{GNS} services in the General tab.
643Then select the Exit tab. Most of the defaults should be fine (but
644you should check against the screenshot that they have not been modified).
645In the bottom area, enter @code{bcd} under Identifier and change the
646Destination to @code{169.254.86.1:8888} (if your server runs on a port
647other than 8888, change the 8888 port accordingly).
648
649Now exit @command{gnunet-setup} and restart your peer
650(@command{gnunet-arm -s}).
651
652@node GNS configuration
653@subsection GNS configuration
654
655
656Now, using your normal user (not the @code{gnunet} system user), run
657@command{gnunet-namestore-gtk}. Add a new label www in your
658master zone. For the record type, select @code{VPN}. You should then
659see the VPN dialog:
660
661@image{images/gnunet-namestore-gtk-vpn,5in,,Dialog to publish a VPN record}
662
663Under peer, you need to supply the peer identity of your own peer. You can
664obtain the respective string by running @command{gnunet-peerinfo -sq}
665as the @code{gnunet} user. For the Identifier, you need to supply the same
666identifier that we used in the Exit setup earlier, so here supply "bcd".
667If you want others to be able to use the service, you should probably make
668the record public. For non-public services, you should use a passphrase
669instead of the string "bcd". Save the record and
670exit @command{gnunet-namestore-gtk}.
671
672@node Accessing the service
673@subsection Accessing the service
674
675
676You should now be able to access your webserver. Type in:
677
678@example
679$ wget http://www.gnu/
680@end example
681
682@noindent
683The request will resolve to the VPN record, telling the GNS resolver
684to route it via the GNUnet VPN. The GNS resolver will ask the
685GNUnet VPN for an IPv4 address to return to the application. The
686VPN service will use the VPN information supplied by GNS to create
687a tunnel (via GNUnet's MESH service) to the EXIT peer.
688At the EXIT, the name "bcd" and destination port (80) will be mapped
689to the specified destination IP and port. While all this is currently
690happening on just the local machine, it should also work with other
691peers --- naturally, they will need a way to access your GNS zone
692first, for example by learning your public key from a QR code on
693your business card.
694
695@node Using a Browser
696@subsection Using a Browser
697
698
699Sadly, modern browsers tend to bypass the Name Services Switch and
700attempt DNS resolution directly. You can either run
701a @code{gnunet-dns2gns} DNS proxy, or point the browsers to an
702HTTP proxy. When we tried it, Iceweasel did not like to connect to
703the socks proxy for @code{.gnu} TLDs, even if we disabled its
704autoblunder of changing @code{.gnu} to ".gnu.com". Still,
705using the HTTP proxy with Chrome does work.
706
707@node File-sharing
708@section File-sharing
709
710
711This chapter documents the GNUnet file-sharing application. The original
712file-sharing implementation for GNUnet was designed to provide
713@strong{anonymous} file-sharing. However, over time, we have also added
714support for non-anonymous file-sharing (which can provide better
715performance). Anonymous and non-anonymous file-sharing are quite
716integrated in GNUnet and, except for routing, share most of the concepts
717and implementation. There are three primary file-sharing operations:
718publishing, searching and downloading. For each of these operations,
719the user specifies an @strong{anonymity level}. If both the publisher and
720the searcher/downloader specify "no anonymity", non-anonymous
721file-sharing is used. If either user specifies some desired degree
722of anonymity, anonymous file-sharing will be used.
723
724After a short introduction, we will first look at the various concepts
725in GNUnet's file-sharing implementation. Then, we will discuss
726specifics as to how they impact users that publish, search or download
727files.
728
729
730@menu
731* fs-Searching::
732* fs-Downloading::
733* fs-Publishing::
734* fs-Concepts::
735* Namespace Management::
736* File-Sharing URIs::
737* GTK User Interface::
738@end menu
739
740@node fs-Searching
741@subsection Searching
742
743
744The command @command{gnunet-search} can be used to search
745for content on GNUnet. The format is:
746
747@example
748$ gnunet-search [-t TIMEOUT] KEYWORD
749@end example
750
751@noindent
752The @command{-t} option specifies that the query should timeout after
753approximately TIMEOUT seconds. A value of zero (``0'') is interpreted
754as @emph{no timeout}, which is the default. In this case,
755@command{gnunet-search} will never terminate (unless you press
756@command{CTRL-C}).
757
758If multiple words are passed as keywords, they will all be
759considered optional. Prefix keywords with a "+" to make them mandatory.
760
761Note that searching using
762
763@example
764$ gnunet-search Das Kapital
765@end example
766
767@noindent
768is not the same as searching for
769
770@example
771$ gnunet-search "Das Kapital"
772@end example
773
774@noindent
775as the first will match files shared under the keywords
776"Das" or "Kapital" whereas the second will match files
777shared under the keyword "Das Kapital".
778
779Search results are printed by @command{gnunet-search} like this:
780
781@c it will be better the avoid the ellipsis altogether because I don't
782@c understand the explanation below that
783@c ng0: who is ``I'' and what was the complete sentence?
784@example
785#15:
786gnunet-download -o "COPYING" gnunet://fs/chk/PGK8M...3EK130.75446
787
788@end example
789
790@noindent
791The whole line is the command you would have to enter to download
792the file. The first argument passed to @code{-o} is the suggested
793filename (you may change it to whatever you like).
794It is followed by the key for decrypting the file, the query for
795searching the file, a checksum (in hexadecimal) finally the size of
796the file in bytes.
797
798@node fs-Downloading
799@subsection Downloading
800
801
802In order to download a file, you need the whole line returned by
803@command{gnunet-search}.
804You can then use the tool @command{gnunet-download} to obtain the file:
805
806@example
807$ gnunet-download -o <FILENAME> <GNUNET-URL>
808@end example
809
810@noindent
811FILENAME specifies the name of the file where GNUnet is supposed
812to write the result. Existing files are overwritten. If the
813existing file contains blocks that are identical to the
814desired download, those blocks will not be downloaded again
815(automatic resume).
816
817If you want to download the GPL from the previous example,
818you do the following:
819
820@example
821$ gnunet-download -o "COPYING" gnunet://fs/chk/PGK8M...3EK130.75446
822@end example
823
824@noindent
825If you ever have to abort a download, you can continue it at any time by
826re-issuing @command{gnunet-download} with the same filename.
827In that case, GNUnet will @strong{not} download blocks again that are
828already present.
829
830GNUnet's file-encoding mechanism will ensure file integrity, even if the
831existing file was not downloaded from GNUnet in the first place.
832
833You may want to use the @command{-V} switch to turn on verbose
834reporting. In this case, @command{gnunet-download} will print the
835current number of bytes downloaded whenever new data was received.
836
837@node fs-Publishing
838@subsection Publishing
839
840
841The command @command{gnunet-publish} can be used to add content
842to the network. The basic format of the command is
843
844@example
845$ gnunet-publish [-n] [-k KEYWORDS]* [-m TYPE:VALUE] FILENAME
846@end example
847
848For example
849@example
850$ gnunet-publish -m "description:GNU License" -k gpl -k test -m "mimetype:text/plain" COPYING
851@end example
852
853@menu
854* Important command-line options::
855* Indexing vs. Inserting::
856@end menu
857
858@node Important command-line options
859@subsubsection Important command-line options
860
861
862The option @code{-k} is used to specify keywords for the file that
863should be inserted. You can supply any number of keywords,
864and each of the keywords will be sufficient to locate and
865retrieve the file. Please note that you must use the @code{-k} option
866more than once -- one for each expression you use as a keyword for
867the filename.
868
869The -m option is used to specify meta-data, such as descriptions.
870You can use -m multiple times. The TYPE passed must be from the
871list of meta-data types known to libextractor. You can obtain this
872list by running @command{extract -L}. Use quotes around the entire
873meta-data argument if the value contains spaces. The meta-data
874is displayed to other users when they select which files to
875download. The meta-data and the keywords are optional and
876may be inferred using @code{GNU libextractor}.
877
878@command{gnunet-publish} has a few additional options to handle
879namespaces and directories. Refer to the man-page for details:
880
881@example
882man gnunet-publish
883@end example
884
885@node Indexing vs. Inserting
886@subsubsection Indexing vs Inserting
887
888
889By default, GNUnet indexes a file instead of making a full copy.
890This is much more efficient, but requires the file to stay unaltered
891at the location where it was when it was indexed. If you intend to move,
892delete or alter a file, consider using the option @code{-n} which will
893force GNUnet to make a copy of the file in the database.
894
895Since it is much less efficient, this is strongly discouraged for large
896files. When GNUnet indexes a file (default), GNUnet does @strong{not}
897create an additional encrypted copy of the file but just computes a
898summary (or index) of the file. That summary is approximately two percent
899of the size of the original file and is stored in GNUnet's database.
900Whenever a request for a part of an indexed file reaches GNUnet,
901this part is encrypted on-demand and send out. This way, there is no
902need for an additional encrypted copy of the file to stay anywhere
903on the drive. This is different from other systems, such as Freenet,
904where each file that is put online must be in Freenet's database in
905encrypted format, doubling the space requirements if the user wants
906to preserve a directly accessible copy in plaintext.
907
908Thus indexing should be used for all files where the user will keep
909using this file (at the location given to gnunet-publish) and does
910not want to retrieve it back from GNUnet each time. If you want to
911remove a file that you have indexed from the local peer, use the tool
912@command{gnunet-unindex} to un-index the file.
913
914The option @code{-n} may be used if the user fears that the file might
915be found on their drive (assuming the computer comes under the control
916of an adversary). When used with the @code{-n} flag, the user has a
917much better chance of denying knowledge of the existence of the file,
918even if it is still (encrypted) on the drive and the adversary is
919able to crack the encryption (e.g. by guessing the keyword.
920
921@node fs-Concepts
922@subsection Concepts
923
924
925For better results with filesharing it is useful to understand the
926following concepts.
927In addition to anonymous routing GNUnet attempts to give users a better
928experience in searching for content. GNUnet uses cryptography to safely
929break content into smaller pieces that can be obtained from different
930sources without allowing participants to corrupt files. GNUnet makes it
931difficult for an adversary to send back bogus search results. GNUnet
932enables content providers to group related content and to establish a
933reputation. Furthermore, GNUnet allows updates to certain content to be
934made available. This section is supposed to introduce users to the
935concepts that are used to achieve these goals.
936
937
938@menu
939* Files::
940* Keywords::
941* Directories::
942* Egos and File-Sharing::
943* Namespaces::
944* Advertisements::
945* Anonymity level::
946* Content Priority::
947* Replication::
948@end menu
949
950@node Files
951@subsubsection Files
952
953
954A file in GNUnet is just a sequence of bytes. Any file-format is allowed
955and the maximum file size is theoretically @math{2^64 - 1} bytes, except
956that it would take an impractical amount of time to share such a file.
957GNUnet itself never interprets the contents of shared files, except when
958using GNU libextractor to obtain keywords.
959
960@node Keywords
961@subsubsection Keywords
962
963
964Keywords are the most simple mechanism to find files on GNUnet.
965Keywords are @strong{case-sensitive} and the search string
966must always match @strong{exactly} the keyword used by the
967person providing the file. Keywords are never transmitted in
968plaintext. The only way for an adversary to determine the keyword
969that you used to search is to guess it (which then allows the
970adversary to produce the same search request). Since providing
971keywords by hand for each shared file is tedious, GNUnet uses
972GNU libextractor to help automate this process. Starting a
973keyword search on a slow machine can take a little while since
974the keyword search involves computing a fresh RSA key to formulate the
975request.
976
977@node Directories
978@subsubsection Directories
979
980
981A directory in GNUnet is a list of file identifiers with meta data.
982The file identifiers provide sufficient information about the files
983to allow downloading the contents. Once a directory has been created,
984it cannot be changed since it is treated just like an ordinary file
985by the network. Small files (of a few kilobytes) can be inlined in
986the directory, so that a separate download becomes unnecessary.
987
988Directories are shared just like ordinary files. If you download a
989directory with @command{gnunet-download}, you can use
990@command{gnunet-directory} to list its contents. The canonical
991extension for GNUnet directories when stored as files in your
992local file-system is ".gnd". The contents of a directory are URIs and
993meta data.
994The URIs contain all the information required by
995@command{gnunet-download} to retrieve the file. The meta data
996typically includes the mime-type, description, a filename and
997other meta information, and possibly even the full original file
998(if it was small).
999
1000@node Egos and File-Sharing
1001@subsubsection Egos and File-Sharing
1002
1003When sharing files, it is sometimes desirable to build a reputation as
1004a source for quality information. With egos, publishers can
1005(cryptographically) sign files, thereby demonstrating that various
1006files were published by the same entity. An ego thus allows users to
1007link different publication events, thereby deliberately reducing
1008anonymity to pseudonymity.
1009
1010Egos used in GNUnet's file-sharing for such pseudonymous publishing
1011also correspond to the egos used to identify and sign zones in the
1012GNU Name System. However, if the same ego is used for file-sharing
1013and for a GNS zone, this will weaken the privacy assurances provided
1014by the anonymous file-sharing protocol.
1015
1016Note that an ego is NOT bound to a GNUnet peer. There can be multiple
1017egos for a single user, and users could (theoretically) share
1018the private keys of an ego by copying the respective private keys.
1019
1020
1021@node Namespaces
1022@subsubsection Namespaces
1023
1024A namespace is a set of files that were signed by the same ego.
1025Today, namespaces are implemented independently of GNS zones, but
1026in the future we plan to merge the two such that a GNS zone can
1027basically contain files using a file-sharing specific record type.
1028
1029Files (or directories) that have been signed and placed into a
1030namespace can be updated. Updates are identified as authentic if the
1031same secret key was used to sign the update.
1032
1033@node Advertisements
1034@subsubsection Advertisements
1035
1036Advertisements are used to notify other users about the existence of a
1037namespace. Advertisements are propagated using the normal keyword
1038search. When an advertisement is received (in response to a search),
1039the namespace is added to the list of namespaces available in the
1040namespace-search dialogs of gnunet-fs-gtk and printed by
1041@code{gnunet-identity}. Whenever a namespace is created, an
1042appropriate advertisement can be generated. The default keyword for
1043the advertising of namespaces is "namespace".
1044
1045
1046@node Anonymity level
1047@subsubsection Anonymity level
1048
1049The anonymity level determines how hard it should be for an adversary to
1050determine the identity of the publisher or the searcher/downloader. An
1051anonymity level of zero means that anonymity is not required. The default
1052anonymity level of "1" means that anonymous routing is desired, but no
1053particular amount of cover traffic is necessary. A powerful adversary
1054might thus still be able to deduce the origin of the traffic using
1055traffic analysis. Specifying higher anonymity levels increases the
1056amount of cover traffic required.
1057
1058The specific numeric value (for anonymity levels above 1) is simple:
1059Given an anonymity level L (above 1), each request FS makes on your
1060behalf must be hidden in L-1 equivalent requests of cover traffic
1061(traffic your peer routes for others) in the same time-period. The
1062time-period is twice the average delay by which GNUnet artificially
1063delays traffic.
1064
1065While higher anonymity levels may offer better privacy, they can also
1066significantly hurt performance.
1067
1068
1069@node Content Priority
1070@subsubsection Content Priority
1071
1072Depending on the peer's configuration, GNUnet peers migrate content
1073between peers. Content in this sense are individual blocks of a file,
1074not necessarily entire files. When peers run out of space (due to
1075local publishing operations or due to migration of content from other
1076peers), blocks sometimes need to be discarded. GNUnet first always
1077discards expired blocks (typically, blocks are published with an
1078expiration of about two years in the future; this is another option).
1079If there is still not enough space, GNUnet discards the blocks with the
1080lowest priority. The priority of a block is decided by its popularity
1081(in terms of requests from peers we trust) and, in case of blocks
1082published locally, the base-priority that was specified by the user
1083when the block was published initially.
1084
1085
1086@node Replication
1087@subsubsection Replication
1088
1089When peers migrate content to other systems, the replication level
1090of a block is used to decide which blocks need to be migrated most
1091urgently. GNUnet will always push the block with the highest
1092replication level into the network, and then decrement the replication
1093level by one. If all blocks reach replication level zero, the
1094selection is simply random.
1095
1096
1097@node Namespace Management
1098@subsection Namespace Management
1099
1100The @code{gnunet-identity} tool can be used to create egos.
1101By default, @code{gnunet-identity --display} simply
1102lists all locally available egos.
1103
1104
1105@menu
1106* Creating Egos::
1107* Deleting Egos::
1108@end menu
1109
1110@node Creating Egos
1111@subsubsection Creating Egos
1112
1113With the @command{--create=NICK} option it can also be used to create a new
1114ego. An ego is the virtual identity of the entity in control of a
1115namespace or GNS zone. Anyone can create any number of egos. The
1116provided NICK name automatically corresponds to a GNU Name System
1117domain name. Thus, henceforth name resolution for any name ending in
1118``.NICK'' will use the NICK's zone. You should avoid using NICKs that
1119collide with well-known DNS names.
1120
1121Currently, the IDENTITY subsystem supports two types of identity keys:
1122ECDSA and EdDSA. By default, ECDSA identities are creates with ECDSA keys.
1123In order to create an identity with EdDSA keys, you can use the
1124@command{--eddsa} flag.
1125
1126@node Deleting Egos
1127@subsubsection Deleting Egos
1128
1129With the @command{-D NICK} option egos can be deleted. Once the ego
1130has been deleted it is impossible to add content to the corresponding
1131namespace or zone. However, the existing GNS zone data is currently
1132not dropped. This may change in the future.
1133
1134Deleting the pseudonym does not make the namespace or any content in
1135it unavailable.
1136
1137@node File-Sharing URIs
1138@subsection File-Sharing URIs
1139
1140
1141GNUnet (currently) uses four different types of URIs for
1142file-sharing. They all begin with "gnunet://fs/".
1143This section describes the four different URI types in detail.
1144
1145For FS URIs empty KEYWORDs are not allowed. Quotes are allowed to
1146denote whitespace between words. Keywords must contain a balanced
1147number of double quotes. Doubles quotes can not be used in the actual
1148keywords. This means that the string '""foo bar""' will be turned
1149into two OR-ed keywords 'foo' and 'bar', not into '"foo bar"'.
1150
1151@menu
1152* Encoding of hash values in URIs::
1153* Content Hash Key (chk)::
1154* Location identifiers (loc)::
1155* Keyword queries (ksk)::
1156* Namespace content (sks)::
1157@end menu
1158
1159@node Encoding of hash values in URIs
1160@subsubsection Encoding of hash values in URIs
1161
1162
1163Most URIs include some hash values. Hashes are encoded using
1164base32hex (RFC 2938).
1165
1166@cindex chk-uri
1167@node Content Hash Key (chk)
1168@subsubsection Content Hash Key (chk)
1169
1170
1171A chk-URI is used to (uniquely) identify a file or directory
1172and to allow peers to download the file. Files are stored in
1173GNUnet as a tree of encrypted blocks.
1174The chk-URI thus contains the information to download and decrypt
1175those blocks. A chk-URI has the format
1176"gnunet://fs/chk/KEYHASH.QUERYHASH.SIZE". Here, "SIZE"
1177is the size of the file (which allows a peer to determine the
1178shape of the tree), KEYHASH is the key used to decrypt the file
1179(also the hash of the plaintext of the top block) and QUERYHASH
1180is the query used to request the top-level block (also the hash
1181of the encrypted block).
1182
1183@cindex loc-uri
1184@node Location identifiers (loc)
1185@subsubsection Location identifiers (loc)
1186
1187
1188For non-anonymous file-sharing, loc-URIs are used to specify which
1189peer is offering the data (in addition to specifying all of the
1190data from a chk-URI). Location identifiers include a digital
1191signature of the peer to affirm that the peer is truly the
1192origin of the data. The format is
1193"gnunet://fs/loc/KEYHASH.QUERYHASH.SIZE.PEER.SIG.EXPTIME".
1194Here, "PEER" is the public key of the peer (in GNUnet format in
1195base32hex), SIG is the RSA signature (in GNUnet format in
1196base32hex) and EXPTIME specifies when the signature expires
1197(in milliseconds after 1970).
1198
1199@cindex ksk-uri
1200@node Keyword queries (ksk)
1201@subsubsection Keyword queries (ksk)
1202
1203
1204A keyword-URI is used to specify that the desired operation
1205is the search using a particular keyword. The format is simply
1206"gnunet://fs/ksk/KEYWORD". Non-ASCII characters can be specified
1207using the typical URI-encoding (using hex values) from HTTP.
1208"+" can be used to specify multiple keywords (which are then
1209logically "OR"-ed in the search, results matching both keywords
1210are given a higher rank): "gnunet://fs/ksk/KEYWORD1+KEYWORD2".
1211ksk-URIs must not begin or end with the plus ('+') character.
1212Furthermore they must not contain '++'.
1213
1214@cindex sks-uri
1215@node Namespace content (sks)
1216@subsubsection Namespace content (sks)
1217
1218
1219@b{Please note that the text in this subsection is outdated and needs}
1220@b{to be rewritten for version 0.10!}
1221@b{This especially concerns the terminology of Pseudonym/Ego/Identity.}
1222
1223Namespaces are sets of files that have been approved by some (usually
1224pseudonymous) user --- typically by that user publishing all of the
1225files together. A file can be in many namespaces. A file is in a
1226namespace if the owner of the ego (aka the namespace's private key)
1227signs the CHK of the file cryptographically. An SKS-URI is used to
1228search a namespace. The result is a block containing meta data,
1229the CHK and the namespace owner's signature. The format of a sks-URI
1230is "gnunet://fs/sks/NAMESPACE/IDENTIFIER". Here, "NAMESPACE"
1231is the public key for the namespace. "IDENTIFIER" is a freely
1232chosen keyword (or password!). A commonly used identifier is
1233"root" which by convention refers to some kind of index or other
1234entry point into the namespace.
1235
1236@node GTK User Interface
1237@subsection GTK User Interface
1238This chapter describes first steps for file-sharing with GNUnet.
1239To start, you should launch @command{gnunet-fs-gtk}.
1240
1241As we want to be sure that the network contains the data that we are
1242looking for for testing, we need to begin by publishing a file.
1243
1244@menu
1245* gtk-Publishing::
1246* gtk-Searching::
1247* gtk-Downloading::
1248@end menu
1249
1250@node gtk-Publishing
1251@subsubsection Publishing
1252
1253
1254To publish a file, select "File Sharing" in the menu bar just below the
1255"Statistics" icon, and then select "Publish" from the menu.
1256
1257Afterwards, the following publishing dialog will appear:
1258
1259@image{images/gnunet-gtk-0-10-fs-publish,5in,,The gnunet-fs-gtk publishing dialog}
1260
1261In this dialog, select the "Add File" button. This will open a
1262file selection dialog:
1263
1264@image{images/gnunet-gtk-0-10-fs-publish-select,5in,,Dialog to select the file to publish (looks may differ for other Gtk+ versions)}
1265
1266Now, you should select a file from your computer to be published on
1267GNUnet. To see more of GNUnet's features later, you should pick a
1268PNG or JPEG file this time. You can leave all of the other options
1269in the dialog unchanged. Confirm your selection by pressing the "OK"
1270button in the bottom right corner. Now, you will briefly see a
1271"Messages..." dialog pop up, but most likely it will be too short for
1272you to really read anything. That dialog is showing you progress
1273information as GNUnet takes a first look at the selected file(s).
1274For a normal image, this is virtually instant, but if you later
1275import a larger directory you might be interested in the progress dialog
1276and potential errors that might be encountered during processing.
1277After the progress dialog automatically disappears, your file
1278should now appear in the publishing dialog:
1279
1280@image{images/gnunet-gtk-0-10-fs-publish-with-file,5in,,Publishing dialog with file added}
1281
1282Now, select the file (by clicking on the file name) and then click
1283the "Edit" button. This will open the editing dialog:
1284
1285@image{images/gnunet-gtk-0-10-fs-publish-editing,5in,,Editing meta data of a file to be published}
1286
1287In this dialog, you can see many details about your file. In the
1288top left area, you can see meta data extracted about the file,
1289such as the original filename, the mimetype and the size of the image.
1290In the top right, you should see a preview for the image
1291(if GNU libextractor was installed correctly with the
1292respective plugins). Note that if you do not see a preview, this
1293is not a disaster, but you might still want to install more of
1294GNU libextractor in the future. In the bottom left, the dialog contains
1295a list of keywords. These are the keywords under which the file will be
1296made available. The initial list will be based on the extracted meta data.
1297Additional publishing options are in the right bottom corner. We will
1298now add an additional keyword to the list of keywords. This is done by
1299entering the keyword above the keyword list between the label "Keyword"
1300and the "Add keyword" button. Enter "test" and select "Add keyword".
1301Note that the keyword will appear at the bottom of the existing keyword
1302list, so you might have to scroll down to see it. Afterwards, push the
1303"OK" button at the bottom right of the dialog.
1304
1305You should now be back at the "Publish content on GNUnet" dialog. Select
1306"Execute" in the bottom right to close the dialog and publish your file
1307on GNUnet! Afterwards, you should see the main dialog with a new area
1308showing the list of published files (or ongoing publishing operations
1309with progress indicators).
1310
1311@node gtk-Searching
1312@subsubsection Searching
1313
1314
1315Below the menu bar, there are four entry widges labeled "Namespace",
1316"Keywords", "Anonymity" and "Mime-type" (from left to right). These
1317widgets are used to control searching for files in GNUnet. Between the
1318"Keywords" and "Anonymity" widgets, there is also a big "Search" button,
1319which is used to initiate the search. We will ignore the "Namespace",
1320"Anonymity" and "Mime-type" options in this tutorial, please leave them
1321empty. Instead, simply enter "test" under "Keywords" and press "Search".
1322Afterwards, you should immediately see a new tab labeled after your
1323search term, followed by the (current) number of search
1324results --- "(15)" in our screenshot. Note that your results may
1325vary depending on what other users may have shared and how your
1326peer is connected.
1327
1328You can now select one of the search results. Once you do this,
1329additional information about the result should be displayed on the
1330right. If available, a preview image should appear on the top right.
1331Meta data describing the file will be listed at the bottom right.
1332
1333Once a file is selected, at the bottom of the search result list
1334a little area for downloading appears.
1335
1336@node gtk-Downloading
1337@subsubsection Downloading
1338
1339
1340In the downloading area, you can select the target directory (default is
1341"Downloads") and specify the desired filename (by default the filename it
1342taken from the meta data of the published file). Additionally, you can
1343specify if the download should be anonymous and (for directories) if
1344the download should be recursive. In most cases, you can simply start
1345the download with the "Download!" button.
1346
1347Once you selected download, the progress of the download will be
1348displayed with the search result. You may need to resize the result
1349list or scroll to the right. The "Status" column shows the current
1350status of the download, and "Progress" how much has been completed.
1351When you close the search tab (by clicking on the "X" button next to
1352the "test" label), ongoing and completed downloads are not aborted
1353but moved to a special "*" tab.
1354
1355You can remove completed downloads from the "*" tab by clicking the
1356cleanup button next to the "*". You can also abort downloads by right
1357clicking on the respective download and selecting "Abort download"
1358from the menu.
1359
1360That's it, you now know the basics for file-sharing with GNUnet!
1361
1362
1363@node The GNU Name System
1364@section The GNU Name System
1365
1366
1367
1368The GNU Name System (GNS) is secure and decentralized naming system.
1369It allows its users to register names as @dfn{top-level domains} (TLDs) and
1370resolve other namespaces within their TLDs.
1371
1372GNS is designed to provide:
1373@itemize @bullet
1374@item Censorship resistance
1375@item Query privacy
1376@item Secure name resolution
1377@item Compatibility with DNS
1378@end itemize
1379
1380For the initial configuration and population of your
1381GNS installation, please follow the GNS setup instructions.
1382The remainder of this chapter will provide some background on GNS
1383and then describe how to use GNS in more detail.
1384
1385Unlike DNS, GNS does not rely on central root zones or authorities.
1386Instead any user administers their own root and can can create arbitrary
1387name value mappings. Furthermore users can delegate resolution to other
1388users' zones just like DNS NS records do. Zones are uniquely identified
1389via public keys and resource records are signed using the corresponding
1390public key. Delegation to another user's zone is done using special PKEY
1391records and petnames. A petname is a name that can be freely chosen by
1392the user. This results in non-unique name-value mappings as
1393@code{@uref{http://www.bob.gnu/, www.bob.gnu}} to one user might be
1394@code{@uref{http://www.friend.gnu/, www.friend.gnu}} for someone else.
1395
1396
1397@menu
1398* Creating a Zone::
1399* Maintaining your own Zones::
1400* Obtaining your Zone Key::
1401* Adding Links to Other Zones::
1402* Using Public Keys as Top Level Domains::
1403* Resource Records in GNS::
1404* Synchronizing with legacy DNS::
1405* Migrating an existing DNS zone into GNS::
1406@end menu
1407
1408
1409@node Creating a Zone
1410@subsection Creating a Zone
1411
1412To use GNS, you probably should create at least one zone of your own.
1413You can create any number of zones using the gnunet-identity tool
1414using:
1415
1416@example
1417$ gnunet-identity --create="myzone"
1418@end example
1419
1420Henceforth, on your system you control the TLD ``myzone''.
1421
1422All of your zones can be listed (displayed) using the
1423@command{gnunet-identity} command line tool as well:
1424
1425@example
1426$ gnunet-identity --display
1427@end example
1428
1429@node Maintaining your own Zones
1430@subsection Maintaining your own Zones
1431
1432@noindent
1433Now you can add (or edit, or remove) records in your GNS zone using the
1434@command{gnunet-namestore-gtk} GUI or using the @command{gnunet-namestore}
1435command-line tool.
1436In either case, your records will be stored in an SQL database under
1437control of the @command{gnunet-service-namestore}.
1438Note that if multiple users use one peer, the namestore database will
1439include the combined records of all users.
1440However, users will not be able to see each other's records
1441if they are marked as private.
1442
1443To provide a short example for editing your own zone, suppose you
1444have your own web server with the IP @code{1.2.3.4}. Then you can put an
1445@code{A} record (@code{A} records in DNS are for IPv4 IP addresses)
1446into your local zone ``myzone'' using the command:
1447
1448@example
1449$ gnunet-namestore -z myzone -a -n www -t A -V 1.2.3.4 -e never
1450@end example
1451
1452@noindent
1453Afterwards, you will be able to access your webpage under "www.myzone"
1454(assuming your webserver does not use virtual hosting, if it does,
1455please read up on setting up the GNS proxy).
1456
1457Similar commands will work for other types of DNS and GNS records,
1458the syntax largely depending on the type of the record.
1459Naturally, most users may find editing the zones using the
1460@command{gnunet-namestore-gtk} GUI to be easier.
1461
1462@node Obtaining your Zone Key
1463@subsection Obtaining your Zone Key
1464
1465Each zone in GNS has a public-private key. Usually, gnunet-namestore and
1466gnunet-setup will access your private key as necessary, so you do not
1467have to worry about those. What is important is your public key
1468(or rather, the hash of your public key), as you will likely want to
1469give it to others so that they can securely link to you.
1470
1471You can usually get the hash of your public key using
1472
1473@example
1474$ gnunet-identity -d $options | grep myzone | awk '@{print $3@}'
1475@end example
1476
1477@noindent
1478For example, the output might be something like:
1479
1480@example
1481DC3SEECJORPHQNVRH965A6N74B1M37S721IG4RBQ15PJLLPJKUE0
1482@end example
1483
1484@noindent
1485Alternatively, you can obtain a QR code with your zone key AND your
1486pseudonym from gnunet-namestore-gtk. The QR code is displayed in the
1487main window and can be stored to disk using the ``Save as'' button
1488next to the image.
1489
1490@node Adding Links to Other Zones
1491@subsection Adding Links to Other Zones
1492
1493
1494A central operation in GNS is the ability to securely delegate to
1495other zones. Basically, by adding a delegation you make all of the
1496names from the other zone available to yourself. This section
1497describes how to create delegations.
1498
1499Suppose you have a friend who you call 'bob' who also uses GNS.
1500You can then delegate resolution of names to Bob's zone by adding
1501a PKEY record to their local zone:
1502
1503@example
1504$ gnunet-namestore -a -n bob --type PKEY -V XXXX -e never -Z myzone
1505@end example
1506
1507@noindent
1508Note that ``XXXX'' in the command above must be replaced with the hash
1509of Bob's public key (the output your friend obtained using the
1510@command{gnunet-identity} command from the previous section and told
1511you, for example by giving you a business card containing this
1512information as a QR code).
1513
1514Assuming Bob has an ``A'' record for their website under the name of
1515``www'' in his zone, you can then access Bob's website under
1516``www.bob.myzone'' --- as well as any (public) GNS record that Bob has
1517in their zone by replacing www with the respective name of the
1518record in Bob's zone.
1519
1520@c themselves? themself?
1521Furthermore, if Bob has themselves a (public) delegation to Carol's
1522zone under "carol", you can access Carol's records under
1523``NAME.carol.bob.myzone'' (where ``NAME'' is the name of Carol's
1524record you want to access).
1525
1526
1527@node Using Public Keys as Top Level Domains
1528@subsection Using Public Keys as Top Level Domains
1529
1530
1531GNS also assumes responsibility for any name that uses in a
1532well-formed public key for the TLD. Names ending this way are then
1533resolved by querying the respective zone. Such public key TLDs are
1534expected to be used under rare circumstances where globally unique
1535names are required, and for integration with legacy systems.
1536
1537@node Resource Records in GNS
1538@subsection Resource Records in GNS
1539
1540
1541GNS supports the majority of the DNS records as defined in
1542@uref{http://www.ietf.org/rfc/rfc1035.txt, RFC 1035}. Additionally,
1543GNS defines some new record types the are unique to the GNS system.
1544For example, GNS-specific resource records are used to give petnames
1545for zone delegation, revoke zone keys and provide some compatibility
1546features.
1547
1548For some DNS records, GNS does extended processing to increase their
1549usefulness in GNS. In particular, GNS introduces special names
1550referred to as "zone relative names". Zone relative names are allowed
1551in some resource record types (for example, in NS and CNAME records)
1552and can also be used in links on webpages. Zone relative names end
1553in ".+" which indicates that the name needs to be resolved relative
1554to the current authoritative zone. The extended processing of those
1555names will expand the ".+" with the correct delegation chain to the
1556authoritative zone (replacing ".+" with the name of the location
1557where the name was encountered) and hence generate a
1558valid GNS name.
1559
1560The GNS currently supports the record types as defined in
1561@uref{https://git.gnunet.org/gana.git/tree/gnu-name-system-record-types/registry.rec, GANA}.
1562In addition, GNS supports DNS record types, such as A, AAAA or TXT.
1563
1564For a complete description of the records, please refer to the specification
1565at @uref{https://lsd.gnunet.org/lsd0001, LSD0001}.
1566
1567In the following, we discuss GNS records with specific behaviour or special
1568handling of DNS records.
1569
1570@menu
1571* NICK::
1572* PKEY::
1573* BOX::
1574* LEHO::
1575* VPN::
1576* REDIRECT::
1577* GNS2DNS::
1578* TOMBSTONE::
1579* SOA SRV PTR and MX::
1580@end menu
1581
1582@node NICK
1583@subsubsection NICK
1584
1585A NICK record is used to give a zone a name. With a NICK record, you
1586can essentially specify how you would like to be called. GNS expects
1587this record under the empty label ``@@'' in the zone's database
1588(NAMESTORE); however, it will then automatically be copied into each
1589record set, so that clients never need to do a separate lookup to
1590discover the NICK record. Also, users do not usually have to worry
1591about setting the NICK record: it is automatically set to the local
1592name of the TLD.
1593
1594@b{Example}@
1595
1596@example
1597Name: @@; RRType: NICK; Value: bob
1598@end example
1599
1600@noindent
1601This record in Bob's zone will tell other users that this zone wants
1602to be referred to as 'bob'. Note that nobody is obliged to call Bob's
1603zone 'bob' in their own zones. It can be seen as a
1604recommendation ("Please call this zone 'bob'").
1605
1606@node PKEY
1607@subsubsection PKEY
1608
1609PKEY records are used to add delegation to other users' zones and
1610give those zones a petname.
1611
1612@b{Example}@
1613
1614Let Bob's zone be identified by the hash "ABC012". Bob is your friend
1615so you want to give them the petname "friend". Then you add the
1616following record to your zone:
1617
1618@example
1619Name: friend; RRType: PKEY; Value: ABC012;
1620@end example
1621
1622@noindent
1623This will allow you to resolve records in bob's zone
1624under "*.friend.gnu".
1625
1626@node BOX
1627@subsubsection BOX
1628
1629BOX records are there to integrate information from TLSA or
1630SRV records under the main label. In DNS, TLSA and SRV records
1631use special names of the form @code{_port._proto.(label.)*tld} to
1632indicate the port number and protocol (like TCP or UDP) for which
1633the TLSA or SRV record is valid. This causes various problems, and
1634is elegantly solved in GNS by integrating the protocol and port
1635numbers together with the respective value into a "BOX" record.
1636Note that in the GUI, you do not get to edit BOX records directly
1637right now --- the GUI will provide the illusion of directly
1638editing the TLSA and SRV records, even though they internally
1639are BOXed up.
1640
1641@node LEHO
1642@subsubsection LEHO
1643
1644The LEgacy HOstname of a server. Some webservers expect a specific
1645hostname to provide a service (virtual hosting). Also SSL
1646certificates usually contain DNS names. To provide the expected
1647legacy DNS name for a server, the LEHO record can be used.
1648To mitigate the just mentioned issues the GNS proxy has to be used.
1649The GNS proxy will use the LEHO information to apply the necessary
1650transformations.
1651
1652@node VPN
1653@subsubsection VPN
1654
1655GNS allows easy access to services provided by the GNUnet Virtual Public
1656Network. When the GNS resolver encounters a VPN record it will contact
1657the VPN service to try and allocate an IPv4/v6 address (if the queries
1658record type is an IP address) that can be used to contact the service.
1659
1660@b{Example}@
1661
1662I want to provide access to the VPN service "web.gnu." on port 80 on peer
1663ABC012:@
1664Name: www; RRType: VPN; Value: 80 ABC012 web.gnu.
1665
1666The peer ABC012 is configured to provide an exit point for the service
1667"web.gnu." on port 80 to it's server running locally on port 8080 by
1668having the following lines in the @file{gnunet.conf} configuration file:
1669
1670@example
1671[web.gnunet.]
1672TCP_REDIRECTS = 80:localhost4:8080
1673@end example
1674
1675@node REDIRECT
1676@subsubsection REDIRECT
1677
1678As specified in LSD0001 whenever a REDIRECT is encountered the query
1679needs to be restarted with the specified name. A REDIRECT
1680can either be:
1681
1682@itemize @bullet
1683@item A zone relative name,
1684@item A zkey name or
1685@item A DNS name (in which case resolution will continue outside
1686of GNS with the systems DNS resolver)
1687@end itemize
1688
1689@node GNS2DNS
1690@subsubsection GNS2DNS
1691
1692GNS can delegate authority to a legacy DNS zone. For this, the
1693name of the DNS nameserver and the name of the DNS zone are
1694specified in a GNS2DNS record.
1695
1696@b{Example}
1697
1698@example
1699Name: pet; RRType: GNS2DNS; Value: gnunet.org@@a.ns.joker.com
1700@end example
1701
1702@noindent
1703Any query to @code{pet.gnu} will then be delegated to the DNS server at
1704@code{a.ns.joker.com}. For example,
1705@code{@uref{http://www.pet.gnu/, www.pet.gnu}} will result in a DNS query
1706for @code{@uref{http://www.gnunet.org/, www.gnunet.org}} to the server
1707at @code{a.ns.joker.com}. Delegation to DNS via NS records in GNS can
1708be useful if you do not want to start resolution in the DNS root zone
1709(due to issues such as censorship or availability).
1710
1711Note that you would typically want to use a relative name for the
1712nameserver, like so:
1713
1714@example
1715Name: pet; RRType: GNS2DNS; Value: gnunet.org@@ns-joker.+@
1716
1717Name: ns-joker; RRType: A; Value: 184.172.157.218
1718@end example
1719
1720@noindent
1721This way, you can avoid involving the DNS hierarchy in the resolution of
1722@code{a.ns.joker.com}. In the example above, the problem may not be
1723obvious as the nameserver for "gnunet.org" is in the ".com" zone.
1724However, imagine the nameserver was "ns.gnunet.org". In this case,
1725delegating to "ns.gnunet.org" would mean that despite using GNS,
1726censorship in the DNS ".org" zone would still be effective.
1727
1728@node TOMBSTONE
1729@subsubsection TOMBSTONE
1730
1731The GNUnet GNS implementation uses the TOMBSTONE record to ensure
1732ciphertext indistinguishability for published records.
1733It must be ensured that when relative expiration times are decreased, the
1734expiration time of the next record block MUST be after the last published block.
1735A similar issue arises if the record set under a label is deleted and reused
1736later.
1737
1738The creation and maintenance of the TOMBSTONE record is done automatically.
1739You do not need to mind it yourself and can safely ignore any TOMBSTONE
1740blocks you may see when investigating your zone(s).
1741TOMBSTONE records are always private and will never be published.
1742
1743@node SOA SRV PTR and MX
1744@subsubsection SOA SRV PTR and MX
1745
1746The domain names in those records can, again, be either
1747
1748@itemize @bullet
1749@item A zone relative name,
1750@item A zkey name or
1751@item A DNS name
1752@end itemize
1753
1754The resolver will expand the zone relative name if possible.
1755Note that when using MX records within GNS, the target mail
1756server might still refuse to accept e-mails to the resulting
1757domain as the name might not match. GNS-enabled mail clients
1758should use the ZKEY zone as the destination hostname and
1759GNS-enabled mail servers should be configured to accept
1760e-mails to the ZKEY-zones of all local users.
1761
1762To add a SOA record via the gnunet-namestore command line
1763tool use the following syntax for the value option. Choose
1764the other options according to your preference, however in
1765this example we will use a relative expiry, add the record
1766under the label @ and add the records to the zone bar
1767which already exists:
1768
1769@example
1770$ gnunet-namestore -a -n @ -t SOA -z bar -e 3600s -V \
1771> "rname=$PRIMARY_NS \
1772> mname=$CONTACT_MAIL \
1773> $SERIAL,$REFRESH,$RETRY,$EXPIRY,$MINIMUM_TTL"
1774@end example
1775
1776The above command filled in with values looks like this:
1777@example
1778$ gnunet-namestore -a -n @ -t SOA -z bar -e 3600s -V \
1779> "rname=ns1.bar \
1780> mname=root.bar \
1781> 2019081701,3600,1800,86400,7200"
1782@end example
1783
1784MX records use a similar syntax which is outlined in the
1785example below. $SERVER is a domain name as mentioned above.
1786@example
1787$ gnunet-namestore -a -n mail -t MX -z bar -e 3600s -V \
1788> "$PRIORITY,$SERVER"
1789@end example
1790
1791With the values substituted this is an example of a working
1792command:
1793@example
1794$ gnunet-namestore -a -n mail -t MX -z bar -e 3600s -V \
1795> "10,mail.bar"
1796@end example
1797
1798@node Synchronizing with legacy DNS
1799@subsection Synchronizing with legacy DNS
1800
1801If you want to support GNS but the master database for a zone
1802is only available and maintained in DNS, GNUnet includes the
1803@command{gnunet-zoneimport} tool to monitor a DNS zone and
1804automatically import records into GNS. Today, the tool does
1805not yet support DNS AF(X)R, as we initially used it on the
1806``.fr'' zone which does not allow us to perform a DNS zone
1807transfer. Instead, @command{gnunet-zoneimport} reads a list
1808of DNS domain names from @code{stdin}, issues DNS queries for
1809each, converts the obtained records (if possible) and stores
1810the result in the namestore.
1811
1812@image{images/gns,6in,, picture of DNS-GNS data flow}
1813
1814The zonemaster service then takes the records from the namestore,
1815publishes them into the DHT which makes the result available to the
1816GNS resolver. In the GNS configuration, non-local zones can be
1817configured to be intercepted by specifying ``.tld = PUBLICKEY'' in the
1818configuration file in the ``[gns]'' section.
1819
1820Note that the namestore by default also populates the namecache.
1821This pre-population is cryptographically expensive. Thus, on
1822systems that only serve to import a large (millions of records)
1823DNS zone and that do not have a local gns service in use, it
1824is thus advisable to disable the namecache by setting the
1825option ``DISABLE'' to ``YES'' in section ``[namecache]''.
1826
1827@node Migrating an existing DNS zone into GNS
1828@subsection Migrating an existing DNS zone into GNS
1829
1830Ascension is a tool to migrate existing DNS zones into GNS.
1831
1832@xref{Migrating existing DNS zones into GNS}, for installation instructions and
1833further information about Ascension.
1834
1835Compared to the gnunet-zoneimport tool it strictly uses AXFR or IXFR depending
1836on whether or not there exists a SOA record for the zone. If that is the case it
1837will take the serial as a reference point and request the zone. The server will
1838either answer the IXFR request with a correct incremental zone or with the
1839entire zone, which depends on the server configuration.
1840
1841After installing the tool according to the README file you have the following
1842options:
1843
1844@example
1845Ascension
1846Usage:
1847 ascension <domain> [-d] [-p] [-s] [--minimum-ttl=<ttl>] \
1848 [--dry-run]
1849 ascension <domain> <port> [-d] [-p] [-s] \
1850 [--minimum-ttl=<ttl>] [--dry-run]
1851 ascension <domain> -n <transferns> [-d] [-p] \
1852 [-s] [--minimum-ttl=<ttl>] [--dry-run]
1853 ascension <domain> -n <transferns> <port> [-d] \
1854 [-p] [-s] [--minimum-ttl=<ttl>] [--dry-run]
1855 ascension -p | --public
1856 ascension -d | --debug
1857 ascension -s | --standalone
1858 ascension -h | --help
1859 ascension -v | --version
1860
1861Options:
1862 <domain> Domain to migrate
1863 <port> Port for zone transfer
1864 <transferns> DNS Server that does the zone transfer
1865 --minimum-ttl=<ttl> Minimum TTL for records to migrate \
1866 [default: 3600]
1867 --dry-run Only try if a zone transfer is allowed
1868 -p --public Make records public on the DHT
1869 -s --standalone Run ascension once
1870 -d --debug Enable debugging
1871 -h --help Show this screen.
1872 -v --version Show version.
1873@end example
1874
1875Before you can migrate any zone though, you need to start a local GNUnet peer:
1876@example
1877$ gnunet-arm -s
1878@end example
1879
1880To migrate the Syrian top level domain - one of the few top level domains that
1881support zone transfers - into GNS use the following command:
1882
1883@example
1884$ ascension sy. -n ns1.tld.sy. -p
1885@end example
1886
1887The -p flag will tell GNS to put these records on the DHT so that other users
1888may resolve these records by using the public key of the zone.
1889
1890Once the zone is migrated, Ascension will output a message telling you, that it
1891will refresh the zone after the time has elapsed. You can resolve the names in
1892the zone directly using GNS or if you want to use it with your browser, check
1893out the GNS manual section. @ref{Configuring the GNU Name System}. To resolve
1894the records from another system you need the respective zones PKEY. To get the
1895zones public key, you can run the following command:
1896
1897@example
1898$ gnunet-identity -dqe sy
1899@end example
1900
1901Where "sy" is the name of the zone you want to migrate.
1902
1903You can share the PKEY of the zone with your friends. They can then resolve
1904records in the zone by doing a lookup replacing the zone label with your PKEY:
1905
1906@example
1907$ gnunet-gns -t SOA -u "$PKEY"
1908@end example
1909
1910The program will continue to run as a daemon and update once the refresh time
1911specified in the zones SOA record has elapsed.
1912
1913DNSCurve style records are supported in the latest release and they are added
1914as a PKEY record to be referred to the respective GNS public key. Key
1915distribution is still a problem but provided someone else has a public key
1916under a given label it can be looked up.
1917
1918There is an unofficial Debian package called python3-ascension that adds a
1919system user ascension and runs a GNUnet peer in the background.
1920
1921Ascension-bind is also an unofficial Debian package that on installation checks
1922for running DNS zones and whether or not they are transferable using DNS zone
1923transfer (AXFR). It asks the administrator which zones to migrate into GNS and
1924installs a systemd unit file to keep the zone up to date. If you want to
1925migrate different zones you might want to check the unit file from the package
1926as a guide.
1927
1928@node reclaimID Identity Provider
1929@section reclaimID Identity Provider
1930
1931The re:claimID Identity Provider (IdP) is a decentralized IdP service.
1932It allows its users to manage and authorize third parties to access
1933their identity attributes such as email or shipping addresses.
1934
1935It basically mimics the concepts of centralized IdPs, such as those
1936offered by Google or Facebook.
1937Like other IdPs, reclaimID features an (optional) OpenID Connect
19381.0-compliant protocol layer that can be used for websites to
1939integrate reclaimID as an Identity Provider with little effort.
1940
1941@menu
1942* Managing Attributes::
1943* Managing Credentials::
1944* Sharing Attributes with Third Parties::
1945* Revoking Authorizations of Third Parties::
1946* OpenID Connect::
1947* Providing Third Party Attestation::
1948@end menu
1949
1950@node Managing Attributes
1951@subsection Managing Attributes
1952
1953Before adding attributes to an identity, you must first create an ego:
1954
1955@example
1956$ gnunet-identity --create="user"
1957@end example
1958
1959Henceforth, you can manage a new user profile of the user ``user''.
1960
1961To add an email address to your user profile, simply use the @command{gnunet-reclaim} command line tool::
1962
1963@example
1964$ gnunet-reclaim -e "user" -a "email" -V "username@@example.gnunet"
1965@end example
1966
1967All of your attributes can be listed using the @command{gnunet-reclaim}
1968command line tool as well:
1969
1970@example
1971$ gnunet-reclaim -e "user" -D
1972@end example
1973
1974Currently, and by default, attribute values are interpreted as plain text.
1975In the future there might be more value types such as X.509 certificate credentials.
1976
1977@node Managing Credentials
1978@subsection Managing Credentials
1979
1980Attribute values may reference a claim in a third party attested credential.
1981Such a credential can have a variety of formats such as JSON-Web-Tokens or
1982X.509 certificates.
1983Currently, reclaimID only supports JSON-Web-Token credentials.
1984
1985To add a credential to your user profile, invoke the @command{gnunet-reclaim} command line tool as follows:
1986
1987@example
1988$ gnunet-reclaim -e "user"\
1989 --credential-name="email"\
1990 --credential-type="JWT"\
1991 --value="ey..."
1992@end example
1993
1994All of your credentials can be listed using the @command{gnunet-reclaim}
1995command line tool as well:
1996
1997@example
1998$ gnunet-reclaim -e "user" --credentials
1999@end example
2000
2001In order to add an attribe backed by a credential, specify the attribute
2002value as the claim name in the credential to reference along with the credential
2003ID:
2004
2005@example
2006$ gnunet-reclaim -e "user"\
2007 --add="email"\
2008 --value="verified_email"\
2009 --credential-id="<CREDENTIAL_ID>"
2010@end example
2011
2012
2013@node Sharing Attributes with Third Parties
2014@subsection Sharing Attributes with Third Parties
2015
2016If you want to allow a third party such as a website or friend to access to your attributes (or a subset thereof) execute:
2017
2018@example
2019$ TICKET=$(gnunet-reclaim -e "user"\
2020 -r "$RP_KEY"\
2021 -i "attribute1,attribute2,...")
2022@end example
2023
2024The command will return a "ticket" string.
2025You must give $TICKET to the requesting third party.
2026
2027$RP_KEY is the public key of the third party and "attribute1,attribute2,..." is a comma-separated list of attribute names, such as "email,name,...", that you want to share.
2028
2029The third party may retrieve the key in string format for use in the above
2030call using "gnunet-identity":
2031
2032@example
2033$ RP_KEY=$(gnunet-identity -d | grep "relyingparty" | awk '@{print $3@}')
2034@end example
2035
2036The third party can then retrieve your shared identity attributes using:
2037
2038@example
2039$ gnunet-reclaim -e "relyingparty" -C "ticket"
2040@end example
2041
2042Where "relyingparty" is the name for the identity behind $RP_KEY that the
2043requesting party is using.
2044This will retrieve and list the shared identity attributes.
2045The above command will also work if the user is currently offline since the attributes are retrieved from GNS.
2046Further, $TICKET can be re-used later to retrieve up-to-date attributes in case "friend" has changed the value(s). For instance, because his email address changed.
2047
2048To list all given authorizations (tickets) you can execute:
2049@example
2050$ gnunet-reclaim -e "user" -T
2051@end example
2052
2053@node Revoking Authorizations of Third Parties
2054@subsection Revoking Authorizations of Third Parties
2055
2056If you want to revoke the access of a third party to your attributes you can execute:
2057
2058@example
2059$ gnunet-reclaim -e "user" -R $TICKET
2060@end example
2061
2062This will prevent the third party from accessing the attribute in the future.
2063Please note that if the third party has previously accessed the attribute, there is not way in which the system could have prevented the thiry party from storing the data.
2064As such, only access to updated data in the future can be revoked.
2065This behaviour is _exactly the same_ as with other IdPs.
2066
2067@node OpenID Connect
2068@subsection OpenID Connect
2069
2070There is an @uref{OpenID Connect, https://openid.net/specs/openid-connect-core-1_0.html} API for use with re:claimID.
2071However, its use is quite complicated to setup.
2072
2073@example
2074https://api.reclaim/openid/authorize
2075http://localhost:7776/openid/token
2076http://localhost:7776/openid/userinfo
2077http://localhost:7776/openid/login
2078@end example
2079
2080The token endpoint is protected using HTTP basic authentication.
2081You can authenticate using any username and the password configured under:
2082
2083@example
2084$ gnunet-config -s reclaim-rest-plugin -o OIDC_CLIENT_SECRET
2085@end example
2086
2087The authorize endpoint is protected using a Cookie which can be obtained through
2088a request against the login endpoint.
2089This functionality is meant to be used in the context of the OpenID Connect authorization
2090flow to collect user consent interactively.
2091Without a Cookie, the authorize endpoint redirects to a URI configured under:
2092
2093@example
2094$ gnunet-config -s reclaim-rest-plugin -o ADDRESS
2095@end example
2096
2097The token endpoint is protected using OAuth2 and expects the grant
2098which is retrieved from the authorization endpoint according to the standard.
2099
2100The userinfo endpoint is protected using OAuth2 and expects a bearer access
2101token which is retrieved from a token request.
2102
2103In order to make use of OpenID Connect flows as a user, you need to install
2104the browser plugin:
2105
2106@itemize @bullet
2107@item @uref{https://addons.mozilla.org/addon/reclaimid/, Firefox Add-on}
2108@item @uref{https://chrome.google.com/webstore/detail/reclaimid/jiogompmdejcnacmlnjhnaicgkefcfll, Chrome Web Store}
2109@end itemize
2110
2111In order to create and register an OpenID Connect client as a relying party,
2112you need to execute the following steps:
2113
2114@example
2115$ gnunet-identity -C <client_name>
2116$ gnunet-namestore -z <client_name> -a -n "@@" -t RECLAIM_OIDC_REDIRECT -V <redirect_uri> -e 1d -p
2117$ gnunet-namestore -z <client_name> -a -n "@@" -t RECLAIM_OIDC_CLIENT -V "My OIDC Client" -e 1d -p
2118@end example
2119
2120The "client_id" for use in OpenID Connect is the public key of the client as
2121displayed using:
2122@example
2123$ gnunet-identity -d grep "relyingparty" | awk '@{print $3@}'
2124@end example
2125
2126The RECLAIM_OIDC_REDIRECT record contains your website redirect URI.
2127You may use any globally unique DNS or GNS URI.
2128The RECLAIM_OIDC_CLIENT record represents the client description which whill
2129be displayed to users in an authorization request.
2130
2131Any website or relying party must use the authorization endpoint
2132@uref{https://api.reclaim/openid/authorize} in its authorization redirects, e.g.
2133
2134@example
2135<a href="https://api.reclaim/openid/authorize?client_id=<PKEY>\
2136 &scope=openid email\
2137 &redirect_uri=<redirect_uri>\
2138 &nonce=<random>">Login</a>
2139@end example
2140
2141This will direct the user's browser onto his local reclaimID instance.
2142After giving consent, you will be provided with the OpenID Connect authorization
2143code according to the specifications at your provided redirect URI.
2144
2145The ID Tokens issues by the token endpoints are signed using HS512 with the
2146shared secret configured under:
2147
2148@example
2149$ gnunet-config -s reclaim-rest-plugin -o JWT_SECRET
2150@end example
2151
2152The authorization code flow optionally supports @uref{https://tools.ietf.org/html/rfc7636, Proof Key for Code Exchange}.
2153If PKCE is used, the client does not need to authenticate against the token
2154endpoint.
2155
2156@node Providing Third Party Attestation
2157@subsection Providing Third Party Attestation
2158
2159If you are running an identity provider (IdP) service you may be able to
2160support providing credentials for re:claimID users.
2161IdPs can issue JWT credentials as long as they support OpenID Connect and
2162@uref{https://openid.net/specs/openid-connect-discovery-1_0.html,OpenID Connect Discovery}.
2163
2164In order to allow users to import attributes through the re:claimID user interface,
2165you need to register the following public OAuth2/OIDC client:
2166
2167@itemize @bullet
2168@item client_id: reclaimid
2169@item client_secret: none
2170@item redirect_uri: https://ui.reclaim (The URI of the re:claimID webextension)
2171@item grant_type: authorization_code with PKCE (@uref{https://tools.ietf.org/html/rfc7636, RFC7636})
2172@item scopes: all you want to offer.
2173@item id_token: JWT
2174@end itemize
2175
2176When your users add an attribute with name "email" which supports webfinger
2177discovery they will be prompted with the option to retrieve the OpenID Connect
2178ID Token through the user interface.
2179
2180@node Using the Virtual Public Network
2181@section Using the Virtual Public Network
2182
2183@menu
2184* Setting up an Exit node::
2185* Fedora and the Firewall::
2186* Setting up VPN node for protocol translation and tunneling::
2187@end menu
2188
2189Using the GNUnet Virtual Public Network (VPN) application you can
2190tunnel IP traffic over GNUnet. Moreover, the VPN comes
2191with built-in protocol translation and DNS-ALG support, enabling
2192IPv4-to-IPv6 protocol translation (in both directions).
2193This chapter documents how to use the GNUnet VPN.
2194
2195The first thing to note about the GNUnet VPN is that it is a public
2196network. All participating peers can participate and there is no
2197secret key to control access. So unlike common virtual private
2198networks, the GNUnet VPN is not useful as a means to provide a
2199"private" network abstraction over the Internet. The GNUnet VPN
2200is a virtual network in the sense that it is an overlay over the
2201Internet, using its own routing mechanisms and can also use an
2202internal addressing scheme. The GNUnet VPN is an Internet
2203underlay --- TCP/IP applications run on top of it.
2204
2205The VPN is currently only supported on GNU/Linux systems.
2206Support for operating systems that support TUN (such as FreeBSD)
2207should be easy to add (or might not even require any coding at
2208all --- we just did not test this so far). Support for other
2209operating systems would require re-writing the code to create virtual
2210network interfaces and to intercept DNS requests.
2211
2212The VPN does not provide good anonymity. While requests are routed
2213over the GNUnet network, other peers can directly see the source
2214and destination of each (encapsulated) IP packet. Finally, if you
2215use the VPN to access Internet services, the peer sending the
2216request to the Internet will be able to observe and even alter
2217the IP traffic. We will discuss additional security implications
2218of using the VPN later in this chapter.
2219
2220@node Setting up an Exit node
2221@subsection Setting up an Exit node
2222
2223Any useful operation with the VPN requires the existence of an exit
2224node in the GNUnet Peer-to-Peer network. Exit functionality can only
2225be enabled on peers that have regular Internet access. If you want
2226to play around with the VPN or support the network, we encourage
2227you to setup exit nodes. This chapter documents how to setup an
2228exit node.
2229
2230There are four types of exit functions an exit node can provide,
2231and using the GNUnet VPN to access the Internet will only work
2232nicely if the first three types are provided somewhere in
2233the network. The four exit functions are:
2234
2235@itemize @bullet
2236@item DNS: allow other peers to use your DNS resolver
2237@item IPv4: allow other peers to access your IPv4 Internet connection
2238@item IPv6: allow other peers to access your IPv6 Internet connection
2239@item Local service: allow other peers to access a specific TCP or
2240UDP service your peer is providing
2241@end itemize
2242
2243By enabling "exit" in gnunet-setup and checking the respective boxes
2244in the "exit" tab, you can easily choose which of the above exit
2245functions you want to support.
2246
2247Note, however, that by supporting the first three functions you will
2248allow arbitrary other GNUnet users to access the Internet via your
2249system. This is somewhat similar to running a Tor exit node. The
2250Torproject has a nice article about what to consider if you want
2251to do this here. We believe that generally running a DNS exit node
2252is completely harmless.
2253
2254The exit node configuration does currently not allow you to restrict the
2255Internet traffic that leaves your system. In particular, you cannot
2256exclude SMTP traffic (or block port 25) or limit to HTTP traffic using
2257the GNUnet configuration. However, you can use your host firewall to
2258restrict outbound connections from the virtual tunnel interface. This
2259is highly recommended. In the future, we plan to offer a wider range
2260of configuration options for exit nodes.
2261
2262Note that by running an exit node GNUnet will configure your kernel
2263to perform IP-forwarding (for IPv6) and NAT (for IPv4) so that the
2264traffic from the virtual interface can be routed to the Internet.
2265In order to provide an IPv6-exit, you need to have a subnet routed
2266to your host's external network interface and assign a subrange of
2267that subnet to the GNUnet exit's TUN interface.
2268
2269When running a local service, you should make sure that the local
2270service is (also) bound to the IP address of your EXIT interface
2271(e.g. 169.254.86.1). It will NOT work if your local service is
2272just bound to loopback. You may also want to create a "VPN" record
2273in your zone of the GNU Name System to make it easy for others to
2274access your service via a name instead of just the full service
2275descriptor. Note that the identifier you assign the service can
2276serve as a passphrase or shared secret, clients connecting to the
2277service must somehow learn the service's name. VPN records in the
2278GNU Name System can make this easier.
2279
2280@node Fedora and the Firewall
2281@subsection Fedora and the Firewall
2282
2283
2284When using an exit node on Fedora 15, the standard firewall can
2285create trouble even when not really exiting the local system!
2286For IPv4, the standard rules seem fine. However, for IPv6 the
2287standard rules prohibit traffic from the network range of the
2288virtual interface created by the exit daemon to the local IPv6
2289address of the same interface (which is essentially loopback
2290traffic, so you might suspect that a standard firewall would
2291leave this traffic alone). However, as somehow for IPv6 the
2292traffic is not recognized as originating from the local
2293system (and as the connection is not already "established"),
2294the firewall drops the traffic. You should still get ICMPv6
2295packets back, but that's obviously not very useful.
2296
2297Possible ways to fix this include disabling the firewall (do you
2298have a good reason for having it on?) or disabling the firewall
2299at least for the GNUnet exit interface (or the respective
2300IPv4/IPv6 address range). The best way to diagnose these kinds
2301of problems in general involves setting the firewall to REJECT
2302instead of DROP and to watch the traffic using wireshark
2303(or tcpdump) to see if ICMP messages are generated when running
2304some tests that should work.
2305
2306@node Setting up VPN node for protocol translation and tunneling
2307@subsection Setting up VPN node for protocol translation and tunneling
2308
2309
2310The GNUnet VPN/PT subsystem enables you to tunnel IP traffic over the
2311VPN to an exit node, from where it can then be forwarded to the
2312Internet. This section documents how to setup VPN/PT on a node.
2313Note that you can enable both the VPN and an exit on the same peer.
2314In this case, IP traffic from your system may enter your peer's VPN
2315and leave your peer's exit. This can be useful as a means to do
2316protocol translation. For example, you might have an application that
2317supports only IPv4 but needs to access an IPv6-only site. In this case,
2318GNUnet would perform 4to6 protocol translation between the VPN (IPv4)
2319and the Exit (IPv6). Similarly, 6to4 protocol translation is also
2320possible. However, the primary use for GNUnet would be to access
2321an Internet service running with an IP version that is not supported
2322by your ISP. In this case, your IP traffic would be routed via GNUnet
2323to a peer that has access to the Internet with the desired IP version.
2324
2325Setting up an entry node into the GNUnet VPN primarily requires you
2326to enable the "VPN/PT" option in "gnunet-setup". This will launch the
2327"gnunet-service-vpn", "gnunet-service-dns" and "gnunet-daemon-pt"
2328processes. The "gnunet-service-vpn" will create a virtual interface
2329which will be used as the target for your IP traffic that enters the
2330VPN. Additionally, a second virtual interface will be created by
2331the "gnunet-service-dns" for your DNS traffic. You will then need to
2332specify which traffic you want to tunnel over GNUnet. If your ISP only
2333provides you with IPv4 or IPv6-access, you may choose to tunnel the
2334other IP protocol over the GNUnet VPN. If you do not have an ISP
2335(and are connected to other GNUnet peers via WLAN), you can also
2336choose to tunnel all IP traffic over GNUnet. This might also provide
2337you with some anonymity. After you enable the respective options
2338and restart your peer, your Internet traffic should be tunneled
2339over the GNUnet VPN.
2340
2341The GNUnet VPN uses DNS-ALG to hijack your IP traffic. Whenever an
2342application resolves a hostname (like 'gnunet.org'), the
2343"gnunet-daemon-pt" will instruct the "gnunet-service-dns" to intercept
2344the request (possibly route it over GNUnet as well) and replace the
2345normal answer with an IP in the range of the VPN's interface.
2346"gnunet-daemon-pt" will then tell "gnunet-service-vpn" to forward all
2347traffic it receives on the TUN interface via the VPN to the original
2348destination.
2349
2350For applications that do not use DNS, you can also manually create
2351such a mapping using the gnunet-vpn command-line tool. Here, you
2352specify the desired address family of the result (e.g. "-4"), and the
2353intended target IP on the Internet (e.g. "-i 131.159.74.67") and
2354"gnunet-vpn" will tell you which IP address in the range of your
2355VPN tunnel was mapped.
2356
2357@command{gnunet-vpn} can also be used to access "internal" services
2358offered by GNUnet nodes. So if you happen to know a peer and a
2359service offered by that peer, you can create an IP tunnel to
2360that peer by specifying the peer's identity, service name and
2361protocol (--tcp or --udp) and you will again receive an IP address
2362that will terminate at the respective peer's service.
2363
2364@node Using the GNUnet Messenger
2365@section Using the GNUnet Messenger
2366
2367The GNUnet Messenger subsystem allows decentralized message-based
2368communication inside of so called rooms. Each room can be hosted by
2369a variable amount of peers. Every member of a room has the possibility
2370to host the room on its own peer. A peer allows any amount of members
2371to join a room. The amount of members in a room is not restricted.
2372
2373Messages in a room will be distributed between all peers hosting the
2374room or being internally (in context of the messenger service) connected
2375to a hosting peer. All received or sent messages will be stored on any
2376peer locally which is hosting the respective room or is internally
2377connected to such a hosting peer.
2378
2379The Messenger service is built on the CADET subsystem to make internal
2380connections between peers using a reliable and encrypted transmission.
2381Additionally the service uses a discrete padding to few different sizes.
2382So kinds of messages and potential content can't be identified by the
2383size of traffic from any attacker being unable to break the encryption
2384of the transmission layer.
2385
2386Another feature is additional end-to-end encryption for selected messages
2387which uses the public key of another member (the receiver) to encrypt
2388the message. Therefore it is ensured that only the selected member can
2389read its content. This will also use additional padding.
2390
2391@menu
2392* Current state::
2393* Entering a room::
2394* Opening a room::
2395* Messaging in a room::
2396* Private messaging::
2397@end menu
2398
2399@node Current state
2400@subsection Current state
2401
2402Currently there is only a simplistic CLI application available to use the
2403messenger service. You can use this application with the
2404@command{gnunet-messenger} command.
2405
2406This application was designed for testing purposes and it does not provide
2407full functionality in the current state. It is planned to replace this CLI
2408application in later stages with a fully featured one using a client-side
2409library designed for messenger applications.
2410
2411@node Entering a room
2412@subsection Entering a room
2413
2414You can enter any room by its ROOMKEY and any PEERIDENTITY of a hosting peer.
2415Optionally you can provide any IDENTITY which can represent a local ego by
2416its name.
2417
2418@example
2419$ gnunet-messenger [-e IDENTITY] -d PEERIDENTITY -r ROOMKEY
2420@end example
2421
2422A PEERIDENTITY gets entered in encoded form. You can get your own peer ID by
2423using the @command{gnunet-peerinfo} command:
2424
2425@example
2426$ gnunet-peerinfo -s
2427@end example
2428
2429A ROOMKEY gets entered in readable text form. The service will then hash the
2430entered ROOMKEY and use the result as shared secret for transmission through
2431the CADET submodule. You can also optionally leave out the '-r' parameter and
2432the ROOMKEY to use the zeroed hash instead.
2433
2434If no IDENTITY is provided you will not send any name to others, you will be
2435referred as "anonymous" instead and use the anonymous ego. If you provide any
2436IDENTITY a matching ego will be used to sign your messages. If there is no
2437matching ego you will use the anonymous ego instead. The provided IDENTITY will
2438be distributed as your name for the service in any case.
2439
2440@node Opening a room
2441@subsection Opening a room
2442
2443You can open any room in a similar way to entering it. You just have to leave
2444out the '-d' parameter and the PEERIDENTITY of the hosting peer.
2445
2446@example
2447$ gnunet-messenger [-e IDENTITY] -r ROOMKEY
2448@end example
2449
2450Providing ROOMKEY and IDENTITY is identical to entering a room. Opening a room
2451will also make your peer to a host of this room. So others can enter the room
2452through your peer if they have the required ROOMKEY and your peer ID.
2453
2454If you want to use the zeroed hash as shared secret key for the room you can
2455also leave it out as well:
2456
2457@example
2458$ gnunet-messenger
2459@end example
2460
2461@node Messaging in a room
2462@subsection Messaging in a room
2463
2464Once joined a room by entering it or opening it you can write text-based
2465messages which will be distributed between all internally conntected peers. All
2466sent messages will be displayed in the same way as received messages.
2467
2468This relates to the internal handling of sent and received messages being mostly
2469identical on application layer. Every handled message will be represented
2470visually depending on its kind, content and sender. A sender can usually be
2471identified by the encoded member ID or their name.
2472
2473@example
2474[17X37K] * 'anonymous' says: "hey"
2475@end example
2476
2477@node Private messaging
2478@subsection Private messaging
2479
2480As referred in the introduction the service allows sending private messages with
2481additional end-to-end encryption. These messages will be visually represented
2482by messages of the kind 'PRIVATE' in case they can't be decrypted with your used
2483ego. Members who can't decrypt the message can potentially only identify its
2484sender but they can't identify its receiver.
2485
2486@example
2487[17X37K] ~ message: PRIVATE
2488@end example
2489
2490If they can be decrypted they will appear as their secret message instead
2491but marked visually.
2492
2493@example
2494[17X37K] ** 'anonymous' says: "hey"
2495@end example
2496
2497Currently you can only activate sending such encrypted text messages instead of
2498usual text messages by adding the '-p' parameter:
2499
2500@example
2501$ gnunet-messenger [-e IDENTITY] -d PEERIDENTITY -r ROOMKEY -p
2502@end example
2503
2504Notice that you can only send such encrypted messages to members who use an ego
2505which is not publicly known as the anonymous ego to ensure transparency. If
2506any user could decrypt these messages they would not be private. So as receiver
2507of such messages the IDENTITY is required and it has to match a local ego.
2508