<blockquote>
<p>off-chain scripts just instruct on what to do and has no influence under transaction output.</p>
</blockquote>
<p>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</p>
<pre><code>let a = Constraints.mustPayToTheScript datum_one value_one
let b = Constraints.mustPayToTheScript datum_two value_two
let tx = a &lt;&gt; b
...
</code></pre>
<blockquote>
<p>I want to create a Plutus script, which takes Value as a parameter, and locks this value at script's output</p>
</blockquote>
<blockquote>
<p>on-chain validator script just says yes or no to the transaction. No help here.</p>
</blockquote>
<p>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.</p>

CC BY-SA 4.0
2021-11-02T23:53:50.653Z
2021-11-03T07:18:20.747Z
2021-11-03T07:18:20.747Z
Mitchell Turner
<p>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?</p>
<p>on-chain validator script just says yes or no to the transaction. No help here.</p>
<p>off-chain scripts just instruct on what to do and has no influence under transaction output.</p>
<p>So basically this can only be achieved by building/balancing a transaction? By specifying inputs and outputs, and then submitting to blockchain for validation?</p>
<p>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.</p>

<plutus><smart-contract><utxo><script>
How to split transaction into many different UTXOs?
# How to split transaction into many different UTXOs?

(Asked by: username_0 on 2021-11-02)

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.

**Tags:** plutus, smart-contract, utxo, script

---

## 1 answers

### Answer by username_1 on 2021-11-02. Score: 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.


---

