Closed rumourscape closed 2 years ago
I am receiving a script witness validation error when submitting a transaction even though the Witness has been provided.
What are you using to submit the transaction and what is the error you are receiving?
const script = Script()
Can you provide an example of how you are actually constructing the script? Are you making sure you are using the correct private key from the same address that is using in the script?
I am using this function:
function Script() {
const lock = Cardano.TimelockExpiry.new(45299919);
const nativeScripts = Cardano.NativeScripts.new();
const keyash = getBaseAddress().payment_cred().to_keyhash()
const script = Cardano.ScriptPubkey.new(keyash);
const nativeScript = Cardano.NativeScript.new_script_pubkey(script);
const lockScript = Cardano.NativeScript.new_timelock_expiry(lock);
nativeScripts.add(nativeScript);
nativeScripts.add(lockScript);
const finalScript = Cardano.NativeScript.new_script_all(
Cardano.ScriptAll.new(nativeScripts)
);
return finalScript
}
I am using ogmios to submit the tx and this is the exact error recieved.
ScriptWitnessNotValidatingError: ["9720b134a8c417ac3709c0a3462ef7bea7e2f95d5bfa3875e342ae66"]
And yes I am pretty certain I am using the same key to sign and create the address to create script.
If you're spending from a native script, did you add it to the TransactionWitnessSet
?
Yes I did. You can have a look at my code here: https://github.com/rumourscape/Minting-API .
I would love to know what's going wrong as well.
I have found the problem and resolved the issue.
How did you solve this problem?
I have found the problem and resolved the issue.
I was creating the script with baseAddress keyhash but it should be created using the Public Keyhash.
I am receiving a script witness validation error when submitting a transaction even though the Witness has been provided.
The private key used to create witness is the same with which the native script was created.