Skip to main content
Learn how to use Reown AppKit for essential wallet functionalities such as signing messages, getting the balance and sending transactions.
In this recipe, you will learn how to:
  • Sign a message using a connected wallet.
  • Send a transaction to the Bitcoin blockchain.
  • Get the balance from an Address.
  • Get the Public Key.
This guide will take approximately 20 minutes to complete. Let’s dive in!

Prerequisites

  • A fundamental understanding of JavaScript and React.
  • A minimal installation of AppKit in React.
  • Obtain a new project Id on Reown Dashboard at https://dashboard.reown.com

Final project

Appkit Example for Interacting with the Bitcoin Blockchain

Clone this Github repo to try it out locally.

AppKit Minimal Installation

You can start a small project following the guidelines from our installation React docs using Bitcoin

Start building

In this guide we are going to use AppKit to make the calls to the Bitcoin blockchain and interact with the wallet.
  1. Start by importing the useAppKitProvider and useAppKitAccount hooks.
  1. Extract the walletProvider function from the useAppKitProvider hook. This function allows you to prompt the connected wallet to sign a specific message. Also, we are using useAppKitAccount to get the address and isConnected as explained before.

Sign a message

In order to raise the modal to sign a message with your wallet continue with the following steps:
  1. Create a function to prompt the modal for signing the message.
  1. Finally, to call the function:

Send a transaction in Bitcoin

  1. Create a function to raise the modal to send the transaction
  1. Finally, to call the function:

Get Balance

  1. Create the function to get the balance
  1. Finally, to call the function:

Get the Public Key

  1. Create the function to get the public key
  1. Finally, to call the function:

Conclusion

By following this guide, you’ve learned how to integrate Reown AppKit and Bitcoin into your React application to perform essential wallet operations. You can now sign messages, get the balance, get the public key and send transactions in the Bitcoin blockchain. Keep exploring AppKit to enhance your dApp functionality and user experience!