Wallet Segregation

+2 votes

Have been looking into MultiChain and its impressive. I see that Accounts are not recommended so was wondering if there is anyway to segregate a node/wallet? From what I can tell a node /wallet can have multiple addresses to receive but when sending you don't specify an address.


In my use case I need to have multiple wallets but did not really want to run as many nodes. The users would not run the software locally but rather interact through a web ui.


asked Sep 28, 2015 by rob
retagged Sep 28, 2015 by MultiChain

2 Answers

0 votes

Good question! We haven't yet added APIs to enable transactions to be sent from a particular address, but those are on the roadmap, since otherwise (as you note) it's difficult to isolate multiple accounts in a single node.

For now the workaround is to use the listunspent and createrawtransaction calls to manually select UTXOs (unspent transaction outputs) to be used for a new transaction. In other words, you need to create your own coin selection algorithm that filters UTXOs by their receiving address and the assets you want to send.

For a simple example of a coin selection algorithm, see the OP_RETURN_select_inputs functions in our PHP/Python OP_RETURN libraries (designed for Bitcoin Core, but MultiChain's API is compatible). You'll need to adapt this for assets and address filtering, but hopefully it's a useful start:



As I said, we intend to make this much easier in future.

answered Sep 28, 2015 by MultiChain
0 votes
Just an update that MultiChain 1.0 alpha 8 was just released with a bunch of new APIs for isolating operations relating to individual addresses in the wallet.
answered Oct 14, 2015 by MultiChain