<p>No,  if you dont sign the transaction nobody can spend any of the UTXO in your adress... if the Nami wallet  ask you to do it and you trust the page and sign some tx done by a bad behaved  the web-app yes.. they can make spend your UTXOs.</p>
<p>So you should only interact with recognized decentralized web-apps :) .</p>

CC BY-SA 4.0
2021-10-27T00:17:04.200Z
2021-10-27T00:17:04.200Z
Alicia Basilio
<p>I think you're asking two separate questions here:</p>
<ol>
<li>Must someone send their ADA/tokens to a smart contract address in order for the ADA/tokens to be used in the contract</li>
<li>Is it possible for a user to allow some code to execute via some website     button which automatically spends some of the UTxOs in their wallet</li>
</ol>
<p>For the first, it's probably useful to discuss how smart contracts on Cardano work.  Unlike other blockchains where the smart contract takes on an active role directing calls to various interfaces.  Smart contracts on Cardano (otherwise known as validators) have a much more limited role.  On Cardano, smart contracts answer the yes or no question, <code>Can these assets be spent in this way?</code></p>
<p>Because the validator (smart contract) is only checked when the assets are spent, the answer is yes, tokens must first be sent to the smart contract address BEFORE the smart contract does any work.</p>
<p>As for the second question, it's easy enough for a website to direct Nami to send funds to any address you specify.  This can be done without a smart contract and will still prompt the user to confirm and sign the transaction.</p>

CC BY-SA 4.0
2021-11-01T20:20:29.503Z
2021-11-01T20:20:29.503Z
Matt Ho
<p>I don't know the exact technical details of this question because I have just started studying Cardano blockchain development but what I can say is this:</p>
<p>Let's say in this situation, someone has a hardware wallet. We know the private keys never leave the hardware wallet and every transaction using your wallet requires physical interaction by you, the user. (I assume this should hold true for Daedalus and Yoroi wallets) With that said, you would have to do the same in this case. Therefore you could not just allow a smart contract to make, sign and send transactions from your wallet without approving all transactions. I.e., for the hardware wallet, physically reviewing the transaction on the wallet and approving it.</p>
<p>So I would assume from this that transferring money to the smart contract wallet would be how this works.</p>
<p>Anyone, if I am missing anything with this, please correct me.</p>

CC BY-SA 4.0
2021-10-26T22:52:31.273Z
2021-10-26T22:52:31.273Z
Jacob - SNOWY Pool
<p>Must someone send their ADA/tokens to a smart contract address in order for the ADA/tokens to be used in the contract OR, for example with Nami wallet connected on a web page, is it possible for a user to allow some code to execute via some website button which automatically spends some of the UTxOs in their wallet? The latter can be if and only if the user accepts some terms and conditions.</p>

<plutus><wallet><cardano-node><cardano-address><nami-wallet>
Can a smart contract create a transaction on someone else's behalf?
# Can a smart contract create a transaction on someone else's behalf?

(Asked by: username_0 on 2021-10-26)

Must someone send their ADA/tokens to a smart contract address in order for the ADA/tokens to be used in the contract OR, for example with Nami wallet connected on a web page, is it possible for a user to allow some code to execute via some website button which automatically spends some of the UTxOs in their wallet? The latter can be if and only if the user accepts some terms and conditions.

**Tags:** plutus, wallet, cardano-node, cardano-address, nami-wallet

---

## 3 answers

### Answer by username_1 on 2021-10-27. Score: 3

No, if you dont sign the transaction nobody can spend any of the UTXO in your adress... if the Nami wallet ask you to do it and you trust the page and sign some tx done by a bad behaved the web-app yes.. they can make spend your UTXOs.

So you should only interact with recognized decentralized web-apps :) .


---

### Answer by username_2 on 2021-11-01. Score: 1

I think you're asking two separate questions here:

1. Must someone send their ADA/tokens to a smart contract address in order for the ADA/tokens to be used in the contract
2. Is it possible for a user to allow some code to execute via some website button which automatically spends some of the UTxOs in their wallet

For the first, it's probably useful to discuss how smart contracts on Cardano work. Unlike other blockchains where the smart contract takes on an active role directing calls to various interfaces. Smart contracts on Cardano (otherwise known as validators) have a much more limited role. On Cardano, smart contracts answer the yes or no question, `Can these assets be spent in this way?`

Because the validator (smart contract) is only checked when the assets are spent, the answer is yes, tokens must first be sent to the smart contract address BEFORE the smart contract does any work.

As for the second question, it's easy enough for a website to direct Nami to send funds to any address you specify. This can be done without a smart contract and will still prompt the user to confirm and sign the transaction.


---

### Answer by username_3 on 2021-10-26. Score: 1

I don't know the exact technical details of this question because I have just started studying Cardano blockchain development but what I can say is this:

Let's say in this situation, someone has a hardware wallet. We know the private keys never leave the hardware wallet and every transaction using your wallet requires physical interaction by you, the user. (I assume this should hold true for Daedalus and Yoroi wallets) With that said, you would have to do the same in this case. Therefore you could not just allow a smart contract to make, sign and send transactions from your wallet without approving all transactions. I.e., for the hardware wallet, physically reviewing the transaction on the wallet and approving it.

So I would assume from this that transferring money to the smart contract wallet would be how this works.

Anyone, if I am missing anything with this, please correct me.


---

