What is the purpose behind the 'Key' parameter in {"for":stream,"key":"...","data":"..."} ?

+1 vote

Hello,

As per title question, I've been trying to find more specifics, but in the tutorials they didn't explain this particular's purpose. Does 'Key" in metadata field mean a mandatory public key from a sender to a receiver when using 'Grant...', 'Complete...' and 'Send...' with metadata added?

I'm assuming I probably haven't look deep enough here, but examples I found simply uses it with an example (such as key:"key1") and doesn't explain to what means I can use it for.

One example:

appendrawdata [paste-hex-blob] '{"for":"stream5","key":"key1","data":"4f6e65206974656d"}'

So where does this "key1" come from and what does it do?

Related API explanation:

sendwithdata 
or sendwithmetadata
address amount data-hex|objectThis works like send, but with an additional data-only transaction output. To include raw data, pass a data-hex hexadecimal string. To publish the data to a stream, pass an object {"for":stream,"key":"...","data":"..."} where stream is a stream name, ref or creation txid, the key is in text form, and the data is hexadecimal.

I understand that the plain text form of the 'key' is inputted but is this 'key' used to do something in particular?

Thank you and your time is appreciated :)

 

asked Mar 1, 2017 by redman

1 Answer

+2 votes
Streams are essentially key-value databases on a blockchain, so the key can be anything you want, and then it's easier to retrieve the items for a particular key later on.
answered Mar 1, 2017 by MultiChain
I should add for clarity that this has nothing to do with the public or private keys used for signing or verifying transactions.
...