A reference script is a script that exists at a particular transaction output. It can be used to witness, for example, a UTxO at the corresponding script address of said reference script. This is useful because the script does not have to be included in the transaction anymore, which significantly reduces the transaction size.
./lockReferenceScript.sh yourWalletNamewill lock 2 Ada at a validator and creates a reference script utxo with an attached datum hash at your own wallet.- you have to choose one utxo without tokens
./balanceToFile.sh yourWalletNameshows utxos at given wallet name, you will find one with a reference script attached./unlockReferenceScript.sh yourWalletNameunlock contract utxo and creates a reference script utxo at your own wallet.- first utxo only ada
- second utxo the one with the datum hash
- third utxo is from the contract, same hash as second
- other commands
./balance.sh yourWalletNameshows utxos at given wallet name./cbalance.shshows utxos at contract./cbalanceToFileshows contract utxos, you will not find one with a reference script attached
./lockRefScrOneTwo yourWalletNamewill lock one token at validator one with an integer as datum hash and ~36 Ada at validator two with validator one as reference script attached and validator hash one as datum hash- first utxo only ada with around 40 Ada
- second utxo your token defined in the env.sh file
./cbalanceToFile.sh Twoshows utxos at validator two with validator one as script reference./cbalanceToFiles.sh Oneshows utxos at validator one without reference script but a token as value
./unlockRefScrTwo.sh yourWalletNameunlocks amount defined in validator one datum, locks the rest again at validator two (same datum and reference script)- first utxo form your wallet, just ada (used for fees and collateral)
- second utxo from validator one, should have the token
- third utxo from validator two (same hash as second)
- other commands
./lockRefScrTwo.sh yourWalletNamelocks ~36 Ada at validator Two (without locking a new token)./lockRefScrTwoAgain.sh yourWalletNameconsumes validator Two utxo and creates new output with more Ada (used to fund reference script utxo again)
Note: token will be locked forever
Is valid if one output creates a reference script of the current validator.
Is valid if input and output has correct token and datum hash not changed.
Is valid if datum stays the same, reference script from validator one is created and validator input and output changed amount defined in datum validator one or output is more than input.