In the cryptocurrency world, we are bombarded with various kinds of wallet option. Nevertheless, the majority of the public still hesitate to get one due to the lack of time needed for the research, and the pain of going through the tedious process like KYC.

We want to make transfer easy for people that have yet to onboard to the De-Fi world or have their crypto-wallet ready. Making it possible for people to receive crypto funds immediately without breaking a sweat.

The thought of using a smart contract and linking the Twitter handle(username) to a wallet address makes the transfer easy. At the same time, we also get the benefit of transferring funds using a recognizable name.

What it does

Sending fund to Twitter @handler Assuming a user does not have any wallet ready. The fund that was transferred to their @handle will be stored in a contract. This acts as a vault for keeping the transferred fund.

Claiming the fund effortlessly Once the user links their @handle and wallet address through the contract, the contract will release all the funds to the user. Any future transfers going through this contract will also be released to the wallet immediately.

How we built it

We use Hedera smart contract. More specifically, we use the Strato library to communicate with the smart contract. We use Twitter API to validate the user and send a notification to their Twitter @handle to inform the transaction.

Diagram of flow chart. Data flow

For the contract to work, we use oracle to communicate with the De-Fi world. Its core feature is to verify the authenticity of the Twitter user, and register the address into the oracle. This is done by using the Direct Message (DM) feature to inform the user about the transfer, and then redirect them to our application to proceed with the fund claiming.

Other than that, we also developed a minimalist web application for the user to interact with the contract. Key features are: transferring the fund using @handle; updating the wallet address; and viewing the transaction history.

Challenges we ran into

We are new to writing smart contracts. And it wasn't a smooth journey. Most are from the tooling that we are not familiar with and lack good documentation to follow through. Eg. interacting with the smart contract and dealing with Twitter authentication for using their API.

It is difficult to find the right resource to connect a browser wallet to communicate with a smart contract. Strato seems promising at first, but we have to deal with many issues later. Eg. bundling the library to use on the frontend application (Link to the Github PR). To add more to the frustration, there are breaking changes to deal with due to the versioning of the Hedera package and StratoJs package.

Another caveat is due to the limitation of the API where users need to follow the @twittbar2 handle before the notification can be sent to the user. We were trying to find a workaround for this to make it intuitive, but still, it's not possible at this moment.

Accomplishments that we're proud of

Despite all the challenges, we managed to contribute a fix that we used on the library to the open-source project.

Secondly, we completed a working prototype that is connected to the Testnet, and hosted on Heroku.

What's next for Twittbar

Registering the address does not necessarily need to be done through our front-end application. We have plans to make it into a chatbot for the user to interact with through the DM.

This application proves to be workable. There is a potential to expand our use case to other social media platforms.

On the technical side of things, a long processing time with the contract via StratoJs is also an issue at the moment. If more time is given, we can look into speeding up the processing time, and optimize certain queries to be cached on our MongoDB to save on the gas fee.

Built With

Share this project: