You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
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:
Slot VRFs - Adversary knows these 6 hours in advance, so they have many choices for their own tx. If otoh an honest user binds their tx to a specific slot, then the adversary has only one choice, accept the tx or not.
Running hash of slot VRFs - We do not currently collect or expose these in polkadot, except at epoch boundaries, but we'll try to change this in sassafras. An adversary spends like 10 n DOTs to have 2^n choices for a running hash of slot VRFs, but their n is bounded by their control over block production, backing, etc.
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.
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:
Slot VRFs - Adversary knows these 6 hours in advance, so they have many choices for their own tx. If otoh an honest user binds their tx to a specific slot, then the adversary has only one choice, accept the tx or not.
Running hash of slot VRFs - We do not currently collect or expose these in polkadot, except at epoch boundaries, but we'll try to change this in sassafras. An adversary spends like 10 n DOTs to have 2^n choices for a running hash of slot VRFs, but their n is bounded by their control over block production, backing, etc.
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.
Activity
agryaznov commentedon Aug 7, 2023
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.
burdges commentedon Aug 8, 2023
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.
SkymanOne commentedon Aug 8, 2023
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?
burdges commentedon Aug 10, 2023
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.