My friends and I love Reddit. It's a great place to find/share information because everyone's already there. That being said, it has some problems that seem to be inherent with the format as they exist on all similar sites: namely astroturfing, vote brigading, and shadow banning. So we got to thinking, what if we changed the format to eliminate those problems we hate? That's what this is.

What it does

It's a decentralized semi-anonymous network set up to disincentive destructive behaviors. My client for the network is designed to work like a forum, but that's not necessarily a restriction imposed by the network. Like many other decentralized sources of information, it comes in the form of a blockchain, though this one is a directed acyclic graph of blocks (DAG) rather than just a linear linked list. Users hold however much of the network they want to keep track of, allowing them to adjust the balance between memory requirements and how much of the past they have easy access to, and the interpretation of the blockchain is what makes the forum visible. Maintaining the blockchain and contributing to it increases the opinion other users have of you, giving your votes a bit more weight in the network.

How I built it

It's entirely done in Java, though C would have worked fine as well, just wouldn't have been feasible to get this much done as a one man team in C. Currently the code is spread across a few classes with the foundations for more classes and relations laid out for future work to be done as well. I custom built the formula for a block with the option for infinitely variable type & length rider data in each block, wrote the methods to generate optimal bitstrings to save all the information in every block to files without eating up all your memory or to send online without chewing up too much bandwidth. I focused primerily on laying the groundwork for expansion rather than pinning down as many bells and whistles I could in the time allotted because honestly, it never had a chance at 100% completion without my teammates being able to come with me. It has the setup to transition from it's current state into something much greater even if it may look lackluster now. Hopefully the focus on making a partially finished marble sculpture is appreciated more than the alternative which would be the makings of a trashcan with tons of glitter in it...

Beyond the code, there's also a whitepaper in the works, though that's gonna take quite a bit longer. That's written in English.

Challenges I ran into

Everything really comes down to the lack of teammates for me. I had two freidns willing to come along with me to fill in the gaps in my knowledge, but unfortunately they didn't get the invite and didn't have the luxury to be able to walk in and work on it. I'll be happy to have them work on the project after the hackathon in a few weeks maybe though and really clean up a lot of the things I left undone. For example, I don't know enough about security to implement it. I know the theory and how to set it up so it can be implemented, but my mate knows way more than me in that regard and is going to do it 100 times better than I ever could, so be on the lookout for his work on Dag Net soon. Another one of my friends makes the best UIs and websites around whereas I'm more on the backend. Having him here to create a visually appealing client would have been huge for the project. Nobody wants to step into a new age of communication by regressing back to bulletin board systems. I really wish I had them here, and if someone from the Boilermake team reads this, please re-implement the team-based signups. We were excited to work together and got a bit bummed out when only one of us go the invite.

Accomplishments that I'm proud of

Honestly, I'm most proud of the idea. The client I made during this hackathon could fail miserably for all any of us care (though to be honest I think it's a pretty solid base myself), and the idea would still live on. It's so refined already and just thinking about it, whittling away any possible imperfection we can find has become just a part of our daily thought, or at least mine. How do we handle X, do we even need to? What happens if a user does Y? Do we need to stop them or will the network do it for us? In terms of just the code though? I think I'm most proud of the methods to convert blocks to and from bitstrings (or long/byte arrays). They look a bit like a hack since I left in a bunch of the powers of 2 magic numbers, but I really think they're well done otherwise. They're robust and, as mentioned before, have gaps left where needed to allow for both expected and unexpected expansions in the future. The first time I got them working and could see it write a block to a file then read it back in flawlessly was just a chef's kiss.

What I learned

I better learned what I'm capable of alone. I severely overestimated the amount of work I'd be able to get done without my 2 teammates. I think this was a case where the team would have been much greater than the sum of its parts, and aiming for a little less than a third of the work was setting the bar unreachable high and led to less motivation to press on sometimes. I mean, I still got to a position that I'm happy with, but it's also not exactly how far I had hoped for at the beginning.

I also learned about encryption and cryptographic hashing. I didn't have time to implement much of it, but it's some really interesting stuff as a CS/Math geek. I'm really looking forward to learning more and putting it into practice once the project advances a bit more.

What's next for Dag Net

Missing functionalities mostly. It needs a GUI still. It needs to better analyze optimal targets for steals (nobody wants to use the suboptimal client). It needs cryptographic security both in hashing and in data encryption/decryption. It needs a more elegant search function to for example fetch every block that has a certain tag in it with little delay. I'd like to implement a bit of machine learning to analyze and predict changes in the network to have a better idea of the coin distribution between users and to target better blocks faster. There's a lot to do, and that was sort of the point of the hack. It's a potentially huge project, and this is just the start. With enough users, the goal is to make it so nobody has a reason to not join the network since it grows in robustness as it gains users.

Built With

Share this project: