forcing a transaction to go through an external API before sending

+2 votes
Is it possible to use transaction filters to make a sending transaction go through an external API, to get a success or fail for it to progress or fail the transaction?.. It would send the receiver address to an external API, check that address to meet criteria and then return yes or no response that could be acted upon by the transaction filter...perhaps with a timeout if nothing received within say 10 seconds..
asked May 28, 2019 by mark

1 Answer

0 votes

Yes, you could do this by requiring an attestation in the transaction to come from a certain address, and enforcing this rule in a transaction filter. There's an example here:

https://github.com/MultiChain/smart-filter-examples/blob/master/transaction-filters/approve-asset-transfer.js

Another simpler method could be to use a combination of signmessage (to create the approval, which is then embedded in some metadata together with the message that was approved) and verifymessage (to check the approval in the transaction filter). The approved message could include the identity of the address the funds are being sent to, the amount, and some kind of time limit (that is checked against getlastblockinfo).

answered May 29, 2019 by MultiChain
...