Summary

Currency Thing is a cryptocurrency backed by Discord messages, following the same principles of proof-of-work as Bitcoin. The blockchain is stored as a chain of messages on the #blockchain text channel. Each message sent on the server creates a new currency thing that is awarded to the user who mines it first. Users can freely send currency things to any server member and check their balance.

View the Blockchain online!

Creation Process

Creation

Currency Thing was born through my desire to understand cryptocurrencies better in 2021. I wasn’t satisified with analogies, simplified explanations, or vague promises. I wanted to know exactly how it worked and how it was thought up, and what better way to find that out than to make your own crypto?

Both for my sanity’s sake, and for the sake of creating another fun feature unique to my Discord server, I decided to make my cryptocurrency run on Discord. After doing a lot of research on how Bitcoin’s blockchain really works and reading the white paper, I started by writing my own white paper that went like this:

TX Num and Prev TX Hash ensure that nobody can just delete transaction messages, as it would be obviouslt that they’re out of order, and Discord already disallows even admins from editing other people’s messages, so the Blockchain is very secure

*The Mining Process:
The message hash is created by forming an array containg the message content, author’s username, and UNIX timestamp of when the message was sent. Then the Currency Thing bot hashes that array using the BLAKE2 cryptographic hash function. This should ensure that no two messages will ever have the same 256bit hash.

To determine the winner of the currency thing created by the message, Currency Thing then combines the generated Blake hash with a random bytestring key, until the first 6 digits of the combined hash match the first 6 digits of an online server member’s hashed Discord ID. IDs are unique to each user and cannot ever be changed. Six digits was, after plenty of testing, a good compromise between no hash collision and fast mining speed.

Example mining transaction: 0 @Currency Thing 1 @Sam 0 - the first transaction ever!
Example user transaction: 392 @Sam 444 @Max :gregg: - I lost a bet against Max

Every script was made using Python. The discord features were made with discord.py. In memory, the blockchain is stored and manipulated as a Pandas DataFrame. The hashing algorithm is BLAKE2 from Python’s hashlib module. The logo was made in Illustrator, and both it and the name were inspired by this. Every thing was made by me.

Check out the code on Github