# darkID: A proof of concept of an anonymous decentralized identification system based on blockchain
Blockchain based anonymous decentralized ID system
( Full slides in: https://github.com/arnaucode/darkID/blob/master/darkID-presentation.pdf )
## 1.- Main concept
The main idea behind darkID is to implement a proof of concept of a decentralized system that allows platforms to identify verified users, but ensuring their anonymity.
The main point, is to ensure anonymity, but at the same time, allow users to verify their identity, to ensure that no fake accounts are being used.
## 2.- How it works
- Verify the non anonymous ID of an user
- Based on the: username, email, phone, ID card, etc
- From a logged and verified user, generate an anonymous darkID (Public Key, and save the Private Key into the storage), and get that darkID signed by an authority (serverIDsigner), with high reputation, and without knowing what is signing, to ensure the anonymity of the user
- Once the darkID (Public Key) is signed by an authority server, add the darkID to the blockchain (ethereum, or some other)
- Use the darkID to authenticate in platforms (just need to point the darkID reference in the blockchain), and the platform will send a challenge to the user, to resolve it with the Private Key assigned to the darkID from the darkID desktop app.
```go
type DarkID struct {
ID string `json:"id"`
PrivK string `json:"privK"` //path of the PrivK file
The objective is to guarantee a decentralized login system, but making sure that registered users are real ones and there are no bots generating large amounts of accounts. Only the verified (by email or phone) users can generate an anonymous ID (the Public-Key blind signed).
- The server where the user creates a non anonymous account
- Also is the server that blind signs the anonymous ID of the users
- This server must be a recognized authority, or based on some reputation system. As only the reliable serverIDsigner will be used by the users to trust their ID validation
- The serverIDsigner, can be different servers, based on a public reputation, where the users trust the servers that their are using to verify their darkIDs.
- Once all the nodes of the network are running, a new user can connect to the serverIDsigner.
- The user registers a non anonymous user (using email, phone, password, etc), and performs the login with that user
- The user, locally, generates a RSA key pair (private key & public key)
- The user blinds his Public-Key with the serverIDsigner Public-Key
- The user's Public-Key blinded, is sent to the serverIDsigner
- The serverIDsigner Blind Signs the Public-Key blinded from the user, and returns it to the user
- The user unblinds the Public-Key signed by the serverIDsigner, and now has the Public-Key Blind Signed by the serverIDsigner
- The user sends the Public-Key blind signed to the p2p network
- The peers verify that the Public-Key Blind Signed is correctly signed by the serverIDsigner, if it is, they add the Public-Key to the Ethereum Blockchain, inside a new block
#### Step by step process
1. Once all the nodes of the network are running, a new user can connect to the server-ID-signer.
2. The user registers a non anonymous user (using email, phone, password, etc), and performs the login with that user
3. The user, locally, generates a RSA key pair (private key & public key)
4. The user blinds his Public-Key with the server-ID-signer Public-Key
5. The user's Public-Key blinded, is sent to the server-ID-signer
6. The server-ID-signer Blind Signs the Public-Key blinded from the user, and returns it to the user
7. The user unblinds the Public-Key signed by the server-ID-signer, and now has the Public-Key Blind Signed by the server-ID-signer
8. The user sends the Public-Key blind signed to the p2p network
9. The peers verify that the Public-Key Blind Signed is correctly signed by the server-ID-signer, if it is, they add the Public-Key to the Ethereum Blockchain, inside a new block
10. Then, when the user wants to login into a platform, just needs to put his Public-Key
11. The platform goes to the Ethereum Blockchain, to check if this Public-Key is registered in the blockchain
12. The platform sends a message encrypted with the user Public-Key, and the user returns the message decrypted with the Private-Key, to verify that is the owner of that Public-Key
- Then, when the user wants to login into a platform, just needs to put his Public-Key
- The platform goes to the Ethereum Blockchain, to check if this Public-Key is registered in the blockchain
- The platform sends a message encrypted with the user Public-Key, and the user returns the message decrypted with the Private-Key, to verify that is the owner of that Public-Key
- This works because RSA keys satisfy this equation
- This works because RSA keys satisfy this equation
![rsa](https://wikimedia.org/api/rest_v1/media/math/render/svg/d6bd21fb4e25c311df07b50c313a248d978c3212 "rsa") and this ![rsa](https://wikimedia.org/api/rest_v1/media/math/render/svg/c13170a26e031125b417f22644fb64384c04eea7 "rsa")
![rsa](https://wikimedia.org/api/rest_v1/media/math/render/svg/d6bd21fb4e25c311df07b50c313a248d978c3212 "rsa") and this ![rsa](https://wikimedia.org/api/rest_v1/media/math/render/svg/c13170a26e031125b417f22644fb64384c04eea7 "rsa")
## 4.- Conclusions
- This is just a proof of concept, as an extra [project in a university small subject](https://github.com/arnaucode/darkID/blob/master/darkID-presentation.pdf). Is not a full finalized project.
- Cryptographic [blind signature](https://en.wikipedia.org/wiki/Blind_signature) is very powerful, and also, can be combined with [homomorphic encryption](https://en.wikipedia.org/wiki/Homomorphic_encryption) properties, to make secure and anonymous systems.
- In this proof of concept, the smart contract integration is not finished, and is using ethereum Smart Contracts, but can be implemented using any other blockchain technology. At the beginning [I tried to implement a complete p2p network and a blockchain from scratch](https://github.com/arnaucode/blockchainIDsystem) (but was not a good idea having a short amount of time).
- A decentralized anonymized login system over blockchain, can have lots of applications for example, can be useful to authentication for centralized and decentralized platforms, for voting systems, for health systems, for exchanges, for anonymous reputation systems, etc.
<mxfileuserAgent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36"version="8.0.7"editor="www.draw.io"type="device"><diagramid="20af8cba-fa96-8042-f75d-2a1a5a74df2c"name="Page-1">7Vlbk6I8EP01PM4UNy/zqI6zu7XXGver73EqQgspA6FCXHV//XaAKBjH0R10X6BKhE7ohD6nD6GxvEmy+SBIFn/lITDLtcON5T1aruv4bh//lGVbWgZ9uzREgoZVp71hRn9DZdTdVjSEvNFRcs4kzZrGgKcpBLJhI0LwdbPbgrPmqBmJwDDMAsJM6/80lHFpHfbsvf0j0CjWIzt21TInwTISfJVW41mutyi2sjkh2lfVP49JyNc1kze1vIngXJZHyWYCTMVWh6287umV1t28BaTynAs8t7ziF2Er0FMuJia3OhiQhiMVUzxLeYrGcSwThmcOHjIyBzbe3fWEMy6Ky7ynYsMuC57Kmt0uNmWnjNXsIYHhIkB7LgVfQq2lHwxhvsCWcmoQGuDtb9fZBRHJCTwBKbbYZb1HUYMY1wDUNgGMSPqr6Z5UZIp27nYj/OAUB3btivjusOL9Vrv1mi5yvhIBVFfVYXnDkeMfOJJERCANR3hQu+29qUD9FQZ4HQPaY8CgJQIMboe/3+HfHv7+Q0sEOHR0TQb0DAaschAGC2hSPDUvxL666pEmEU6E0TnuA0azFyKkOuRJtpIgcjz+QjLJsxfHHW7wd5+l0QnuVHMGIWFzKRe0yvrNGGsprFFleIQq2naMFQ0YTsW8b8QcQ453c/fp8S6nUfov4j8rZvDyjP5uB4Lfa4Lg3hCEgQEC4xFNT+lfwEie06CTwLMXQU6vLQkcXE8Chxc9BDsSXPocdIZ/uxI+dPRwPRI8GCSIAIWYSHwVde3n2Qj3S9gWcaamPqMGyiYlmvhVS6c62JWJMFR8xSsED4XfGytFpfg6OqoaEhqGapjxOqYSZhkJ1JhrfPlGW0E3UDdhv4+GbTxSD+ByHVPO/SO0c1uQc+23ht+c0TRU4GWr+ecOsHMA698QMOc4YBiaVxDrNPiSB/EBtF5b7yKedzUN9s161E+VpW+nroCc/ibzooPCM1OzKebXG1u9x4uS9hopWZUqqxlauwSq08U/nat39n2/b/vNfH0fVXQXvljk8G7wzFJSkc8KOoyw0mEZA+7fyPJOl5UGvJJzt9BlsyRUx7GT51bk2VDVv31PMnT+eu9J/pFSUbpbZJXJfZoiXW6bgPn2DXPbLDyRsIZeSCRR3VPJa3LNg2UQk64y0m5lxD9cR52b8Yd+rpjwZokMkBQCVomlPvJ6joIqBbnmYmmwI49JVtYey8qlztgvihU/eE4l5Spz51xKnpxHl8Osl1ylN8mz8jvwgm5Ulpdlz5G22rVCaCyl+oo8UmFxn9br9b2+o3suVI206KjqoYxHXP1Pf36cPk//+3r3afL92wtOMljeoDjtNdd5tiERjl4i1Km6M14gEni6/+JckmT/Wd+b/gE=</diagram></mxfile>
<mxfileuserAgent="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36"version="8.0.7"editor="www.draw.io"type="device"><diagramid="20af8cba-fa96-8042-f75d-2a1a5a74df2c"name="Page-1">7Vrfc+I2EP5rmLYPzfgX4DwGQnqZ3rU3l+v0MSNk2dYgWx5ZBOhf35UtGdsinEMgcw8wA4iVtLL2+1a72mTkz7PtHwIV6RceETbynGg78u9HnucG3gS+lGRXS6YTpxYkgkZ60F7wRP8jWmiGrWlEys5AyTmTtOgKMc9zgmVHhoTgm+6wmLPuqgVKiCV4wojZ0n9pJNNaGo6dvfwToUlqVnYd3bNEeJU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