This document describes a way to provide web applications a restricted access to user's Bitcoin wallets.
The Bitcoin Wallet API is aimed to provide a uniform, privacy-oriented, restricted access to user's Bitcoin wallets to enable web applications seamless integration with the Bitcoin infrastructure.
The API is designed to provide the smallest possible range of functionality that would enable such integration. The functionality is limited to address generation, data & transaction preparation & signing. Other functionality, such as access to the blockchain, as well as bitcoin & cryptographic primitives are not part of this proposal.
bitcoin.getWallet(function(w) {
w.authorizeTransaction(100000000, null, 'Requesting 1 BTC for X', function(auth) {
var tx = prepareTx(auth.inputs, auth.outputs);
auth.sign(tx, auth.brodcast);
})
})