<p>So, at a high level, you can't make any restrictions on who can create a script, or submit datums to a script address. You can only put restrictions on who can &quot;spend&quot; datum utxos at the script address.</p>
<p>So, one solution is you specify a token that needs to be attached to the datum for it to be spent. That token's minting policy requires the minter to be User B.</p>
<p>User B can create an active instance of the script by submitting a datum attached to the token only she can create. This would essentially be the same as signing the contract, as User B would need to sign the tx that created that token.</p>
<p>The script will only allow User A and User B to spend that datum and make state changes if the &quot;signing&quot; token exists on the UTxO.</p>

CC BY-SA 4.0
2022-06-07T17:47:32.720Z
Note: You'd _probably_ want to take care that the "signing" token can never be sent to a wallet, only to the script address. Otherwise it's essentially a blank check.
Mitchell Turner
CC BY-SA 4.0
2022-06-08T09:41:06.043Z
Your suggesting to have a locked policy and ensuring that a UTXO is present to sign the contract in the validator. This makes me want to ask what do you do if you want to update the SC how do you remove the token from it?
KryptoKing
CC BY-SA 4.0
2022-06-08T22:32:04.467Z
I don't think there is one correct answer. But you can't modify scripts ever. Script addresses are the hash of the code the validates it. So, if you modify the script, it will change the address.

That doesn't mean you can't make your SC upgradable. The upgrades will just cause it to use new scripts. Well designed SCs could be backwards compatible if participants want to interact with old scripts.

A script isn't the same thing as a SC. Multiple SCs can use the same script, and SCs can use many scripts and minting policies.
Mitchell Turner
CC BY-SA 4.0
2022-06-10T15:57:07.633Z
How do I attach the token UTXO to the Datdum?
KryptoKing
CC BY-SA 4.0
2022-06-10T16:39:34.820Z
All datums are attached to a UTxO. And UTxOs have a Value field that can include multiple native tokens.
Mitchell Turner
CC BY-SA 4.0
2022-06-10T18:37:48.827Z
Can you please send me a link on how to attach those tokens or let me know what I should be using to do it. Thanks This is the most helpful question I posted on here. Kinda sad I cant give you more upvotes,
KryptoKing
CC BY-SA 4.0
2022-06-12T03:31:13.707Z
Haha. Thanks. Don't worry about it. I can't tell you how to build your app, but here's an example of off-chain code combining multiple tokens into a single value:
https://github.com/input-output-hk/plutus-apps/blob/ea10bbfa3df3164f87c3687b6c4d99fc0310cf57/plutus-use-cases/src/Plutus/Contracts/Uniswap/OffChain.hs#L230
Mitchell Turner
CC BY-SA 4.0
2022-06-12T14:30:03.467Z
Thanks man that's perfect.
KryptoKing
CC BY-SA 4.0
2022-06-07T17:45:18.913Z
2022-06-07T17:45:18.913Z
Mitchell Turner
<p>I'm thinking about making a parameterised contract between two users. User A can be anyone i.e. any customer, But User B should always be the company. I want to make it so that the validator only validates if the Company signs the contract. How do I do this?</p>
<p>Also, How would both signatures be sent to the contract, without making it easy for somebody to fake the signature of the company?</p>

<plutus><validator><smart-contract><mkvalidator>
How to Make Sure A Contract Is Signed By a Certain Party?
# How to Make Sure A Contract Is Signed By a Certain Party?

(Asked by: username_0 on 2022-06-07)

I'm thinking about making a parameterised contract between two users. User A can be anyone i.e. any customer, But User B should always be the company. I want to make it so that the validator only validates if the Company signs the contract. How do I do this?

Also, How would both signatures be sent to the contract, without making it easy for somebody to fake the signature of the company?

**Tags:** plutus, validator, smart-contract, mkvalidator

---

## 1 answers

### Answer by username_1 on 2022-06-07. Score: 2 | Accepted answer

So, at a high level, you can't make any restrictions on who can create a script, or submit datums to a script address. You can only put restrictions on who can "spend" datum utxos at the script address.

So, one solution is you specify a token that needs to be attached to the datum for it to be spent. That token's minting policy requires the minter to be User B.

User B can create an active instance of the script by submitting a datum attached to the token only she can create. This would essentially be the same as signing the contract, as User B would need to sign the tx that created that token.

The script will only allow User A and User B to spend that datum and make state changes if the "signing" token exists on the UTxO.

> **Comments:**
> **username_1**: Note: You'd _probably_ want to take care that the "signing" token can never be sent to a wallet, only to the script address. Otherwise it's essentially a blank check.  
> **username_0**: Your suggesting to have a locked policy and ensuring that a UTXO is present to sign the contract in the validator. This makes me want to ask what do you do if you want to update the SC how do you remove the token from it?  
> **username_1**: I don't think there is one correct answer. But you can't modify scripts ever. Script addresses are the hash of the code the validates it. So, if you modify the script, it will change the address.  That doesn't mean you can't make your SC upgradable. The upgrades will just cause it to use new scripts. Well designed SCs could be backwards compatible if participants want to interact with old scripts.  A script isn't the same thing as a SC. Multiple SCs can use the same script, and SCs can use many scripts and minting policies.  
> **username_0**: How do I attach the token UTXO to the Datdum?  
> **username_1**: All datums are attached to a UTxO. And UTxOs have a Value field that can include multiple native tokens.  
> **username_0**: Can you please send me a link on how to attach those tokens or let me know what I should be using to do it. Thanks This is the most helpful question I posted on here. Kinda sad I cant give you more upvotes,  
> **username_1**: Haha. Thanks. Don't worry about it. I can't tell you how to build your app, but here's an example of off-chain code combining multiple tokens into a single value: https://github.com/input-output-hk/plutus-apps/blob/ea10bbfa3df3164f87c3687b6c4d99fc0310cf57/plutus-use-cases/src/Plutus/Contracts/Uniswap/OffChain.hs#L230  
> **username_0**: Thanks man that's perfect.  

---

