Igor Machado
2 min readSep 16, 2019

--

Yes, this can easily be done in a single transaction.

If assets are of global asset type (Neo 2 types: NEO/GAS), the transaction will need to include as inputs:

  • inputs from user A (how many NEO, from where in the past UTXO, and how much value)
  • inputs from user B (how many NEO, from where in the past UTXO, and how much value)

And the outputs:

  • 30% going to wallet address X
  • 70% going to wallet address Y

If it’s not a global utxo asset, like any regular NEP-5 token, you can also do it, but in a different manner. On InvocationTransaction (Neo2) script, attach the following NeoVM script:

  • PUSH User A Address
  • PUSH User A intended values
  • PUSH User A destination (wallet address X ?)
  • Invoke NEP-5 ScriptHash (which token?)
  • PUSH User B Address
  • PUSH User B intended values
  • PUSH User B NEP-5 ScriptHash (which token?)
  • PUSH User B destination (wallet address X ?)
  • Invoke NEP-5 ScriptHash (which token?)

In both cases, being it a global utxo asset, or a programable NEP-5 token, this Transaction will need to include one Witness per user:

  • Witness A: User script A (address script holding assets), including signature from User A
  • Witness B: User script B(address script holding assets), including signature from User B

Perhaps some wallets out there support this operation out-of-the-box, but I think that perhaps this will require directly coding this operation via some Neo SDK (neonjs, neo-python, …) in your preferred language. The main point is: it’s possible, and not hard (even if it looks hard, the concept and process is very simple to implement).

--

--

Responses (1)