-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Expose block hash in pallet-contracts #14724
Comments
If such a host function is intended to serve as a source of randomness, then for the reasons stated in #13204, I don't think we should expose in the pallet API. |
We removed the collective-flip randomness there, which afaik never really suffices. In theory, you could've whole block fiat-shamir transforms, but this winds up really nasty in practice. A smart contract parachain could expose VRF based randomness, of which we've two choices:
A smart contract could also create commit-reveal protocols, which work somewhat better in some scenarios, but again require thought. It all depends somewhat upon what the smart contract chain really does. |
To sum up what you are saying, it still all comes down to the specific smart contract chain exposing their own randomness interface to the smart contract developer via, let's say, chain extensions, and we should not (or can not) provide a default method of achieving randomness on-chain? |
It feel premature.. At minimum there should be some way to turn it off since there might even bespoke uses for smart contracts where exposing the block hash creates problems. |
Is there an existing issue?
Experiencing problems? Have you tried our Stack Exchange first?
Motivation
See use-ink/ink#1849
Request
ink! requires
block_hash
environment function to be exposed on the pallet-contracts' side:substrate/frame/contracts/src/wasm/runtime.rs
Line 1022 in 28e906d
Solution
No response
Are you willing to help with this request?
Yes!
The text was updated successfully, but these errors were encountered: