Tying assets with streams and publishing json metadata on a stream

+3 votes

I want to 1) send an asset over to an address and 2) make the information of the transaction (more importantly, its metadata) available. From the documentation and questions, I assume that my best option is to use raw transactions to create the asset and publish the metadata on a stream for easy retrieval.

My question is threefold:

1) Would I have to use createrawsendfrom (as in the first Publishing to streams section) or createrawtransaction & appendrawdata (as in the second Publishing to streams section)

2) Is there a way to "tie" the asset transaction with the corresponding stream item which contains transaction metadata? Because as I understand for raw transactions, this is not the case.

3) Can I publish json metadata on a stream using raw transactions?


My objective is somewhat (I presume) similar to this question:

https://www.multichain.com/qa/11833/possible-combine-native-asset-sendt-stream-with-json-metadata?show=11833#q11833 . 

asked May 24, 2019 by gioannou

1 Answer

+2 votes
Best answer

You could use the raw transactions mechanism, but there's no need to get that complicated. Instead, just use sendwithdata with lets you specify the stream item to publish together with the asset transfer.


The asset transaction and stream item will be automatically tied together by the fact that they have the same transaction ID.

answered May 27, 2019 by MultiChain
selected May 27, 2019 by gioannou
I can see an example of this in the Getting Started section. Can I however embed metadata in json format, instead of binary with the sendwithdata command?
Yes, this is all documented in the link I sent, search for sendwithdata.
You're right, I missed it.