Label and key in streams

+1 vote

Hi,

referring to "Stream confidentiality" page in the blog (https://www.multichain.com/developers/stream-confidentiality/), it's indicated "publish this item to the stream, using the previous stream item txid and target address together as a label for the stream item" with the following command:

multichain-cli chainDemo publishfrom 1... access $label $keycipherhex

In the API documentation the syntax for "publishfrom" command is:

publishfrom from-address stream key data-hex

The same is for liststreamkeyitems and liststreamkeys, which uses "key" not "label".

So my questions:

- are key and label the same thing for streams?

- Is it possible to publish 2 or more items - e.g. a file - with the same key/label (having more versions of the same item, the version being identified by their timestamp and txid)?

- is it possible to change the key/label of an item after having it published (in the same way of changing a file name)?

 

Thank you!

asked May 24, 2018 by GB

1 Answer

+1 vote
Sorry for this confusion. Yes, in the context of a stream, a "key" and "label" are equivalent.

Yes, you can certainly publish multiple items with the same key/label and then retrieve the version(s) your're looking for.

It's not possible to change the key/label of an item after publishing it, since by their nature blockchains are not designed to allow old data to be changed. But you could always add some entry for a key/label that represents this change in name, and then publish new items under the new key/label, and deal with merging the two at the application level.
answered May 25, 2018 by MultiChain
...