<p>When you create an output with a script address, you can put whatever staking key you like on it. That staking key behaves exactly like staking keys do in all other outputs.
Scripts can see staking keys associated with outputs, so if you want to make an assertion about what staking key is used on an output, you can do that.</p>
<p>So yes, if you have an ongoing state machine you can assert that the funds are always staked with a particular key.</p>
<p>In addition, you can also have a script control the delegation rights itself. Each address has a payment credential (key or script hash), and can also have a stake credential (key or script hash — or a reference to a stake address registration certificate, which will yield you a key or script hash, but is more compact in the UTxO).</p>

CC BY-SA 4.0
2022-01-31T12:54:51.463Z
2022-01-31T12:54:51.463Z
Will
<p>An Ada address is made up of 2 separate credentials, one for payment and one for staking. These are both treated independently and one, the other or both can be script hashes instead of plain key based addresses. This means the user putting funds in a smart contract can keep those funds associated with their stake address until the script is spent (at which time the person redeeming the script gets to choose what stake credential is used).</p>

CC BY-SA 4.0
2022-01-31T13:00:35.530Z
Is there an example of this? You mentioned the possibility of the UTxO "creator" to specify the delegation of that UTxO, is this regardless of the the location it ends up at? I thought that once send the funds are delegated to that which the address it sits at specify (not the transaction it originated from).
Fermat
CC BY-SA 4.0
2022-02-01T00:26:17.490Z
I would really like for this to be possible, but I don't see how.  Is there a way that I, a normal cardano defi degen can construct a transaction to provide liquidity to Sundae Swap, lock my ada/<TOKEN> pair up in one of their LP scripts and keep my ada staked but still get the LP tokens in return?  If this is doable, it needs to be more publicized than it is.
prodineeritecht
CC BY-SA 4.0
2022-01-31T12:44:20.883Z
2022-01-31T12:44:20.883Z
Samuel Leathers
<p>Yes. There are a few projects doing this, one of them is StakingDAO, which is in Catalyst Fund 7. I cannot give you details about how this is done, but I heard a few other people saying this is possible.</p>

CC BY-SA 4.0
2022-01-31T07:46:12.440Z
2022-01-31T07:46:12.440Z
George - APEX Stake Pool
<p>I am curious to know what happens to ADA when it gets locked to a script as far as staking goes. In other words, can ADA locked at a script address by staked?</p>

CC BY-SA 4.0
2022-02-18T14:44:29.110Z
This is a brand new resource that's related to this topic which I thought might be interesting for devs to read!

https://github.com/Plutonomicon/plutonomicon/blob/main/stake-scripts.md
Will
<staking><script><script-addresses>
Can ADA locked on a script be staked?
# Can ADA locked on a script be staked?

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

I am curious to know what happens to ADA when it gets locked to a script as far as staking goes. In other words, can ADA locked at a script address by staked?

**Tags:** staking, script, script-addresses
> **Comments:**
> **username_1**: This is a brand new resource that's related to this topic which I thought might be interesting for devs to read!  https://github.com/Plutonomicon/plutonomicon/blob/main/stake-scripts.md  

---

## 3 answers

### Answer by username_1 on 2022-01-31. Score: 3 | Accepted answer

When you create an output with a script address, you can put whatever staking key you like on it. That staking key behaves exactly like staking keys do in all other outputs.
Scripts can see staking keys associated with outputs, so if you want to make an assertion about what staking key is used on an output, you can do that.

So yes, if you have an ongoing state machine you can assert that the funds are always staked with a particular key.

In addition, you can also have a script control the delegation rights itself. Each address has a payment credential (key or script hash), and can also have a stake credential (key or script hash — or a reference to a stake address registration certificate, which will yield you a key or script hash, but is more compact in the UTxO).


---

### Answer by username_2 on 2022-01-31. Score: 7

An Ada address is made up of 2 separate credentials, one for payment and one for staking. These are both treated independently and one, the other or both can be script hashes instead of plain key based addresses. This means the user putting funds in a smart contract can keep those funds associated with their stake address until the script is spent (at which time the person redeeming the script gets to choose what stake credential is used).

> **Comments:**
> **username_3**: Is there an example of this? You mentioned the possibility of the UTxO "creator" to specify the delegation of that UTxO, is this regardless of the the location it ends up at? I thought that once send the funds are delegated to that which the address it sits at specify (not the transaction it originated from).  
> **username_4**: I would really like for this to be possible, but I don't see how.  Is there a way that I, a normal cardano defi degen can construct a transaction to provide liquidity to Sundae Swap, lock my ada/<TOKEN> pair up in one of their LP scripts and keep my ada staked but still get the LP tokens in return?  If this is doable, it needs to be more publicized than it is.  

---

### Answer by username_5 on 2022-01-31. Score: 2

Yes. There are a few projects doing this, one of them is StakingDAO, which is in Catalyst Fund 7. I cannot give you details about how this is done, but I heard a few other people saying this is possible.


---

