HTTP Wallet Communications Substrate
Brayden Langley (brayden@projectbabbage.com)
Ty Everett (ty@projectbabbage.com)
Abstract
The Bitcoin Wallet HTTP Interface is a standard interface that enables applications to connect with Bitcoin wallets to facilitate certain functionality. The interface provides a unified way for applications to request the creation of a Bitcoin transaction, encryption, digital signature creation, and other features provided by the wallet. By standardizing the interface, applications can support multiple wallets and give the user greater control over their Bitcoin-related activities.
Motivation
The motivation for this standard interface is to provide a common way for applications to connect with Bitcoin wallets. Currently, many Bitcoin wallets provide their own APIs, which makes it difficult for applications to support multiple wallets. The Bitcoin Wallet HTTP Interface standardizes the way that applications can interact with wallets, enabling them to be more easily integrated into various applications. This interface is designed to be flexible enough to support a range of wallets and use cases, while also providing a secure and standardized method of communication.
Specification
We define a standard HTTP substrate by which wallets can provide a communication channel to applications for the necessary tasks such as creating transactions, creating certificates, signature verification, and more.
All implementors of the HTTP substrate should conform to the following standard for the wallet HTTP API that allows applications to communicate in a predefined and standard way.
Host
We define the wallet HTTP server to support communication over localhost on port 3301
. New API versions can be specified as needed using the standard of v1, v2, etc.
Example Encrypt Request URL: http://localhost:3301/v1/encrypt
Standard HTTP Requests
We define standardized HTTP requests that applications can use to communicate with wallets for performing various tasks.
Message Type | Request Method | Route Name | URL Query String Params | Request Body | Response Body |
---|---|---|---|---|---|
BRC-1 Transaction Creation | POST |
| No Params | JSON | JSON |
BRC-2 Encryption | POST |
| BRC-56 defined | Binary or String | Binary |
BRC-2 Decryption | POST |
| BRC-56 defined | Binary or String | Binary |
BRC-3 Signature Creation | POST |
| No Params | JSON | Binary |
BRC-3 Signature Verification | POST |
| BRC-56 defined | Binary or String | JSON |
BRC-53 Certificate Creation | POST |
| No Params | JSON | JSON |
BRC-53 Certificate Verification | POST |
| No Params | JSON | JSON |
BRC-56 HMAC Creation | POST |
| BRC-56 defined | Binary or String | Binary |
BRC-56 HMAC Verification | POST |
| BRC-56 defined | Binary or String | Boolean |
BRC-56 Public Key Derivation | GET |
| BRC-56 defined | None | JSON |
BRC-56 Certificate List | POST |
| No Params | JSON | JSON |
BRC-56 Version Request | GET |
| No Params | None | String |
BRC-56 Network Request | POST |
| No Params | None | String |
BRC-56 Authentication Request | GET |
| No Params | None | JSON |
BRC-56 Async Auth Request | POST |
| No Params | JSON | JSON |
JavaScript Code Example
Implementation
Implementers of applications and wallets will need to create and process HTTP requests in the manner described, according to the various fields and properties as required by BRC-56, and in a manner consistent with the reference implementation, which is the Babbage SDK's HTTP substrate functionality.
Last updated