It is a very sophisticated query. bcoin already has a built-in pockets that may do all of those operations for you. There’s a well-documented RESTful HTTP API you may learn by way of right here: http://bcoin.io/api-docs/ to get an thought of what is accessible. It’s also possible to write your individual pockets software utilizing the bcoin object courses immediately.
Very broadly nevertheless, here is some suggestions which may curiosity you:
-
Allow Handle indexing. It is a characteristic that’s not at present accessible in bitcoind but (thus far I believe solely indexing by transaction ID is supported). That is switched on with
indexAddress: true
inbcoin.conf
or--index-address
on the command line. The deal with index will allow you to request the transactions related to a selected deal with: http://bcoin.io/api-docs/#get-tx-by-address -
It would be best to course of that transaction information and perhaps cross-check the UTXO set (so you already know what has been spent already) with the API name http://bcoin.io/api-docs/#get-coin-by-outpoint
-
Try the
MTX
andCoin
objects to assemble a transaction from the UTXO you recuperate. Now we have a number of guides on transaction dealing with, perhaps learn by way of this: http://bcoin.io/guides/working-with-txs.html -
Signing transactions with non-public keys: I am unsure how your software will work but it surely sounds just like the customers must signal the TX themselves?
I recomend you learn by way of the bcoin API docs and the guides (and naturally, the codebase!). And simply deal with the default pockets course of for coin choice, transaction composition, signing, and personal key dealing with.