The mother of all hackathons

I just returned from #hack4climate. Even if it was just my third hackathon, I can state with certainty that this one was unlike any other. None of the 100 hackers from 33  countries experienced anything remotely comparable before.

The topic of the event was to develop solutions how blockchain technology can help fighting climate change.

First let me explore how the event differentiated from other hackathons. The hacking session was 24 hours, but the whole event lasted four full days. There were pre-workshops around the world. 100 participants were selected and invited to Bonn. Travel expenses were covered. We stayed on a five star hotel ship. It was adjacent to the UN climate conference. We had balcony suites on the ship. The food was appropriate for a 5 star ship, complete with wine to every dinner. The days before and after the hacking session were filled with interesting talks, a guided city tour, interesting discussions and lots of networking. There were so many interesting people and so much to talk about. At the last day they wanted to make a photo of us on the boat in front of the UN building. Drones were forbidden in the security zone, so the photographer rented a crane to get the perfect shot.

I knew nobody from the event in advance. But I knew that out of the sub topics, I was most interested in “sustainable transportation”. At the team building session, I headed straight to the guy with the most interesting pitch that contained something about cars. Our team was formed son after, and I had a good feeling from the start. Two were from Singapore who already knew each other. Two were from India one living in San Francisco and the other in China. And one was also from Switzerland, but we didn’t know each other before.

When the hack session started at Tuesday noon, we shaped our rough ideas into a project that we could realize in the short amount of time. Then everybody stated what he would like to do. It all seemed to fit together wonderfully. I wanted to implement the smart contract. I didn’t have much experience in that area, and was grateful that the others could help me and answer my questions. Rather than drawing large diagrams, we collaborated on the interfaces, and then worked towards these. We didn’t hit mayor roadblocks or problems, everything seemed to flow in place. Most of us agreed that we are not productive after 2AM and that is is better to get some hours of sleep. In the morning we went out to shoot a video of our product in action.  The guys from SBB (who was a sponsor of the event) were around us most of the time. They helped where they could, and were generally very interested and engaged. We had many great discussions with them.

Our project was about end to end transportation. On the mobile app, you select a destination, and it identifies legs to use different means of transportation. We focused on car sharing, but other options include trains, bikes or buses. Our smart contract abstracts a car that can be rented over the ethereum blockchain. The owner of the car registers it by creating an instance of the smart contract. A person who wants to rent it can do so by sending ether. The required amount is determined by the price per km the owner wants, times the number of km the renter wants. If he doesn’t use up the credit, the rest is reimbursed at the end of the trip. But if he drives too far, the cars performance is degraded by the smart contract. The car was represented by a RaspberryPi running an ethereum node and our backend running on nodejs. Initially opening the car was indicated by an LED attached to the RPI. But to make it more realistic, the RPI then called the Tesla API to open a real car. At the end of the trip the RPI collected information about the car such as odometer and battery level as well as firmware version, stored it on the IPFS and registered the IPFS address with the smart contract to form an unfalsifiable audit trail. Last but not least, one of our team members used data from moving cars and turned it into an appealing 3D animation that highlights the hot spots in a city.

We were thrilled all along, even more after all the positive reactions to our presentation. And hooray, we made it into the finalists! That meant, we could present our project at the COP. That’s the fair for NGO’s which is attached to the UN climate conference. The team that won the hackathon, did so deservedly. Their project was about incentivizing land owners not to cut their trees. They used blockchain and game theory for the monetary part. In addition they trained a neuronal network to predict areas which are endangered most of deforestation, and need special attention.

A first official video appeared here, and I’m sure others will follow on the official website.

Hackthevalley Hackathon 2017 Baar

Motivation

After the good experience last year at the six fintech hackathon, I was trilled to go to hack the valley which is even closer geographically and whose subject is even closer to Bitcoin. My goal was to gain experience with ethereum. So far I only completed the tutorials. I found the technology very interesting, but in the past, I couldn’t come up with a good idea how to make use of it. Neither did I learn of a killer product that went live. This is in stark contrast to Bitcoin. When I first learned about Bitcoin, it was immediately clear to me that this was something very special, something that I waited for without knowing.

Team formation

In contrast to the hackathon last year, most people already showed up as teams. I estimate that only about three of the fourteen teams were formed on site. I joined three guys from a bank in Paris, along with another French guy and a South African who lives in Zurich. First we had to decide on a project. We went through a list with a couple of ideas. But it turned out that for a lot of them it was hard to justify what benefit a blockchain would bring compared to a more traditional approach. That is something I see a lot in the current blockchain hype. Showing up as a team with a formulated idea is a big advantage, as the technology and possible problem areas can be explored before. But In both occasions I enjoyed it to meet new and interesting people and see what we can achieve together in this limited time.

Our project

We settled on the challenge “fighting fraud in the supply chain” with a project that puts smart locks on containers. The devices log all open and close operation on a blockchain. Unlocking operations would have to be authorized by a smart contract. The locks communicate with bluetooth low energy with an app on a smart phone. This in turn communicates to a backend that talks to the blockchain.

Implementation

Shortly after we had the rough concept, the other team members stated that they would feel more confident implementing the smart contract in java, rather than solidity. That’s why they voted for using hyperledger instead of ethereum. Setting it all up and getting the docker containers to work proved a lot more difficult than anybody anticipated. Not only had some team members Windows machines, but also on linux we faced a problem. Namely the docker containers were configured to use the google nameservers, while apparently all outside DNS was blocked by the Thomson Reuters network. The connectivity was generally very flaky.

Infrastructure

I enjoyed working with the team. But that we didn’t know the infrastructure we were working on, complicated our work considerably. The last time I programmed seriously with Java was probably 15 years ago. And we didn’t have good tool support within the environment. I’m sure it is possible to set everything up to work comfortably, but that would have cost us more time even than we lost with the complicated turnaround cycles. In the end, we couldn’t complete our prototype in time. Sure, that is is not a strict requirement of a hackathon. But it’s the pride and goal of every software developer to have the thing perform in a live demo.

Presentations and prize giving

As is common for events like this, the quality of the projects varies wildly. I think nobody in our team expected to be in the top ranks. Even though I must say the presentation looked better than my code.
The project that I liked the most was about subleasing parking spots while people don’t need them. I could imagine something like this generalized to become a decentralized form of AirBnB.
The winners were the same people that won the London HackEthon. During the presentation I thought it rather boring. It was about heart rate sensors publishing directly to ethereum. A smart contract would then take action if the data was out of order. Only after they received the price, I thought some more about it. In hindsight I can see the value in it, and that it was probably implemented better then most other projects.

Conclusion

Thanks to Thomson Reuters and all others involved for organizing this great event!
I hear a lot from Bitcoin maximalists that all other chains can’t compete with the one true blockchain. I’m also invested most in Bitcoin, but I want to be open to the possibilities of other blockchains and smart contract platforms in special. Although I must admit, I never saw a compelling reason for permissioned ledgers and private blockchains. A week before the event I learned about Bitcoin uncensored, and listened to a couple of the episodes. They essentially debunk most of the altcoins and blockchain projects. Calling them ponzi schemes and frauds. This made me skeptical of the blockchain boom, but all the more I was keen to discover good uses at and event full of blockchain hackers. I’m still positive that there are applications that can be improved with blockchains. But most of the ideas have to be descarded upon closer inspection. The only three practical uses for blockchain so far are monetary, timestamping and naming. I am looking forward to expand this list, but it’s not as easy as it seems at first.

SIX fintech hackathon

I learned of hackathons before. It sounded interesting, but either they were too far away, the topic was not interesting enough, or the date was already booked. This time was different. The topic is really what made it interesting enough. FinTech is about new technology in finance. I’m sure there was innovation in the financial industry in the last 50 years, but it was not very visible, and not as fast as in other industries. Recently I read about an employee in a bank that was asked upon his retirement, what was the biggest change in the last 40 years in his job. His answer was : “air conditioning”.

With the advent of BitCoin, the financial sector started feeling some pressure to innovate. I don’t really know how the term FinTech was born, but this all might have contributed. So one thing was clear for me about the hackathon from the beginning: The project had to be about BitCoin.

SIX is probably one of (if not the) biggest service providers in Swiss finance. They run the Swiss stock exchange, most card terminals in brick and mortar shops and PayNet where people can receive electronic invoices in their online banking. These are only the most visible products. They organized the hackathon for the first time a year ago. This time it was in two locations: Zürich and London. Watching last years videos I realized that the event would be organized much better than I expected. And the actual event was even better than the videos promised.

So I went to the Schiffbau which is a former ship building factory turned into theater. Everything was prepared, and we were welcomed with a dinner. The opening ceremony included a very entertaining speech from an editor of the Wired magazine. Next were presentations for the four workshops. I watched “Blockchain, Smart Contracts and Beyond” and “Cognitive Computing in Fintech”. Both were interesting, but not exactly what I expected.
Some teams were already formed, the others went to the match making session. Everybody who had an idea for a project could present it in a few sentences. Then the teams were formed. The Idea I presented to implement a bridge between PayNet and BitPay didn’t spark a lot of interest, so I helped implementing another endeavor.

Our team set out to implement a bridge between PayMit and BitCoin, thus we named it BitMit. I knew the name was familiar, but it took me a while to remember that BitMit was also the long defunct Marketplace that worked like eBay, but with BitCoin. The responsibilities were quickly found: Iwan would implement the IOS app, Mark would implement the management dashboard, Roger was responsible for the Presentation of our project and I implemented the backend.

IOS App
We received an API for PayMit that came with an example app. The app had buttons for buying certain products. So Iwan replaced the buttons for different denominations of popular crypto currencies. When a button was clicked, the app would first execute the payment using the PayMit API and then communicate with our BitMit backend. Finally it displays a receipt including the BitCoin transaction ID. Apparently working with Apple’s XCode is a very special experience that is far from intuitive.

Back-end
The back-end was responsible for providing a simple API for the IOS app, interacting with the BitCoin blockchain and managing a BitCoin hot wallet. We chose python and flask to do the task. Most members in our team were familiar with python and flask. I only implemented a very small project with flask a few years ago, but that knowledge was almost enough for the task at hand. I wanted to make use of electrum servers to have it lite weight. But Friday and Satturday we wanted to use the BitCoin testnet, and unfortunately there are no electrum servers for testnet. So I went with BitCoinCore.
At first we were not so sure where the backend would run. My notebook would be good enough for the time being. But then the guy from IBM offered to have it running on their cloud. He helped me setting everything up. When connecting with ssh to the ubuntu machine, I didn’t even realize that it ran inside a docker container. And the beast was fast! With the 48 cores and a fast internet connection, the BitCoin blockchain was synchronized in less than six hours.

Management Console
Compliance and auditing is very important for Banks. Thus our Service has to have a means of keeping track what is going on. Mark implemented the front-end using React. I certainly heard this buzzword before, but never saw actual code. It’s quite cool how simple the code looks when the task fits the framework.

Pitch
The presentation or pitch was allowed two minutes max. And a gong would terminate it abruptly on stage. The first iterations were roughly twice that long. It was hard to cut it down to the right duration. Too valuable all the information we wanted to communicate. Roger had a very good opening, which I don’t even know if it was still part of the final pitch.
Before entering the final, we gave the pitch a couple of times. Most important was the presentation to the jury. After the pitch the judges could ask us questions. One guy obviously had no clue about how BitCoin works. When this guy was later presented as member of the board and announced the winners, I felt our chances dramatically dwindling.
I took a video of the pitch Roger and Iwan gave for the final on the main stage. It is streaming from the ipfs.

Our project might be not the most novel idea, but it fills a need. Other projects that were presented sound very funny at first but after thinking it through you don’t think anybody would use it. Still others had only fancy slides but nothing functional to show. But there were also projects that made a really good impression. That is probably the expected outcome from a hackathlon.
For me it was a fun and entertaining experience. I will surely participate in other hackathlons. A big thanks to SIX for organizing the event and for all the good food and drinks we enjoyed.

An interesting fact that I observed was the computers used by the participants. About 90% of them were from apple. Most of the remaining computers ran some kind of flavor of linux. And I saw a single one running Windows.