NCash source code

I started writing the code "bottom-up". First goals were a cryptography toolkit, which I wrote together with Henrik Grubbström at Infovav, encrypted network connections, including the key exchange protocol described in the documentation snapshot, and classes for handling the groups involved in the cash system.

Next, I started writing the necessary servers and clients, and corresponding bookkeeping code. Currently, I have servers and clients for creating new accounts and for withdrawing coins from them.

There's a source snapshot as of December 1997 that you might want to take a look at. The files include:

connection.pmod
Basic server and client code.
brands.pike
A group suitable for Stefan Brands' cash system.
schnorr.pike
The Schnorr signature scheme.
open_account.pmod
The protocol and classes involved when opening a new account.
withdraw.pmod
The protocol and classes involved when withdrawing coins.
ncashd.pike
The main server
open_client.pike
Client for opening a new account.
withdraw_coins.pmod
Client program for withdrawing coins.

Requirements

To actually try this code out is non-trivial at the moment. You will need
Pike
The Pike interpreter. The code was written for Pike-0.5 (which is pretty ancient when I'm updating this page in 2004).
The GMP Library
The GNU Multiprecision Arithmetic Library is needed for efficient calculations involving large integers. Get version 2.0 or later.
Sockets
Networking is done via the Pike interface to sockets. If you don't have sockets, get an Operating System.
Random numbers
I rely on the operating system to provide a good random number generator, like the /dev/random available on modern Linuxes. For some considerations on how to get randomness on a mostly deterministic computer, read RFC 1750.

Last modified: August 2004
Niels Möller <nisse@lysator.liu.se>