0

Let's image I want to create a Plutus script, which takes Value as a parameter (ADA or any other coin with specific amount), and locks this value at script's output. How can I split this value into many different UTXOs of same/different amounts sitting at a script address?

on-chain validator script just says yes or no to the transaction. No help here.

off-chain scripts just instruct on what to do and has no influence under transaction output.

So basically this can only be achieved by building/balancing a transaction? By specifying inputs and outputs, and then submitting to blockchain for validation?

If yes, are there ANY programmable wallets which can do this? Daedalus is not an option, tried Yoroi, Nami, but those doesn't seem to have this functionality. Nami can only do simple transactions with JS.

1 Answer 1

1

off-chain scripts just instruct on what to do and has no influence under transaction output.

You should be able to specify multiple outputs going to the script address in your off-chain code. Just note that they will need to each have separate datums if you want to be able to spend them later. Something like

let a = Constraints.mustPayToTheScript datum_one value_one
let b = Constraints.mustPayToTheScript datum_two value_two
let tx = a <> b
...

I want to create a Plutus script, which takes Value as a parameter, and locks this value at script's output

on-chain validator script just says yes or no to the transaction. No help here.

If you are taking a value that already exists at the script address, you will want to make sure the validator checks that there are the two new datums added to the script address in the outputs. If the value is coming from you wallet, not validation is needed--you only validate when spending outputs from a script address.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.