github.com/codingfuture/orig-energi3@v0.8.4/swarm/storage/feed/doc.go (about) 1 // Copyright 2018 The Energi Core Authors 2 // Copyright 2018 The go-ethereum Authors 3 // This file is part of the Energi Core library. 4 // 5 // The Energi Core library is free software: you can redistribute it and/or modify 6 // it under the terms of the GNU Lesser General Public License as published by 7 // the Free Software Foundation, either version 3 of the License, or 8 // (at your option) any later version. 9 // 10 // The Energi Core library is distributed in the hope that it will be useful, 11 // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 // GNU Lesser General Public License for more details. 14 // 15 // You should have received a copy of the GNU Lesser General Public License 16 // along with the Energi Core library. If not, see <http://www.gnu.org/licenses/>. 17 18 /* 19 Package feeds defines Swarm Feeds. 20 21 Swarm Feeds allows a user to build an update feed about a particular topic 22 without resorting to ENS on each update. 23 The update scheme is built on swarm chunks with chunk keys following 24 a predictable, versionable pattern. 25 26 A Feed is tied to a unique identifier that is deterministically generated out of 27 the chosen topic. 28 29 A Feed is defined as the series of updates of a specific user about a particular topic 30 31 Actual data updates are also made in the form of swarm chunks. The keys 32 of the updates are the hash of a concatenation of properties as follows: 33 34 updateAddr = H(Feed, Epoch ID) 35 where H is the SHA3 hash function 36 Feed is the combination of Topic and the user address 37 Epoch ID is a time slot. See the lookup package for more information. 38 39 A user looking up a the latest update in a Feed only needs to know the Topic 40 and the other user's address. 41 42 The Feed Update data is: 43 updatedata = Feed|Epoch|data 44 45 The full update data that goes in the chunk payload is: 46 updatedata|sign(updatedata) 47 48 Structure Summary: 49 50 Request: Feed Update with signature 51 Update: headers + data 52 Header: Protocol version and reserved for future use placeholders 53 ID: Information about how to locate a specific update 54 Feed: Represents a user's series of publications about a specific Topic 55 Topic: Item that the updates are about 56 User: User who updates the Feed 57 Epoch: time slot where the update is stored 58 59 */ 60 package feed