Is it possible to read stream_x content from a smart filter?

+2 votes

Hello,

Is it possible to read stream_x content from a smart filter?

The use case is the following:

I want to accept\reject a transaction (using an appropriate smart filter) of some asset depending on what a user has published on stream_x.

Thanks.

asked Nov 5, 2018 by multichain_user123
edited Nov 6, 2018 by multichain_user123

1 Answer

+1 vote
 
Best answer

A transaction filter cannot read a stream directly, because MultiChain allows different nodes to subscribe to different streams, and transaction filters are consensus rules.

Your best bet in this case is to use the signmessage API to create a signed attestation to a message (from the trusted authority), and add that signature as a transaction metadata output, along with the original data in another metadata output. The smart filter can then look at this metadata, and use the verifymessage callback to check the attestation.

answered Nov 8, 2018 by MultiChain
selected Nov 9, 2018 by multichain_user123
That's exactly what I did in the meantime, and it works perfectly!

Thank you very much for your answer.
...