Inspiration
I've previously (and still kinda do...) worked at a startup called Mattereum, where they have been tackling the challenges of tokenizing Real World Assets on-chain. So I became very intimate with the problem space and solution. I eventually came up with some ideas on how to better improve the system we had, as it was very manual and hand crafted for each customer -- I wanted to decentralize and automate much more of it.
All of the progress I made during this last month or so was all from scratch (I didn't use any of the previously designed smart contracts we had at Mattereum), with the exception of the SVG design we had for these assets. The UX person let me use it for this demo/proof of concept.
I do hope that Mattereum ends up using this as a potential protocol upgrade in the future.
What it does
There are several moving pieces to this system:
- This is an initial gatekeeping check using PolygonID for Verifiable Credentials for basic KYC (and eventually AML) checks for all users.
- A mocked user dashboard after successful authentication. (Will eventually be a customized dashboard based on type of user -- seller dashboard, certifier dashboard, and generic buyer marketplace)
- Two different user flows for minting and creating a RWA token.
- in the minting process there are sections for basic and additional details for off-chain metadata
- there is a section to sign a legal contract, which starts the legal binding and protection offered by civil arbitration courts and the warranties certifiers will later provide
- the legal contract is represented by an EIP-712 signature and its signature bytes stored on-chain, to later verify and recover the signer's wallet address for verification
- an individual details page for each minted RWA asset, it is not completely finished yet, but it will have additional fields available based on the type of user logged in:
- buyers will only see basic details and option to buy it
- the owner will be able to modify some of the metadata, and have an option to fractionalize it into multiple tokens
- a qualified and vetted certifier will have the option to add a warranty to the token, which will enhance and fortify the legal protections of the wrapped legal contract. Additionally, by creating a warranty that certifies the asset, the Certifier receives a small royalty percentage of all future secondary sales while the warranty is still active.
- There are several Chainlink integrations:
- Chainlink Functions to retrieve the asset's valuation from external public APIs
- Chainlink Automation cron jobs (x2), one for executing the above Function call on a time interval, and one for executing the processResponse function which will start the historical valuation record
- The asset's valuation described above is stored in an Open-Zeppelin Checkpoint data structure, which is typically used in votes/governance. This is a unique design decision as it essentially provides a time-series type key:value store over time -- in this case, a block.timestamp as the key, and the externally retrieved valuation as the value. Checkpoints allow you to efficiently retrieve the valuation at specific timestamps since the record was created.
How I built it
With lots of help from ChatGPT and GitHub Copilot, haha.
But seriously, I already had a good idea in my head about the design of the smart contract thankfully, so that part didn't take too long. The frontend part took the longest, as it's my weakest area as a full stack web3 developer. I'm much more comfortable on the backend.
But I just tried to work on small parts at a time and keep iterating!
I actually did try to document my process a bit on twitter, with the whole "build in public" idea.
Check it out here, https://twitter.com/0xHampton/
Challenges I ran into
There were quite a few challenges with integrating the Chainlink and PolygonID parts.
Chainlink went alright, but ran into frequent gas issues from Automation into Functions call. Also there was a lot of back and forth about how I setup the Functions call. I would prefer to have the request built on-chain and javascript source files hosted remotely, but couldn't quite figure out with the available documentation and guides, so I followed closely to one of the guides just to get it working properly.
PolygonID took a little extra time too. And unfortunately it broke my production build on Vercel! I did find a possible alternative to get the verifier server working with Nextjs/Vercel, but I didn't have time to implement it for the hackathon.
Accomplishments that I'm proud of
This is my 3rd hackathon I believe, and this is absolutely the furthest I've ever come with a hackathon project! I'm just happy and proud that I have some semblance of a completed project!
I'm proud that I managed to get the CI/CD pipeline in GitHub Actions working for awhile (it's broken now haha).
I actually plan to make my first open source contribution to Scaffold ETH 2 team for fixing the things I found in getting the CI pipeline working for the foundry version. (also that scaffold template is awesome, it was so helpful!)
Also I am proud that I did it all solo!
What we learned
So much, this was a fantastic learning experience. I also ended up using Foundry for the smart contract development for the first time, and loved it! Unit tests and deploy scripts in solidity is awesome!
What's next for Chainlink-RWA-project
I hope that the startup I've worked for in the past, Mattereum, will take the skeleton of an MVP I've built as a possible protocol upgrade!
Built With
- actions
- alchemyapi
- attom
- chainlink
- chatgpt
- daisyui
- dalle-3
- foundry
- github-copilot
- next
- ngrok
- pinata
- polygonid
- scaffold-eth-2
- socket.io
- solidity
- typescript
- vercel
- wagmi

Log in or sign up for Devpost to join the conversation.