Inspiration
Imagine a justice system where every piece of evidence is bulletproof—untampered, authentic, and traceable from start to finish. Today, improper evidence handling isn’t just a flaw; it’s a crisis. Faulty chain-of-custody practices have led to 29% of wrongful DNA exonerations being overturned, 17% of general criminal exonerations stemming from mishandled evidence, and 24% of homicide convictions compromised by forensic errors.
Introducing TRUTH TRAIL—our cutting-edge blockchain solution that transforms the way evidence is handled. By leveraging blockchain technology, TRUTH TRAIL ensures:
- Duplicate Prevention
- Transparent and Immutable Records
- Enhanced Accountability
- With TRUTH TRAIL, we’re not just securing evidence—we’re rebuilding trust in the justice system and stopping systemic bias in its tracks. Join us in revolutionizing the chain of custody for a fairer, more just future.
What it does
Truth Trail aims to eliminate the uncertainty and unfairness that compromise evidence integrity by using blockchain to create a transparent, tamper-proof chain of custody. Truth Trail uses Google Cloud services to store evidence securely in Google Cloud Buckets. It employs Gemini Flash to analyze crime scene images or data, categorizing them according to their content. Each piece of evidence is assigned a unique hash, which is then securely stored in the SKALE blockchain for permanent preservation. Additionally, Truth Trail offers a feature that allows users to verify evidence photos. These images are compared to those in the local database and blockchain to confirm that they have not been altered in any way.
How we built it
A wonderful tool called Create t3 app was a great template to start a full stack node.js app.
npm create t3-app@latest
At first, we decided to try and remain within GCP since oftentimes it's easier to work under a single cloud provider, especially with the recent improvements to Gemini 2.0 Flash / Flash Lite, as well as a simple auth experience with Google OAuth.
Authentication allows us to separate the verify feature, available to the public, from the dashboard and add image features. Upload was the first meaningful step, this page allows you to select an image as well as a related caseID value so that it can be referenced later.
When a user uploads an item, a few things happen, first we hash the image so that we can confirm matches at a later time. The image is also then securely stored in a GCP bucket, and our local database is propagated with a public URL to that image so it can be accessed later. We chose this separation since storing images on the chain was not a very viable solution and was nonessential for the purpose of this project.
During upload, we also pass a copy of this image to Google Vertex AI, and call Gemini 2.0 Flash Lite with custom prompting to give us a list of tags to help categorize the object. The most difficult step was storing a copy of this essential data on the SKALE network for immutability.
We dealt with this by publishing a custom contract on the SKALE network that could store the image hash, userID, and timestamp, returning the Blockchain reference for verification later. Our next step was implementing the admin dashboard page, which shows all of the uploaded images as well as their uploader, upload date, tags, GCP storage link, and verification hash. Since the dashboard in practice would also contain many items, we also made it searchable by the caseID entered in the upload process.
The last and probably most important step of this project was the verify page, which is accessible to both admins and the public. The verify page allows us to either upload an image or specify an image hash. Once uploaded the image can be “verified”, there are 2 possible types of partial verification, Database Verification as well as a SKALE Chain Verification. In order for an item to be considered fully verified it must pass both of these cases. If the image hash matches the hash in both the database as well as the chain it is a doubly verified image that has not been tampered with. Once verification has been confirmed by both sources, all of the relevant image data is displayed. Having this dual layer makes it so that even changes in our database would not allow the image to be validated.
Challenges we ran into
One of the largest challenges we ran into was trying to implement the second layer of verification on the blockchain. At first, we tried implementing this on the Ethereum mainnet using GCP but soon found that that was not a very viable solution due to the gas fees of transactions on ETH. Thus we chose SKALE, which is a gas-free network that allows for projects like this to strive. SKALE also allows us much faster block transactions than Ethereum would, while ETH could give us around a 12-second transaction time, SKALE can often operate subsecond. SKALE is interesting as it uses multiple connected chains rather than a single chain like ETH, allowing for higher speeds and lower congestion.
Overall the implementation of the blockchain verification in our project was difficult due to our lack of experience in the topic and the challenges we needed to overcome to make the project both quick and cost-effective.
Accomplishments that we're proud of
Our biggest accomplishment with Truth Trail was successfully implementing chain verification for uploaded content, this was by far the most challenging feature that we struggled with for quite some time. Although this struggle allowed us to learn a lot about the chain, different networks properties, and smart contracts.
What we learned
We learned a great deal about utilizing the Google Vertex AI API and integrating Google Bucket storage into our program. Using Google’s new model Gemini Flash lite, we were able to provide cheap and viable image categorization abilities to our project. One of the most rewarding learning experiences was understanding how to implement our second layer of verification on the blockchain in our system. This layer of verification on the SKALE network with our smart contact was able to bring our project together. By working through these steps, we gained a deeper understanding of how blockchain technology works and how it can be viably applied to a project that demands guaranteed immutability.
What's next for Truth Trail
To enhance Truth Trail, we could develop a mobile app that allows users to easily upload evidence and receive push notifications on updates. A public API could be created for external integrations, enabling law enforcement and other organizations to interact with the platform, upload evidence, and access case data. To keep users informed, a reporting feature could be added that sends automated updates on evidence or cases, allowing for real-time tracking and generating customizable reports for ongoing investigations. This would expand accessibility and functionality for all users and external partners.
Built With
- gcp
- gemini
- hardhat
- next-auth
- node.js
- prisma
- skale
- solidity
- typescript
- vertexai
Log in or sign up for Devpost to join the conversation.