Android Developers: Read this before you give up on WalletConnect v2!

Rodrigosndsilva
Pink Wall
Published in
5 min readJul 20, 2023

We did it again! 🎉

You might remember our previous blog post that explained how to build an Android DApp using the WalletConnect protocol. At the time, we introduced the WalletConnectKit, an SDK that was the easiest way to connect an Android DApp with a, Wallet using the WalletConnect v1 protocol.

Today, we’re thrilled to announce that we’ve taken another step forward, by releasing a new version of the WalletConnectKit, supporting the v2 protocol.

Why WalletConnectKit?

At Pink Room, we understand the challenges developers face when integrating WalletConnect into their Android apps. The lack of good documentation, the need for simple examples, and a straightforward solution to integrate this protocol as we have in other languages/frameworks, simply doesn’t exist.

That’s precisely why we created WalletConnectKit, a tool that aims to be the simplest way to integrate the WalletConnect protocol!

Developing the v1 of this kit was definitely a challenge, but it was essential to fully comprehend the protocol, to have a tool that we can repeatedly use ourselves, and, ultimately, to understand how the Android community felt about the Web 3.0 industry. It looks like we are still few but we were able to help a couple of folks and give back to the community, and that doesn’t have a price.

Since the release of the first version, we already knew that we wanted to support the WalletConnect v2 protocol, and, the shutdown of the WalletConnect v1 bridge/relay servers, on the 28th of July, was the perfect trigger for us to start building.

Why do we need a v2?

The goal of this blog post is not to explain the difference between the v1 and v2 protocols, however, we would like to highlight a few things that make this new version an important change for the future:

  • Chain Agnostic: as opposed to the v1 protocol that only worked with EVM-compatible chains, v2 can support different blockchains;
  • Multi-Chain Support: it’s now possible to connect to multiple chains simultaneously;
  • Pairing and Session Separation: v2 allows you to connect to previously paired wallets without the need to scan a QR code or use a deep link every time;
  • JSON-RPC Permissions: we can now specify in upfront the methods and events we need. This will allow DApps and Wallets to be more transparent about what is possible to do when they are connected and, eventually, allow users to be in control regarding the permissions they want to give;
  • Decentralized Relay: now, the way DApps and Wallets relay messages between each other is by using a Waku v2 protocol, meaning that we don’t rely on a central server anymore but we can use a peer-to-peer network¹.

[1] Even though these are good news, currently, we don’t have a production-ready open-source implementation of a relay server. The WalletConnect team mentioned that they are working on it, but, right now, we need to trust/use their servers, which is far from ideal.

These are just some of the v2 big news that makes this a much more flexible and powerful solution than what we had before. If you are curious to learn more, check out these resources:

WalletConnectKit current state

At the time of writing, our SDK is still in an Alpha version and we encourage you to test it, report bugs, request features and contribute to its development.

Currently, we only support the WalletConnect Sign protocol, the protocol to securely communicate between a DApp and a Wallet, similar to what we were used to in v1. We provide a Sign DApp and Sign Wallet SDKs where we can emphasize some important achievements so far.

Simplified Connection Establishment

Integrating the Sign protocol into your DApp or Wallet can be a daunting task. WalletConnectKit simplifies it by taking care of the heavy lifting, providing a high-level abstraction layer that handles the complexities for you.

Plug-and-play Integration

We wanted to build a very easy solution to integrate this protocol into Android DApps. We did this by abstracting some protocol complexity and by proving DApps with the WalletConnectKitButton. A composable component that allows to establish connections with existing pairs or new sessions with a single line of code. Here is a sneak peek of it in action.

Effortless Session and Account Management

Managing active sessions and associated accounts is a breeze with WalletConnectKit. By utilizing the power of Kotlin Flows, you can seamlessly handle real-time updates, ensuring that your application always has the latest sessions and account information.

Seamless Method Calls

While the v2 protocol is chain agnostic, we wanted to support some Ethereum methods, such as eth_sendTransaction and personal_sign, by default. This was done for simplicity reasons and we want to support more method calls in the future. Until then, we build a function that allows you to specify any JSON-RPC method call.

What’s next?

Although we are already very proud of this new version, we know that we still have a long way to go.

One of our top priorities is to improve the codebase of the project, which was initially developed under tight deadlines to meet the sunset of the WalletConnect v1.

It’s also in our plans to improve the way WalletConnectKit can be used and to enhance the UI/UX flows that we currently have.

Apart from that, and depending on our needs and also the community’s needs, we will evaluate if it makes sense to support more protocols other than Sign.

As we continue to evolve, we kindly invite you to show your support by giving our GitHub repository a star. Your interest means a lot to us! Also, remember that we’re all about collaboration and community-driven development, so contributions are more than welcome!

And that’s a wrap! Got questions or ideas to enhance WalletConnectKit? We’d love to hear from you! Feel free to reach out and share your thoughts. If you want to stay tuned for updates, code samples, and more, follow PinkRoomDev on Twitter.

Happy coding and let’s build the decentralized future together! 🚀

--

--