doc.go 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /*
  2. Package mru defines Mutable resource updates.
  3. A Mutable Resource is an entity which allows updates to a resource
  4. without resorting to ENS on each update.
  5. The update scheme is built on swarm chunks with chunk keys following
  6. a predictable, versionable pattern.
  7. A Resource is tied to a unique identifier that is deterministically generated out of
  8. the chosen topic.
  9. A Resource View is defined as a specific user's point of view about a particular resource.
  10. Thus, a View is a Topic + the user's address (userAddr)
  11. Actual data updates are also made in the form of swarm chunks. The keys
  12. of the updates are the hash of a concatenation of properties as follows:
  13. updateAddr = H(View, Epoch ID)
  14. where H is the SHA3 hash function
  15. View is the combination of Topic and the user address
  16. Epoch ID is a time slot. See the lookup package for more information.
  17. A user looking up a resource would only need to know the View in order to
  18. another user's updates
  19. The resource update data is:
  20. resourcedata = View|Epoch|data
  21. the full update data that goes in the chunk payload is:
  22. resourcedata|sign(resourcedata)
  23. Structure Summary:
  24. Request: Resource update with signature
  25. ResourceUpdate: headers + data
  26. Header: Protocol version and reserved for future use placeholders
  27. ID: Information about how to locate a specific update
  28. View: Author of the update and what is updating
  29. Topic: Item that the updates are about
  30. User: User who updates the resource
  31. Epoch: time slot where the update is stored
  32. */
  33. package mru