How DelegateCall's edit funcionality works

in ethereum •  7 years ago 

Yesterday, DelegateCall was launched. Read the post to find out what it is and why it's important.

In this short post, I'll cover how the editing on that platform works and why it's not possible to edit comments or questions, but it is possible to edit answers.

Screenshot 2018-03-14 07.41.40.png

When you post a question on DelegateCall, that question is stored in a transaction. That transaction goes into the DelegateCall dappchain, a small side-chain which is used only for this app. The transaction is bound to a specific user, as you can see in the image below taken from their blockchain explorer.

Screenshot 2018-03-14 07.45.13.png

It is not possible to edit transactions on a blockchain, so the question is there forever. Editing it would be impossible because submitting a new question transaction would simply create a new question by that user. In order to be able to edit questions, the following implementation would be needed:

  1. Additional identifier for question ID in the transaction
  2. On editing a question, use the same ID, but change the question
  3. The UI web app (the interface of DelegateCall.com) would need to look at the question ID, and then show only the question with that ID from the newer transaction.

When you post an answer, because a single user can only have one answer for every question, when publishing it, you are creating a combination of (username=>question). So how is editing an answer possible?

When you click Edit on an answer and submit a changed one, this happens:

  1. The dappchain gets a new transaction with a (username=>question) identifier, but different post body.
  2. The UI (DelegateCall.com) then reads all the answers for the (username=>question) identifier and uses the newest one.

Screenshot 2018-03-14 07.52.17.png

Screenshot 2018-03-14 07.52.24.png

You didn't actually edit your answer, you merely published a new one which is being shown because it's fresher. This lets users implement versioning tools on top of DelegateCall - like Quora or StackOverflow, DelegateCall can also display different versions of an answer, because all prior versions are stored in the dappchain.

So what about comments? If you comment on DelegateCall, that is also written into the dappchain.

Screenshot 2018-03-14 07.44.15.png

However, because a single user can have multiple comments on a single answer or question, it is not possible to apply the Answer method of updating here - the new edits would appear as new comments.

This is where I feel Loom made an architectural mistake. They should have used identifiers for comments and questions so that we can "edit" them by submitting new revisions. We'll see if they can change this somehow.

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!