<blockquote>
<p>Does a script always have the same address forever?</p>
</blockquote>
<p>Yes. But the script doesn't live at the address, transactions spending UTxOs at the address must be validated by the script to be spent.</p>
<blockquote>
<p>When creating a script, the script is given a script address.</p>
</blockquote>
<p>A script address literally is just a hash of script code. It's not given, it can be deterministically derived by anyone with the script code.</p>
<blockquote>
<p>If I would like to run multiple scripts in parallel, how to go about that?</p>
</blockquote>
<p>For Validator scripts, the script is only &quot;run&quot; when trying to redeem a Datum at the script address. You can have many Datums at a validator address though. That <em>could</em> be thought of as many parallel instances at the same address--depending on how the contract is written. Although, some scripts might require multiple Datums are spent simultaneously, etc.</p>
<blockquote>
<p>Do I have to define a nonce variable just to make the address different?</p>
</blockquote>
<p>Yes. Depending on how you write your script, it might be useful to have separate scripts for separate parameters (see <a href="https://cardano.stackexchange.com/q/510/1130">here</a>). But if you want exactly the same behavior for each &quot;instance&quot; I suggest you think of the Datum as being the separate instance.</p>

CC BY-SA 4.0
2022-01-16T21:26:02.073Z
2022-01-16T21:33:21.863Z
2022-01-16T21:33:21.863Z
Mitchell Turner
<p>When creating a script, the script is given a script address. If I would like to run multiple scripts in parallel, how to go about that? Do I have to define a nonce variable just to make the address different?</p>

<smart-contract><script-addresses>
Does a script always have the same address forever?
# Does a script always have the same address forever?

(Asked by: username_0 on 2022-01-16)

When creating a script, the script is given a script address. If I would like to run multiple scripts in parallel, how to go about that? Do I have to define a nonce variable just to make the address different?

**Tags:** smart-contract, script-addresses

---

## 1 answers

### Answer by username_1 on 2022-01-16. Score: 6 | Accepted answer

> Does a script always have the same address forever?

Yes. But the script doesn't live at the address, transactions spending UTxOs at the address must be validated by the script to be spent.

> When creating a script, the script is given a script address.

A script address literally is just a hash of script code. It's not given, it can be deterministically derived by anyone with the script code.

> If I would like to run multiple scripts in parallel, how to go about that?

For Validator scripts, the script is only "run" when trying to redeem a Datum at the script address. You can have many Datums at a validator address though. That *could* be thought of as many parallel instances at the same address--depending on how the contract is written. Although, some scripts might require multiple Datums are spent simultaneously, etc.

> Do I have to define a nonce variable just to make the address different?

Yes. Depending on how you write your script, it might be useful to have separate scripts for separate parameters (see [here](https://cardano.stackexchange.com/q/510/1130)). But if you want exactly the same behavior for each "instance" I suggest you think of the Datum as being the separate instance.


---

