project screenshot 1
project screenshot 2
project screenshot 3

BlockClarity

BlockClarity simplifies smart contracts and blockchain transactions using on-chain LLMs via the Galadriel protocol. Users input contract addresses or transaction IDs, and BlockClarity provides clear, concise explanations, making blockchain technology accessible and transparent.

BlockClarity

Created At

HackFS 2024

Project Description

The goal of BlockClarity is to make it easier for users to understand verified smart contracts on any blockchain using the power of on-chain LLMs by galadriel. The app first fetches the smart contract code and sends it to the oracle smart contract in chunks of code as the size of the smart contract is too large to be fed as a prompt. This is carefully done such that the gas limit is not exceeded. Once sent to the oracle, it is fed with prompts to summarize the smart contract in detail and after the summary, users can chat with the smart contract to understand the intricacies of it.

How it's Made

This project, Contract Clarity, was built using a combination of modern web technologies to provide a seamless experience for interacting with smart contracts and IPFS. The core of the application is built with Next.js, a powerful React framework that allows for server-side rendering and easy API route creation. For interacting with the blockchain, we utilized Ethers.js, a library for connecting to Ethereum and other EVM-compatible blockchains. We leveraged the ipfs-http-client to directly interface with IPFS nodes, enabling decentralized storage of contract code. Additionally, we utilized axios for handling HTTP requests to various APIs, such as Etherscan for fetching contract source code. To manage environment variables securely, we used the dotenv package. The integration of these technologies provided a robust, scalable, and secure platform for our users. A notable hack in our implementation was breaking down the source code of the smart contract into chunks and sending them to the LLM as a prompt. This project not only showcases the power of decentralized technologies but also highlights the seamless integration of multiple modern web tools to create a cohesive and functional application.

background image mobile

Join the mailing list

Get the latest news and updates