Command to generate hex meta for sendwithmetadata

+1 vote

The sendwithmetadata takes the metadata in the hex form. Which command should be used to convert our data(json) into hex form? And is encryption the only way that this metadata can be protected and decoded only by the two parties/nodes invloved in the transaction?
asked Mar 22, 2016 by amanc

1 Answer

0 votes

JSON data is just a string, so it will depend on what programming language you're using. For example in Python you can use the binascii.hexlify call, though you need to check whether your string is a binary string or a Unicode string and might need to add some extra stage.

answered Mar 22, 2016 by MultiChain
Yes I am doing something similar in nodejs, wanted to check if there is a multichain command as well available to do the same?

And what about the encryption, what is the way to protect this metdata being seen to the two nodes/parties only instead of whole blockchain?
Understood - no there is no specific command in MultiChain.

Sorry I missed your other question - by their very nature blockchains' content are visible in full to every node. So encryption is the right solution.
So can we use the public/private pair generated for every node/address of multichain for encryption/decryption or should we use a separate pair for that?
It's not easy to use the blockchain's built in public/private key encryption, so you should probably use something separate. See this answer for more information: