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.

Caution

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

  1. Pressing the shutter button sends a signal to the GPIO.
  2. A photo is taken with the camera module.
  3. A metadata is created from the image file. Meta data includes a image file name and attributes.
  4. The image file and metadata are stored in IPFS via Wi-Fi. IPFS is one of the distributed file systems.
  5. IPFS generates a content identifier (CID) from stored data. 
  6. The CID is sent from IPFS to the blockchain camera.
  7. The crypto wallet is displayed on the touch screen, so touch "Confirm".
  8. The CID is sent from the blockchain camera to the DApp (Decentralized Application) on the blockchain.
  9. 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

Blockchain Explorer

https://blockscout.com/astar/token/0xBF504F574a67a2E3e1F7655576086660f2534daF/inventory

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.

NFT Marketplace

https://tofunft.com/user/0x3C3C3d32CA6604765Ef1E0460D3eA0136749181d/items/in-wallet?sort=token-id

How to photograph a NFT

  1. Press the shutter button.
  2. Touch Confirm on the crypto wallet displayed on the touch screen.

Challenges

There are many unresolved challenges. Here are some of the big challenges as examples.

Next ideas

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.

https://tofunft.com/nft/astar/0xBF504F574a67a2E3e1F7655576086660f2534daF/866

Click the Info tab on the bottom right and click Decentralized. Then the NFT metadata will be displayed. Below is the hash.

"sha256":"b6f95cbfee8abf0b1fd84f225bdd592738ef614cc024044ae7806cb72e7ab265"

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

Development history

Future plans

What I want to improve