How to validate stream transactions at the client level?

+2 votes

How can we validate stream transactions with mining nodes in MultiChain?

In the Introducing MultiChain Streams tutorial ( under What about smart contracts? it says:

"In a general sense, MultiChain takes the approach in which data is embedded immutably in a blockchain, but the code for interpreting that data is in the node or application layer. This is deliberately different from the “smart contracts” paradigm, as exemplified by Ethereum, in which code is embedded in the blockchain and runs in a virtual machine.

... However, in MultiChain smart contracts would be implemented in a stream-like layer on top of the blockchain, rather than the lowest transaction level."

Smart contracts have the ability to use the information posted on the blockchain with the 'smart contract code'. How could I have my mining nodes validate the data being posted on the stream?

asked Mar 8, 2017 by anonymous
Can you please post more information about what type of rules you need to apply for this validation?
For example, If I post a data item on a stream that requires a certain format?

Or if I need to verify if an unconfirmed transaction's author is a certain public key?

I have read this question posted earlier ( where the first official reply included : "...But as you say they could be implemented as custom validation rules on transactions....".

I am still new to the cryptocurrency technologies in general. I guess my confusion about the functionality of streams is: how can it facilitate the verified computation similar to 'smart contracts' when all of the nodes can run this 'smart contract' code.

If a trusted node incorrectly posts a transaction to a stream that other stream members don't agree with, would it be possible to filter these transactions at the mining level?

1 Answer

0 votes
Thanks for clarifying the question. The answer is that, at the moment, it's not possible to create custom transaction filters in MultiChain, but it's an area we're actively exploring for a future version.

In the meantime if you want to apply rules that validate stream items, you would need to apply them at the application level, skipping over those stream items that don't follow the rules. We understand this is not ideal for some applications.
answered Mar 9, 2017 by MultiChain
Do you have any example of application level stream filter? can u give more insight about how this can be implemented? maybe an open source project.