Many of the projects in the Ethereum space are very much financial in nature. I think it's partly because Bitcoin, the first working public implementation of the blockchain, was financial in nature. The financial element is very important to blockchain, but Ethereum expanded greatly on the palette of possible interactions. You can easily make things now that are non-financial but that still benefit from a shared public computational infrastructure. This project is more of an exploration of what is possible with the technology rather than a focused solution to a specific problem. I consider the project to be somewhat of an art piece.

What it does

The core of the project is a "radically public" photo camera connected to Ethereum. The camera is a standalone "IoT" object that a user can approach, log into, and take a photo with. The camera will save the photo to IPFS and submit its hash to a public timeline of all photos taken on this camera.

In this way, it is similar to an arcade machine. You put in a quarter to play, and then gain a high score that lives on the machine. But unlike an arcade machine, the photos will be stored in the decentralized web for the rest of time.

The device can be passed from person to person and organically travel around the world with no owner, because each user funds only the transactions needed to post their own photos. I don't believe there exists a rogue internet connected camera such as this, which requires zero infrastructural upkeep.

How I built it

The base of the device is a Raspberry Pi Zero W, with a camera module attachment. It runs a geth lite client and an ipfs node. The main app running on it is a nodejs app that uses johnny-five to interact with the header pins on the Raspberry Pi. This controls things like the LCD screen and LED and listens for button presses on the "shutter" button to take photos.

Everything is just prototyped using header pins and jumper cables, so no soldering required.

The node app on the device uses web3.js to interact with a deployed Solidity contract. This contract really has three primary functions. login(), postPic(), and logout(). It mediates the user interaction and it allows the camera to receive funds from the user logging in. It uses these funds to pay for gas. This means the camera is aware of who is using it and can tag the owner in the photo. It also means when the user logs out any unused funds can be returned to them.

Another interesting feature is the ability for the camera to be funded by anyone, making it essentially free to use. So anyone can "top it up" with the funds needed to submit the photo hashes to the chain.

Challenges I ran into

Most of the time was sunk into two main problems

  1. Trying to figure out how to get a device with no funds on it to pay for transactions. I explored proxy contracts and meta transactions but the roles are reversed here from all the meta transaction explanations out there. In this case, the user already has money, and they want to fund the transactions of the camera, which doesn't.

  2. Generally working with, connecting to, and running constantly changing versions of software on the Raspberry Pi. First I couldn't connect it to the Harvard wifi because of idiosyncrasies about how they did authentication. Then syncing was eating a lot of my phone data and I corrupted a microSD card. Writing software locally and then running it on the Pi is a very tedious and slow process. So I had to find clever ways of making that faster. Essentially turning the day into a devops adventure.

Accomplishments that I'm proud of

I think this concept of "logging into" an IoT device and funding the transactions you are going to do with it is really interesting. It means the devices can have private keys on them but no money to steal. And the only time there is money to steal, the person who put it there is holding the thing.

I am very much a hardware noob so to get all the pieces (almost) stitched together feels really good. Ethereum/IPFS in cheap hardware devices has some really interesting possibilities. Raspberry Pis are $5 and geth is free.

What I learned

Learned a lot about meta transactions and a lot about setting up a nice dev feedback loop on the Pi. I basically created a deploy pipeline where you git push to a bare repository on the Pi and it uses a git hook to rebuild the project and restart the app. This means I can go from git push to new code running on the Pi in just a couple seconds. That's pretty cool, especially considering how useful that would be in deploying to a fleet of dozens or hundreds of devices.

What's next for EtherCam

Firstly, I'd like to actually finish the project. Then user test it a bit and iterate the interface and then send it out into the wild and let people play with it. It should be interesting to see what kinds of wacky photos end up on the public record.

Secondly, I think there's something worth exploring in the idea of ownerless autonomous connected objects.

Built With

Share this project: