user2228: 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?

user5122: 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.

user5085: 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).

user382: 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).

2228: <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>
 5122: <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>
 5085: <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>
 382: <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>
