Inspiration

In the current political climate, with many media conglomerates being heavily associated with either major political party, the consumption of divided news media has led to people being more polarized than ever. Furthermore, with varying freedom of speech standards around the world, censorship remains a major problem for news media in many countries. By removing barriers to access current global events and removing the divisive nature of current U.S. politics, Newschain can help bring people all over the world together.

What it does

Newschain leverages blockchain technology to offer a peer-to-peer network of decentralized media. Because of the Newschain network's decentralized nature, unlike traditional media outlets, Newschain cannot be censored and region-locked to users. Unlike other blockchain networks in which miners are rewarded with financial compensation, the Newschain network relies only on volunteer systems, removing the incentive to manipulate the Newschain blockchain for power or control. The Newschain network also requires all published articles to be cryptographically signed. This feature allows users to search for articles by specific authors and be sure that the articles they are reading are the original unmodified versions the authors intended. And since Newschain is completely open-source, individual miners may choose to reject certain articles showing bias or displaying clear favoritism. Overtime, this will cause the Newschain blockchain to shift towards an impartial collection of news. Newschain is a media source for the people, maintained by the people.

How we built it

Our project consisted of two systems. The software that the miners run, and a user-friendly frontend for publishing articles. Although publishing to the Newschain network only requires a simple HTTP POST request, we decided to implement a website interface so that users unfamiliar with the technical side of Newschain could still just as easily publish articles.

Our miner software was written in Python using Flask. When the mining software first runs on a computer, it first pings a node to get a list of other peers on the network. This node serves as an initial connection for new miners. After this, the miner begins two concurrent loops: one to receive and re-broadcast any articles that may be sent to it, and one to mine and validate any new blocks. If a miner starts up and recieves an empty list of peers, it knows it is the first miner on the network and so it creates the genesis block. From there as new miners join the network, and ping each other, they will receive the IP addresses of all their fellow miners who joined before them and begin talking to each other. Also, every few minutes, miners will once again ping each other to receive an updated list of peers to ensure that they can connect to peers who join after them.

Newschain implements a static block size of two. This means that every time a miner has received two validly signed articles, it will begin a process of creating a block of those two articles and mine them. Newschain implements a proof-of-work mining system. Once a block has been mined, the miner broadcasts this block to all his peers who then verify it and if verified all accept this new block and continue on. This ensures that every individual miner on the Newschain network has a complete and up-to-date copy of all the articles ever published on the Newschain network making it extremely hard for the entire Newschain network to be blocked or censored.

Our website interface uses Html, Javascript, and Python with Flask and runs on Google Cloud. It allows users to view the current blockchain and interact with all the articles contained on it. Authors can also directly publish articles from our site. Authors who wish to use the same identity when publishing articles can do so by entering their saved public and private keys, and authors who wish to publish under a new identity can generate new unique keys. After writing an article and publishing, the website will broadcast the new article to the Newschain network where it will be saved, verified, and eventually mined. Once the added article is added to a block and successfully mined, users will be able to see it on our site.

Challenges we ran into

Early on one of the challenges we ran into was getting our network to sync up over long periods of time. We noticed that sometimes a miner would mine a couple blocks before desynchronizing with the rest of the network, causing the Newschain blockchain to be inconsistent across miners. Another issue we found was with creating threads on the miners. In order for the miners to run effectively they needed to conecurrently run a loop that handled network requests, and a loop that handled mining blocks, with both loops having to precisely communicate with each other. After much effort, we used a system of flags to coordinate operations between the two threads to address the issue.

Accomplishments that we are proud of

We are proud of our digital signature implementation. When first brainstorming ideas, we felt that a significant weakness of an idea like Newschain was that malicous users could easily publish articles under other users names, but after doing a lot of research (and a lot of math) we implemented a digital signature system in which articles could be validated and only added to the network if they were being published by the author they claimed to be from.

What we learned

While creating Newschain we learned a lot about synchronization across vast networks. For Newschain to function effectively, all miners on the network must be up to date with each other. In addition we learned about cryptography and how we had to implement a digital signature system on each article to prevent malicious users from publishing articles under other users names.

What's next for Newschain

A feature of many successful blockchain based applications is a dynamic proof-of-work difficulty. This means that as the number of miners on the network increases, the difficulty of the proof-of-work also increases so that the amount of time for the entire network to mine a block stays roughly the same. Currently the Newschain network utilizes a static proof-of-work difficulty, so as more and more miners begin to join the network, the average time to mine a block will decrease.

Share this project:

Updates