BIP Proposal: Wallet Interface



Summary:

A draft for a Bitcoin Improvement Proposal (BIP) was submitted on December 22, 2020, to define a simple interface that wallets and applications can agree on. This BIP describes an API for Bitcoin wallets and applications as standard, which will enable writing bitcoin applications like time lock and multi sig on the web that can be seamlessly used with any compatible wallets. Generally, only simple sends have been available due to seldom available APIs exposed by wallets, but a more robust API that introduces other requests will promote richer Bitcoin applications. Wallets have frequently included inconsistencies in their interfaces and behavior, which has required applications to build and maintain a separate client for each wallet, increasing the risk of bugs and unintended behavior, limiting the adoption of usable bitcoin applications. The wallet interface specification will be implemented using javascript, and wallets should expose their address derivation and signing functions to external applications. The interface would be expressed as a JSON object, including `wallet` metadata, `async enable()` function, and `async request ({ method, params })` function. The wallet must implement the following methods: - `enable`: prompts the user for access to the wallet- `request`: takes one parameter in the format { "method": "wallet_methodName", "params": ["foo", "bar", "baz"] } Sensitive requests that involve signing should always prompt the user for confirmation. The mandatory methods include `wallet_getAddresses`, `wallet_signMessage`, `wallet_signPSBT`, and `wallet_getConnectedNetwork`. Operations that trigger signing using private keys should be guarded behind confirmation screens where the user is fully aware of the nature of the transaction. Great care should be taken when exposing wallet functionality externally as the security and privacy of the user is at risk.If more wallets implement the specification, applications will be developed more confidently by benefiting from the wallet interoperability.


Updated on: 2023-06-14T16:52:31.636442+00:00