SpamSlam: A blockchain solution to less spam

Hackathons are an integral part of a developer’s journey. They help us experiment, grow and meet a beautiful mixture of talented people. We present a recollection of our winning experience at India’s biggest community hackathon, InOut.

SpamSlam: A blockchain solution to less spam

Hackathons are an integral part of a developer’s journey. They help us experiment, grow and meet a beautiful mixture of talented people. We present a recollection of our winning experience at India’s biggest community hackathon, InOut.

It all started on July 16, 2016 when our very own Web and Coding Club received an email from one Tanu Jain, the Creative Director of a hackathon called InOut, being held at NIT Surat. It was the third iteration of this hackathon, InOut 3.0, and the club was requested to forward their cause and ensure active participation from our community in as well as outside IIT Bombay.

We are always on the lookout for good hackathons for our community at WnCC, IITB. We have seen sponsorship offers from various large-scale companies to conduct a hackathon on our campus, for our students. Ideally, such offers are gold, and we can ensure a fantastic hackathon experience for our students without the hassle of travelling to a venue. However, most of those offers have a misplaced motivation. They are more interested in winning top talent and publicity for their organisation than they are interested in the nourishment of culture and development of skill among the broad developer community.

In contrast, we had InOut offering a student-run collegiate hackathon. It was large scale. It had good sponsorship, and above all, they claimed high talent participation from top institutes in the nation. It sounded like a lot of fun and they even offered train fare reimbursements. We wasted no time in advertising this to our community. Team "Ferozepurwale" (comprising of Akash Trehan (co-author of this blog), Nihal Singh and Arpan Banerjee), one of the most active hackathon teams of IIT Bombay, got selected and went to the event. The team made to the final round and bagged fifth place. We remember our complete chatroom nervously waiting for the results after the team’s presentation. The team returned with nothing short of absolute praise for the organisation and the competitive level of the hackathon.

Fast forward to the next year, and we found ourselves in Bengaluru on 7th October 2017 at CoWrks for HackInOut 4.0. We had two teams from WnCC this time, but to our pleasant surprise two members of a third team were also from IIT Bombay. One of them was an alumnus. Far away from our campus, this already smelled of an excellent adventure. Our junior Kumar Ashutosh was the third and final member of our team.

This InOut was conducted at the best workspace we’d ever seen. The venue, CoWrks, was a co-working space as the name suggests. It had a large hall with rows of desks for most of the area. There were couches towards the front where you could relax. The cherry on the cake was the kitchenette that had an unlimited supply of cookies and an espresso machine. The kitchenette was separated from the rest of the hall by a small wall, and there was some seating area on the kitchenette side too. It was incredibly peaceful to be separated from the rest of the hall which was buzzing with discussion. So we made that our adda. The constant smell of coffee added to my joy. There are two pictures of us involved in an intense discussion, both of them at our adda. Don't you want someone to look at you the same way? 😉

work1


Left to right: Kumar Ashutosh, Akash Trehan, Kumar Ayush

work2


Akash Trehan and Kumar Ayush having intense discussions

The hackathon kicked off with talks by various companies that were part of the sponsorship roster for the event. These are not usually very interesting talks. But we decided to sit through, and guess what? We enjoyed them. One of the speakers suggested that we aim to optimise our time spent in brainstorming. A little too less could result in a slouchy end product, and a little too much would leave less time for implementation. Unlike previous hackathons we didn’t arrive on the scene with an idea discussed beforehand which we could bend to fit the event theme. Thus, the new aim for us was to have a pure hackathon experience and brainstorm from scratch using insights we got from the talks.

"The creation of something new is not accomplished by the intellect, but by the play instinct arising from inner necessity. The creative mind plays with the object it loves." - Carl Jung

One of our crucial goals was to try to get our hands on technology, language or domain which we were unfamiliar with or which sounded really cool. Blockchain was the one! Gnosis, a German company, was one of the blockchain track sponsors, so we started reading articles revolving around what they do. Their platform was based on Ethereum, so we read how that works too. For those interested to begin, there is a cornucopia of general education material on decentralisation using blockchain technology and smart contracts on the web. We also compiled a list of possible applications using some of these articles. The brainstorming discussions were interesting, at the least, so we will take you through some of it. People from Gnosis available at the venue gave constructive inputs and helped iterate our idea.

Gnosis is a platform to build prediction market. Naively speaking, you're betting on an outcome. One of the application thus is betting on the completion of government projects. For example, as a citizen, you can bet that your municipality would not repair a bridge. The municipality now has the incentive to bet against you and fix the bridge. There are loopholes such as: How do you force the government to bet? What about the incentive of disrupting government operations that some citizens would now have? This idea went down the drain. There was another of using smart contracts for a voting system. In my knowledge, some startups are working on this right now. This was too straightforward for our taste, so we moved on to other things. We found an article by none other than the co-founder of Ethereum, Vitalik Buterin. There he had listed some ideas for projects which he would be happy to see implemented but does not have time to do it himself. One of these ideas was about using smart contracts to enforce a transaction for sending someone a message. If you pay more, your message reaches with higher urgency. That is an abstract idea which could mean anything in reality. Perhaps the notification is louder, or maybe with low urgency, you do not get a notification at all. We twisted this idea into our own.

We figured that one can use this to control spam. If everyone has to pay a price to send you an email, spammers will be careful. One of the reasons behind their persistent nature is the ease of sending spam. If it is difficult to do so, that is a natural incentive against it. But what about our friends and family who want to send us a message? Well, we can probably create a system where the sender is charged only if they send a spam. All other messages are free. Who decides what is a spam? An oracle. This is precisely where Gnosis prediction platform helped us. It was designed for settling claims on a natural outcome by an unbiased oracle. Here the outcome would be the decision if a message is spam or not. So the way it works is that the sender is betting that what they are sending is not spam. It is an uneven bet. The receiver bets that it is spam. The oracle verifies. If the sender wins the claim, no transaction happens. If the receiver wins the claim, both the oracle and the receiver share the money. Sounds great. But there must be ways you can abuse this. Perhaps you would repeatedly bet that whatever you are receiving is spam, and the oracle would miss something and you would gain some money. Well, everyone would not do this because we do want to receive emails from our friends or work and no one would talk to us if we keep trying to extort money out of them. Moreover, the ideal oracle is an AI which is used anyway for spam filtering. It is and will keep getting better with time. What our system aims to do is not eliminate the need for that AI, but reduce the need for usage by placing a natural incentive against sending spam. But what about advertisements then? Excessive ads are irritating, but they are essential for how the global economy has shaped in the last half-century. Well, advertisers are now incentivised to send targeted ads such that the viewer does not mark it as spam, or even if she does it is worth the price to do so. In our opinion, we are challenging adtech to be smarter and not really putting it down. There may be several more loopholes that you could be imagining right now, and we would be happy that you write back and we have a discussion. We had delightful hours during the brainstorming finding loopholes but only to discover that it would not be a problem. How do we now implement this?

We created a web interface which had two parties, sender and receiver. As we were focussing on a proof of concept, we built a simple spam detector which worked on detecting heavy usage of specific words that are likely to be found in spam. And then comes the crux of our hack, using the Gnosis betting platform to create a "market", then we place the bets from the sender and the receiver. They are not-spam and spam respectively by default. Then we evaluate the market using our spam check. Gnosis allows us to control how the winnings are redeemed after the results are declared. This allowed us to control that the sender gets his money back if they win but nothing extra, whereas if the sender loses, receiver and oracle win the sender's money in addition to getting their money. There is a cost of transaction, some gas burned. This could be a big loophole to decide if this cost is worth paying and should be discussed but for this hackathon, we agreed to get over it otherwise we would lose too much time. That's it. To be clear, we are not projecting a product which reduces spam upfront. Instead, we are endorsing a protocol which if we can somehow enforce would lead to a natural order of the world where spam is targeted, and by definition that means less "spammy".

Now comes the presentation phase. We had to specify if we are aiming for the Blockchain track. If so, we had to make one presentation to ConsenSys and Gnosis judges and another to a broader set of judges in the general prize category. We felt that the time was too less to be able to present our idea in its full glory. Our concepts had not crystallised well with ourselves in the first place. However, we were in constant interaction with Gnosis throughout our project, both in the brainstorming phase as well as during the implementation where we needed their help with their API. This was a huge plus. It was easier to explain. They found the idea very exciting. And since Gnosis is a Berlin-based startup and one of the gentlemen was German, they got a good laugh out of our team name "Freisenberger" too. In contrast, we were out of rapport with the general category judges, and they seemed disinterested in our project. It's good advice to keep judges on your side before the presentation, just saying.

Now comes the prize ceremony. We bagged the Gnosis First Prize, and we went home with Gnosis tokens (GNO) worth $3000. Ching! Honestly, while waiting for the results, we had a jolly discussion on how we put together an idea which we could never have brainstormed if not for this hackathon and the feeling would keep us happy irrespective of if we win anything. And when we did win something, we were just a little richer and happy.

We thank InOut for delicious meals, comfy couches to sleep on and a good supply of Redbull. And let me not forget the games. Good stress busters. We have some pictures of that. We had a jovial interaction with the team after the event.

Moral of the story, we'll be back!

games


Akash Trehan having fun at the GameZone - Also a Bullshit free zone 😝

About the Authors

Akash Trehan, a.k.a. ‘codemaxx’, is the Founder and Manager of the Cybersecurity Club at the Indian Institute of Technology Bombay, taking initiatives to form a community of security enthusiasts and giving talks to spread awareness about the latest research in the area. He is a final year Computer Science undergrad and a visiting researcher at Carnegie Mellon University. When not busy with college work, Akash spends his time participating in Capture the Flag competitions. In his spare time, you will find him studying psychology, learning to play guitar or watching his all time favourite show - Impractical Jokers.

Kumar Ayush, a.k.a. ‘cheekujodhpur’, is the Ex-Manager of the Web n Coding Club at the Indian Institute of Technology Bombay. He is an Engineering Physics graduate and believes that any feat can be achieved by breaking it into simpler tasks. His CSE interests are web development and computer graphics. He presented a poster at ACM SIGGRAPH ‘17. He is also an amateur astronomer and plays the violin.

Originally published at https://hackinout.co/blog on June 8, 2018