Describe the problem
In the infinite feed of life, it's a common desire to store great stuff in our minds. Sadly, the brains don't work that well on storing NFTs. Countless times we crossed by astonishing pieces of art on Teia. Yet sometimes we have no money to acquire it. I just wish I could save it for later!
This is a proposal for storing list-like user data, such as saved collections (just like instagram saves), and can be used for even more purposes like follows, likes, shopping carts, the possibilities are endless.
Describe the solution you'd like
The Cycle:
-
A user click on "save" a post, the frontend must "mint" a list on a smart contract that relates this "file list" with a specific user (user: tz1..., list: ipfs CID). This updatable list is published to IPFS as a.json IPNS (editable ipfs that never changes the CID), then minted.
-
The problem of IPNS files is that it can only be edited by the IPFS node that created it and holds a key to edit it. The solution would be to use a centralized node by teia or by using winloss's solution, that will hold the key to edit it. Owners of the wallets also have the possibility to communicate with the smart contract that holds the list CID and can be able to change it to its preferred solution later.
-
As soon as the user have the .json file list ready floating on IPFS's infinity of data, we must populate it everytime a user clicks on that save button. This is a bit too heavy usage to do directly to IPFS, as real time micro interactions does not work well yet with these p2p technologies as winloss suggested (more research needed). In this sense we would need to index all the users interactions on an indexer as a "cacher" that will then batch-publish to their respective IPNS files by using our centralized ipfs node with private key.
Mapping What We Will Need:
- An IPNS/IPFS node and a pinning service (could be winloss's solution)
- A save button design for the UI of the front end
- A react js code to mint a new IPNS .json list onclick of the save button if the user dont have a saves list yet (this can happen other time too, like on settings)
- A react js code that connects to the node and launches an IPNS file to IPFS for the user with the updatable json list format storing the objkt IDs
- A simple smart contract to store the wallet and the ipfs CID, and enable users to change it later as owners of the wallets
- A react code than understands if the user is already with a saved list registered on the smart contract, and if so, each interaction can now be indexed on an indexer blazing fast
- An indexer that will work as a gateway for mass interactions that then will be batch stored on the IPNS file via the IPFS node
- A backend cron batch publisher from the indexer db to our IPFS node's stored IPNSs
- A page to see the saved items of the user like teia.art/saves. It could be public like /tz/t1.../saves or private for the logged user like just /saves.
I imagine if we had only one collection the json would look like this:
teia-saves-<tz1wallet>.json
{
"owner":"tz1...xyz",
"objkts":["001, 002, 003"]
}
or if we had multiple collections then
teia-saves-<tz1wallet>.json
{
"owner":"tz1...xyz",
"lists":{
"list name 1":{
"objkts":["001, 002, 003"]
},
"list name 2":{
"objkts":["004, 005, 006"]
}
}
}
Alternatives considered
All ideas for alternatives and better ways for executing are very welcome, as this is just an excercise to spark the flame of creativity in your minds.
Additional context
________________________
|.----------------------.|
|| ||
|| ______ ||
|| .;;;;;;;;. ||
|| /;;;;;;;;;;;\ ||
|| /;/` `-;;;;; . .||
|| |;|__ __ \;;;| ||
||.-.|;| e`/e` |;;;| ||
|| |;| | |;;;|'--||
|| |;| '- |;;;| ||
|| |;;\ --' /|;;;| ||
|| |;;;;;---'\|;;;| ||
|| |;;;;| |;;;| ||
|| |;;.-' |;;;| ||
||'--|/` |;;;|--.||
||;;;; . ;;;;.\;;||
||;;;;;-.;_ /.-;;;;;;||
||;;;;;;;;;;;;;;;;;;;;;;||
||;;;;;;;;;;;;;;;;;;;;;;||
'------------------------'
[save objkt]
🧪 feature request