dabdabcoin v2 will come with many exciting new features. The most important one is the ability to send dabdabcoins to other people.

If you don’t know what dabdabcoin v2 is, please read this post.

# How sending will work

Sending dabdabcoins will work by inserting a message into the “comment” section when mining a dabdabcoin. For example, if I wanted to send 32 dabdabcoin to Bob, I could mine a dabdabcoin and put something like **Bob 32** in the “comment” section.

# Digital signatures

The issue with the above scheme is that Bob could pretend to be me and send all of my dabdabcoins to himself. We need to use a digital signature to verify that it was actually me who wrote **Bob 32**.

Digital signatures work using public key cryptography. Public key crytography is a system which generates two keys: a **public key** (known to the public) and a **private key** (only known to the owner of the key). The two keys are related to each other, but it is very difficult to find the private key when you only know the public key.

To create a digital signature, the owner of the private key uses their private key to sign a message. Other people can verify that the message was actually written by the owner by checking the signature using the public key.

# Kid RSA

RSA was one of the first public key cryptography algorithms and is still widely used today. Since RSA is too complicated for our tiny brains to understand, we will be using Kid RSA to create digital signatures in dabdabcoin v2. The ** only issue** with Kid RSA is that it is possible to efficiently derive a private key from a public key (making the private key not private anymore). :(

Kid RSA generates public (made up of two numbers *e* and *n*) and private (*d*) keys in the following way:

Choose 4 positive integers *w*, *x*, *y*, and *z*.

Let *M* = *w*⋅*x* - 1

*e* = *y*⋅*M* + *w*

*n* = (*e*⋅*d* - 1)/M = *y*⋅*z*⋅*M* + *w*⋅*z* + *x*⋅*y* + 1

*d* = *z*⋅*M* + *x*

An important property of these numbers is that **(e⋅d) mod n = 1**.

Create a message. Transform the message into a number *m* (*m* < *n*). To sign *m*:

**Signature** = (*d*⋅*m*) mod *n*

To verify signature using public key:

*m* should equal **Signature**⋅*e* mod *n*