Wallet protocol

This is a project to define a new wallet protocol addressing problems with the current JSON-RPC implementation in bitcoind. Please feel free to make edits. If you disagree with something, turn it into a “debate”.

Contents

Explanation

This protocol aims to be a standard for communication between Wallets and User Interfaces. It can be used to access a Wallet remotely, or even locally, even if the Wallet and User Interface are produced by different or competing vendors. For example, you could use an Android User Interface from Google to control a QBitcoin Wallet.

Please see the Infrastructure page for an overview of where this protocol fits into the big picture.

Requirements

  • Never use human-formatted data (for example, use base bitcoin units, not Decimal BitCoins nor Tonal BitCoins, which should only be used in formatting for humans)
  • Don’t require polling (for example, broadcast events for new transactions, or changes to current “work”)
  • Cooperative mining (see below)
  • Allow calculating expected minimum fee for transactions, with either (wallet’s choice) locking on the used inputs, or prebuilding the tx and error if it becomes invalid before sending
  • Easy to use in a RPC-like manner, for simple applications

Debates

Binary or plaintext

  • Binary is more efficient to parse and create
  • Plaintext is easier for humans to debug, and avoids forming a dependency on a specific number of bits, endianness, or precision
  • Binary can include custom transactions as-is for transmission

Binary wire formats

  • Protobuf seems efficient and easy to use from all major languages

Plaintext wire formats

  • JSON implementations tend to be buggy.

Cooperative mining

The protocol should support submitting completed blocks, such that it can get (just) addresses from an upstream pool to generate to, and send all completed blocks to that pool for verification and counting (and possibly submission to the network). This can reduce the pool’s load.

UI bundling

For more secure use by ordinary end users, UIs and Wallets should support stream-based communication over standard I/O (stdio). This allows the UI to simply execute a dedicated Wallet, without requiring the user to setup Wallet-side authentication. This also permits full compatibility with a hardware-based wallet located on a secured device (for example, a cryptographic hardware module, or a wallet device connected via RS232 or USB). (Suggestion, if UI’s could talk to any stream, including a child process’s stdio, as well as a pipe or a device, the flexibility would be valuable)

DRAFT 0

Everything beyond this point is strictly DRAFT, should NOT be implemented, and is subject to being completely rewritten or modified!

Conformance requirements

All diagrams, examples, and notes in this specification are non-normative, as are all sections explicitly marked non-normative. Everything else in this specification is normative.

The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in the normative parts of this document are to be interpreted as described in RFC2119

</references>

Source

http://bitcoin.it/

See Also on BitcoinWiki