Alexey Kiselev
Alexey Kiselev

Reputation: 946

How does the validation process works on RIDE? What happens after attaching the script to account?

So I make an account scripted by using SetScript transaction to attach a script to it, but once the account is scripted, how does it check external transaction? How those external transactions trigger it? Do I pass a reference to the script in those transacitons?

Upvotes: 2

Views: 43

Answers (1)

Nazim Faour
Nazim Faour

Reputation: 804

After attaching a script to an account which will make it a smart-account, the script is responsible to validate every transaction sent by this smart-account. So when this account sends a transaction, the validation is triggered.

In order to setup an Smart Account, The account needs to issue SetScriptTransaction which contains the predicate. Upon success, every outgoing transaction will be validated not by the default mechanism of signature validation, but according to the predicate logic. The account script can be changed or cleared if the installed script allows the new SetScriptTransaction to process. The default account has no script, which is equivalent to this script:

SigVerify(tx.bodyBytes, tx.proofs[0], tx.senderPk)

SetScriptTransaction sets the script which verifies all outgoing transactions. The set script can be changed by another SetScriptTransaction call unless it’s prohibited by a previous set script.

Upvotes: 2

Related Questions