Right now there is no instruction in the Ethereum VM to access resources stored on Swarm. Is there a plan to add such a feature?
1 Answer
Such a feature (interpreted literally as access to content) is impossible for the same reason as random number generation, generic web access or system time: the VM has to be fully deterministic black box, executing exactly the same way in all nodes processing transactions.
However, indirect 'access' will be possible in a similar way to btc relay: Indirect here means that a transaction can assert a certain content on swarm which you can challenge.
All we need to believe is that it is possible to prove that a byte sequence with offset o
and length l
is indeed part of a document
at time t
under a url u
(say for instance mydomain/path/to/my/content
)
the steps for this:
- you can prove that at block
b
corresponding to timet
ENS registry shows hashh
as the resolution ofmydomain
. - you can prove that
h
is the root hash of a manifest (cascade of manifests) in whichpath/to/my/content
points to hashh0
. - you can prove that
h0
is the root hash of a document which contains chunkc
(or series of chunksc0,.. cn
) spanning over the challenged substring. - you can prove that the challenged substring is (or is not) at the relevant offset
- you can 'prove' that at the relevant time
t
chunk c had an unchallanged receipt (valid proof of custody).
swarm will use proof friendly manifest format and a solidity friendly 32-byte segment-based binary merkle tree as the base hash for the swarm hash. This means that such proofs are logarithmic in the size of the document-collection under the manifest plus the size of the document under the url (disregarding the historical state proof complication in 1).
step 5 is a slightly different flavour of 'proof' than the rest since it asserts the actual availability of the information in question.