RPC Archives - Wasabi Wallet - Blog https://blog.wasabiwallet.io/tag/rpc/ Wasabi Wallet Blog: Insights on Bitcoin Privacy & Tech Wed, 17 Apr 2024 21:34:08 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.2 https://blog.wasabiwallet.io/wp-content/uploads/2022/05/cropped-ww_blog_icon-32x32.png RPC Archives - Wasabi Wallet - Blog https://blog.wasabiwallet.io/tag/rpc/ 32 32 How to Use Wasabi Wallet’s RPC Interface  https://blog.wasabiwallet.io/use-wasabi-remote-procedure-call-interface/ Mon, 25 Mar 2024 09:23:21 +0000 https://blog.wasabiwallet.io/?p=3327 The RPC is used to communicate with a running Wasabi instance. It provides some options and features which are not available (yet) when using the Graphical User Interface. Since Wasabi version 2.0.6, the RPC can be exposed as an onion service, which enables remote control.

The post How to Use Wasabi Wallet’s RPC Interface  appeared first on Wasabi Wallet - Blog.

]]>
The usual way to use Wasabi is by using the Graphical User Interface (GUI), where the user can click buttons and navigate through the app using the cursor. Wasabi also provides a Remote Procedure Call (RPC) interface to interact with the wallet programmatically.

The RPC is used to communicate with a running Wasabi instance. It provides some options and features which are not available (yet) when using the Graphical User Interface. Since Wasabi version 2.0.6, the RPC can be exposed as an onion service, which enables remote control.

Let’s take a look at how to configure the RPC server, its available methods, the features that are currently only available using the RPC. and finally at a usage example.

Configuration

The RPC server is disabled by default. To use the RPC, it has to be enabled in the Config.json file in the Wasabi data folder by setting JsonRpcServerEnabled to true. 

The Remote Procedure Call (RPC) interface allows anonymous and basic authentication access. The default is anonymous access. To enable basic authentication the JsonRpcUser and JsonRpcPassword should be specified in the Config file, and then the right credentials have to be specified at every request.

It is optional (but recommended) to install the jq command line processor and then use | jq at every request to get a structured output.

Available methods

The current latest Wasabi version (v2.0.6) contains 26 RPC methods:

getstatus, createwallet, recoverwallet, listwallets, loadwallet, listcoins, listunspentcoins, getwalletinfo, getnewaddress, send, build, broadcast, speeduptransaction, canceltransaction, gethistory, getfeerates, listkeys, excludefromcoinjoin, startcoinjoin, payincoinjoin, listpaymentsincoinjoin, cancelpaymentincoinjoin, startcoinjoinsweep, stopcoinjoin, buildunsafetransaction, and stop.

Most of these speak for themselves: createwallet creates a new wallet, listwallets list the available wallets etc.

Features currently only available using the Remote Procedure Call

Some methods offer features that are, at the moment of the writing of this article (Wasabi v2.0.6), only available using the RPC interface, like excludefromcoinjoin, payincoinjoin, startcoinjoinsweep and buildunsafetransaction.

excludefromcoinjoin 

Allows to exclude a coin from participating in coinjoin. The coin will never participate in coinjoin until excludefromcoinjoin is set to false.

payincoinjoin 

Allows to pay to a specific bitcoin address in a coinjoin. This saves fees and block space since incoming funds, outgoing payments, and leftover change can all be made private at once.

startcoinjoinsweep 

Allows to sweep (empty) the wallet by sending the coins to the destination wallet in a coinjoin transaction. The destination wallet needs to be a wallet on the same Wasabi client. It works the same as normal coinjoin, except that the outputs are sent to the destination wallet. Note that this is not a proper coinjoin to other wallet implementation, but supposed to be used to empty a wallet.

buildunsafetransaction

Allows to build a transaction with the mining fee being higher than the sent amount, which is otherwise not possible in Wasabi.

listunspentcoins

Although not really a feature, this RPC allows you to see the addresses and derivation path associated with the wallets’ coins, which is not possible to see using the GUI.

Payincoinjoin

One RPC-only feature worth highlighting is the payincoinjoin. Using this RPC method, the user specifies a destination address and the amount, and then the payment will be done in a coinjoin.

In theory, payments in coinjoins be made to any ScriptPubKey, however the zkSNACKs coordinator currently (March 2024) only accepts P2WPKH and P2TR outputs.

payincoinjoin only registers a payment, so if coinjoin is not running or the amount is lower than the wallet balance, the payment is queued.

This feature is new since the 2.0.6 release. The payincoinjoin works, but there are still some optimizations to be made, like to make the coinjoin coin selection aware of payincoinjoin to select coins based on amounts to fulfill the payment. 

Usage Example

The RPC interface can be used with both the daemon as well as the GUI. However using the GUI while also doing RPC calls is not supported and can make Wasabi crash.For wallet specific calls, the wallet name should be specified in the URL.

To simply start using the RPC:

  1. Have the RPC configured
  2. Open the terminal and launch the Wasabi daemon: wassabeed
  3. Open a second terminal window
  4. Call the RPC methods (one can simply copy paste the examples listed in the RPC docs:
  5. For example: curl -s --data-binary '{"jsonrpc":"2.0","id":"1","method":"getstatus"}' http://127.0.0.1:37128/ | jq

(| jq should be removed, if it is not installed)

getstatus

Wallet specific call: listunspentcoins

Wallet specific call with a parameter:

For demonstration purposes, we did it like this by manually entering it in the terminal, but the RPC also makes it possible to do things in an automated way.

For more information about the RPC: explanation and examples of each method, troubleshooting and how to expose the RPC Server as an onion service, please check out the RPC docs.

The post How to Use Wasabi Wallet’s RPC Interface  appeared first on Wasabi Wallet - Blog.

]]>
Unpacking Wasabi Wallet’s Power Feature: The Headless Daemon https://blog.wasabiwallet.io/unpacking-wasabi-wallets-power-feature-the-headless-daemon/ Wed, 13 Sep 2023 15:36:30 +0000 https://blog.wasabiwallet.io/?p=3074 Think of it as your wallet but on a diet. It uses fewer resources like CPU, GPU, memory, and bandwidth, allowing you to run Wasabi Wallet unobtrusively in the background.

The post Unpacking Wasabi Wallet’s Power Feature: The Headless Daemon appeared first on Wasabi Wallet - Blog.

]]>
A Builder’s Best Friend

Wasabi 2.0 has redefined the Bitcoin privacy world with the introduction of the WabiSabi coinjoin protocol. This does not require sacrificing any of the rich features offered by the battle-tested 1.0 version, so that’s why we’re excited to reintroduce the Headless Daemon in Wasabi Wallet v2.0.4. This powerful tool offers a lighter, more efficient way to manage your Bitcoin wallet. No more worrying about resource consumption — the daemon’s got you covered.

What is the Headless Daemon?

Normally, you’d interact with Wasabi Wallet through our graphical user interface (GUI). While user-friendly, the GUI can sometimes demand a lot of your computer’s resources. The headless daemon changes all that. With this new feature, you can interact with your wallet via a simple command line interface. Think of it as your wallet but on a diet. It uses fewer resources like CPU, GPU, memory, and bandwidth, allowing you to run Wasabi Wallet unobtrusively in the background.

Why You’ll Love It

  • Developer-Friendly: Before making new features live on the GUI, developers can test them out via the RPC interface.
  • Always Ready: If you keep it running all the time, there’s no need to worry about synchronizing your wallet every time you wish to use it.
  • Easy Configuration: No need to navigate through config files. You can override settings with a simple command.
  • No Compromises: Enjoy all the features you love without any tradeoffs when switching from the GUI to the daemon.

How to Run the Headless Daemon

Installed Package

Linux Users

wassabeed –wallet=WalletName –jsonrpcserverenabled=true

macOS Users

cd /Applications/Wasabi\ Wallet.app/Contents/MacOs

./wassabeed –wallet=WalletName –jsonrpcserverenabled=true

Windows Users

cd C:\Program Files\WasabiWallet

wassabeed –wallet=WalletName –jsonrpcserverenabled=true

Building from Source

If you prefer to build from source, you can navigate to the WalletWasabi.Daemon directory and run:

$ dotnet run –wallet=WalletName –jsonrpcserverenabled=true

Examples to Get You Started

1. Connect to Testnet

$ wassabeed –network=testnet

2. Run on Testnet with Additional Configurations

$ wassabeed –usetor=false –datadir=”$HOME/temp/wasabi-1″ –network=testnet –jsonrpcserverenabled=true –blockonly=true

3. Open Multiple Wallets

$ wassabeed –wallet=AliceWallet –wallet=BobWallet

4. Check Daemon Version

$ wassabeed –version

Wasabi Daemon 2.0.4

Wrapping Up

With the headless daemon, power users can easily integrate Wasabi’s unmatchable privacy into their project workflow. Get ready to experience a more streamlined, resource-friendly way of managing your Bitcoin. Upgrade to Wasabi version 2.0.4 today and give the headless daemon a spin!

The post Unpacking Wasabi Wallet’s Power Feature: The Headless Daemon appeared first on Wasabi Wallet - Blog.

]]>