Applications over Freenet: a Decentralized, Anonymous Gaming API?
Freenet has a type of key that allows for self-verifying signed content. You make a public/private keypair, much as with PGP. You can then insert special keys that include your public key. Unless the accompanying data is properly signed with your private key, it can't be requested. This is useful when you want to ensure that a group of documents are all published by the same author, exactly the case with the gaming API.
So you first need to generate a keypair. You can do this through the Util API (available in Java or via XML-RPC). Invoking
returns a string containing your public and private keys (respectively), separated by a comma.
Now, you need to insert your next move using an SSK. The key to insert is SSK@<<I>pubkey>,<<I>privkey>/<<I>name>, where name is the key previously used to record moves. Since the move is stored under an SSK, no one can insert this key unless they have your private key. Therefore, your opponent can't spoof your moves.
Unfortunately, your opponents can no longer find out what your moves are because they don't know what keys they're under. Quite a pickle indeed! The format for an SSK that you want to request is SSK@<<I>pubkey>/<<I>name>. You only need the private key for insertion. It is, after all, supposed to be a secret. Your opponent can generate the name portion of the key, as we were doing in the previous section on inserting moves. So all you need to communicate is your public key.
Remember how I said we were going to replace the insecure naming system? Well now is the time. Instead of putting your nickname in the request and response files, use your public key. Now your opponent knows who you are in an unspoofable way. Sure, someone else can put your public key in a request, but they can't insert moves using that public key (unless they also have your private key), so they can't actually play as you. That means identities in the gaming system are unspoofable. Every time you play with someone with the same public key, you know they are the same person as before. Unfortunately, referring to your chess partner as "my good buddy p0EFqjmDioSqKmYYORPrClUepi4QAgE" is somehow unsatisfying. A good gaming client should therefore let you attach more meaningful names to your opponents.
Even though you can no longer falsify moves, you can still make illegal moves. If your gaming engine won't let you do that, you can modify it. If my gaming engine won't let you, then so what? You've still made the move. How do we resolve the game? Playing a game is a voluntary activity, so the proper response to invalid moves is to stop playing with that person. This doesn't work out so well when rankings are involved. If I begin every game by declaring I win, as long as there are gullible new players I can be number one. There are other nasty tricks, such as simply refusing to finish a game when you know you're going to lose. All of this should be taken into account if an engine is created to score players. Such a device would look through all of the requests and responses to determine what games were played on a particular day. It would then look through all of the moves for a particular game, check for validity of moves and determine who won, recording invalid moves and unfinished games as black marks on a player. Luckily, once files are put into Freenet, they can't be modified or deleted, even by the person that published them, so after-the-fact modifications of games are not possible (at least they are very hard to do). The scoring engine would then use the gathered data to score, rate, rank and admonish players. It could store its output somewhere in Freenet for players to view. Of course, scoring engines can be biased if their authors are also players. For this reason, choosing which scoring engine to believe is a matter of trust.
If you happen to like using a system that is not real time and does not guarantee the accessibility or permanence of its data to write distributed, anonymous, secure applications, then you'll probably like Freenet. It has built-in features for unspoofable communication. You can write applications for it in 21 different languages. You can play games totally anonymously, without a central server, and it's faster than play-by-mail games.
If, on the other hand, you think that we're a bunch of crazy people with too much time on our hands, then you should wait until IRC over Freenet comes out.
You probably think I'm joking.
Brandon Wiley cofounded the Freenet Project three years ago. Recently, he cofounded the Everything Over Freenet (EOF) project to implement interesting internet protocols over Freenet. He is currently writing plays and developing distributed application infrastructures in Austin, Texas.
Webinar: 8 Signs You’re Beyond Cron
11am CDT, April 29th
Join Linux Journal and Pat Cameron, Director of Automation Technology at HelpSystems, as they discuss the eight primary advantages of moving beyond cron job scheduling. In this webinar, you’ll learn about integrating cron with an enterprise scheduler.Join us!
|Android Candy: Intercoms||Apr 23, 2015|
|"No Reboot" Kernel Patching - And Why You Should Care||Apr 22, 2015|
|Return of the Mac||Apr 20, 2015|
|DevOps: Better Than the Sum of Its Parts||Apr 20, 2015|
|Play for Me, Jarvis||Apr 16, 2015|
|Drupageddon: SQL Injection, Database Abstraction and Hundreds of Thousands of Web Sites||Apr 15, 2015|
- "No Reboot" Kernel Patching - And Why You Should Care
- Android Candy: Intercoms
- DevOps: Better Than the Sum of Its Parts
- Return of the Mac
- Drupageddon: SQL Injection, Database Abstraction and Hundreds of Thousands of Web Sites
- Designing Foils with XFLR5
- Non-Linux FOSS: .NET?
- Play for Me, Jarvis
- diff -u: What's New in Kernel Development