Allow a node sending only some types of assets

+1 vote

I was wondering whether it would be possible to restrict the send permissions to specific types of assets.

E.g. A node consumes asset A, which it receives from other nodes, and produces another asset B, which it sends to some other nodes. It is assumed that the node irreversibly consumes all received units of A. At the same time, it is desired to record and access how much of A was consumed by the node. Would it be possible to grant the node a permission to send asset B, but not to send asset A?

All the best!
asked Oct 31, 2016 by anonymous

1 Answer

+1 vote

It's not possible right now to restrict send permissions for assets, though it's something we have considered and the APIs and internal database structure is already ready for.

In the mean time, perhaps you can use the chain's burnaddress (from getinfo) as an alternative strategy? This is an address to which assets can be sent and never recovered, which all nodes can see. You could construct a single transaction that burns some of one asset, and moves some of another, using createrawtransaction, then it could be signed by all involved parties before transmitted and confirming.

answered Oct 31, 2016 by MultiChain
Thank you for the answer.
That does sound like a good solution. I just have 2 questions:
1. Would it be possible to create a set of bundled transactions such as "an amount (x) of A is sent from node 1 to node 2 and then x units of A are sent from node 2 to burnaddress"? Would it work if node 2 had 0 of A to begin with?
2. Would it be necessary to sum A sent to node 2 over all transactions to that node or would it be possible to look it up using a gettotalbalances (or a similar command)?
1. No problem doing in a single atomic transaction if node 2 has at least amount x - otherwise it's not possible.
2. Not sure I understand the question but node 2 will know its balance for asset A using regular APIs like gettotalbalances, getaddressbalances, getmultibalances.
Thank you very much!
I think that answers all of my questions here.