Research on how to distinguish between images generated by AI is continuing. I also saw a news story about a company that provides AI image generation services will add digital watermarks to the images it generates. However, there seems to be no single breakthrough way to solve this social issue at present. If so, there should be a combination of various solutions. Therefore, the blockchain camera also be one of the solutions. However, the blockchain camera still have many challenges. So I open source it. Proving that a photo was taken with a camera seems simple but difficult. So everyone will enjoy solving it. It would be even better if it could be solved without using blockchain.
This project used blockchain to solve social issues. It does not endorse investment in cryptocurrencies. The build instructions do not explain how to use crypto wallets or how to buy cryptocurrencies. People who make the blockchain camera should at least be familiar with handling them. This is something that conventional wisdom does not apply to. For example, to use the blockchain camera, you first need to transfer a small amount of cryptocurrency to its crypto wallet. If you send cryptocurrency from a crypto wallet that contains your deposits, its deposit and transaction history will be known. Also, if you transfer your cryptocurrency incorrectly and lose it, no one can help you. Therefore, the blockchain camera are not yet something that everyone can easily use. The ideal is for anyone to be able to use it without thinking about blockchain or cryptocurrencies.
Process of minting a NFT
- Pressing the shutter button sends a signal to the GPIO.
- A photo is taken with the camera module.
- A metadata is created from the image file. Meta data includes a image file name and attributes.
- The image file and metadata are stored in IPFS via Wi-Fi. IPFS is one of the distributed file systems.
- IPFS generates a content identifier (CID) from stored data.
- The CID is sent from IPFS to the blockchain camera.
- The crypto wallet is displayed on the touch screen, so touch "Confirm".
- The CID is sent from the blockchain camera to the DApp (Decentralized Application) on the blockchain.
- The DApp mints a NFT that has the CID as data.
A non-fungible token (NFT) is a unique digital identifier that is recorded on a blockchain, and is used to certify ownership and authenticity. The fact that the NFT was minted from the blockchain camera's crypto wallet is recorded on the blockchain with a timestamp. That NFT is linked to data stored in IPFS via CID. The blockchain camera use these as proof that the photo was taken with the camera.
The reason why image files are not stored directly on blockchain is that blockchain is not suitable for storing large-sized data. However, data stored in a distributed file system is difficult to tamper with, similar to blockchain.
How to view NFTS
Note: Blockchain Explorer sometimes stops.
Owner Address is crypto wallet address of my blockchain camera. Even if I change the owner by sending this NFT to another address, the record of the original owner's address will not be erased.
How to photograph a NFT
- Press the shutter button.
- Touch Confirm on the crypto wallet displayed on the touch screen.
There are many unresolved challenges. Here are some of the big challenges as examples.
- You can copy your blockchain camera's crypto wallet to the PC and mint fake photo NFTs from the PC. Is it a solution to develop a crypto wallet that cannot be copied? You can also do the same thing by remotely accessing the blockchain camera Raspberry Pi without having to copy your wallet to your PC. Is there any hardware that cannot be hacked?
- Anyone can confirm on the blockchain that the NFT owner address and blockchain camera crypto wallet address match. However, the only way to know if the blockchain camera really has the crypto wallet for that address is to display the crypto wallet on the touch screen and show it to someone. Is there no other way but to sell blockchain cameras while managing the link between hardware and crypto wallet addresses?
- What would happen if you projected a fake image onto a screen with a projector and photographed it with a blockchain camera? This is a fundamental challenge that is not limited to the blockchain camera. Is it possible to add 3D scan data to image data?
I next would like to make a blockchain camera that does not store images in distributed file system. This is because it is difficult to use a camera where all the photos taken are made public. Also, using only blockchain without using a distributed file system improves security and durability. I would also like to create a blockchain video camera because fake videos should have a greater impact on society than fake images. I plan to achieve them by using hashes.
I will store the hash that the camera generates from the image file on the blockchain. A hash is a fixed-length value obtained from a data by a certain calculation procedure. Since the hash data size is small, it is possible to record directly to the blockchain. Store the Image File to local storage. To prove that the image file was taken with a camera, first generate a hash from that image file. It then verifies that the hash matches the hash recorded on the blockchain. If they match, it can be proven that the image file was taken with a camera linked to the hash on the blockchain
The current blockchain camera does this on a trial basis. It generates a hash of an image file with hash function sha256. That hash is recorded in the NFT's metadata. Let's take Not Generated #866 as an example.
Click the Info tab on the bottom right and click Decentralized. Then the NFT metadata will be displayed. Below is the hash.
Download 1692950184.8179362.jpg from FILES on this page of the HACKADAY.IO. It is an image file stored from the blockchain camera to local storage. The hash generated from that file with the hash function sha256 matches the hash recorded in the metadata. Hash can be generated by a program written in python or by an online hash generation site. By the way, the hash of the image stored in the distributed file system does not match the hash recorded in the metadata because the image is compressed when it is stored.
The advantage of using hashes is that the size of the hash does not change even if the size of the data file is large. Therefore, this way is suitable for videos as well as images.
Note that if the original data changes even slightly, the hash will change as well. Therefore, the only images and videos that can be proved to have been taken with a camera in this way are those before editing.
Easy to make a blockchain camera
This is an idea to get more people to make blockchain cameras. You don't need a 3D printer to make this. The process simply involves making a single notch in the wooden board. Screw the components onto the wooden board. You will need some spacers at that time. Protect the micro SD card with a screw so that it cannot be easily removed.
Components for easy making a blockchain camera
- 1 x Raspberry Pi 4 Model B / 2GB
- 1 x USB Type-C Cable
- 1 x Raspberry Pi Camera Module 2
- 1 x Adafruit Flex Cable for Raspberry Pi Camera or Display - 200mm / 8"
- 1 x SanDisk microSD 32GB Extreme Pro U3 V30 A1
- 1 x OSOYOO Raspberry Pi Touch Screen 3.5"
- 1 x Power Bank 10,000mAh
- 2 x Rubber Band1
- 1 x Wooden Board 920x90x19mm
- 1 x Pin Socket 2x5 2.54mm Pitch
- 1mm 2 Pin Flat Capper Cable
- 0.3mm Polyurethane Copper Wire
- March 31, 2023 I started learning blockchain and NFT. I minted an NFT from my PC.
- April 1, 2023 I considered the equipment configuration of the Blockchain camera.
- April 10, 2023 I minted an NFT from Raspberry Pi 3B.
- May 1, 2023 I started designing hardware.
- May 6, 2023 After some trial and error configuring the Raspberry Pi, I was able to use the camera and touch screen.
- May 10, 2023 I was able to get everything working from taking a photo with the GPIO input to minting an NFT on the Raspberry Pi.
- May 30, 2023 The hardware has been completed.
- June 9, 2023 I presented at a hackathon demo day in Seoul, South Korea. Polkadot Hackathon 2023 Korea x Japan
- June 12, 2023 I changed a Raspberry Pi from 3 to 4 to make it run faster.
- June 20, 2023 I have experimentally added a function that recognizes the photographed objects and adds those name to metadata as attributes.
- June 29, 2023 I presented at a hackathon demo day in Kyoto, Japan. AI+Crypto Hackathon
- August 2023 I photographed 1000 NFTs outdoors to find improvements. And I started learning programming languages to create programs that run on blockchain.
- August 26, 2023 I have started preparing to open source the Blockchain camera.
- November 29 to December 1, 2023 Exhibited in Tokyo, Japan. KokoKara Fair 2023
- I will enrich this post and repository of the GitHub so that someone other than me becomes interested in blockchain camera and builds it.
- I will create the blockchain camera mentioned in Next ideas. It involves developing a DApp.
What I want to improve
- The touch screen is hard to see outdoors.
- The touch screen is small, making it difficult to enter passwords for crypto wallets.
- You have to enter your password into the crypto wallet every time you start the blockchain camera. It's necessary for security but common cameras don't need it.
- It takes tens of seconds to start up.
- It requires two actions to photograph a NFT : Pressing the shutter button and touching Confirm on the crypto wallet.
- Anyone are able to know that you are currently photographing an NFT.