Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add the data_hash to the output of the cell info. #765

Open
jordanmack opened this issue Dec 29, 2020 · 7 comments
Open

Add the data_hash to the output of the cell info. #765

jordanmack opened this issue Dec 29, 2020 · 7 comments
Labels
enhancement New feature or request

Comments

@jordanmack
Copy link

It would be helpful to have the data_hash available on the cell info viewer.

20201228232352

@jordanmack jordanmack added the enhancement New feature or request label Dec 29, 2020
@shaojunda
Copy link
Contributor

What does data_hash mean? Does it mean to do Blake2b on cell data ? Why do you need data_hash?

@jordanmack
Copy link
Author

What does data_hash mean? Does it mean to do Blake2b on cell data ? Why do you need data_hash?

Yes, it is the Blake2b hash of the cell data as seen in the output of get_live_cell.

20201229114358

I believe this is beneficial to have because it can be matched against code_hash when trying to match cell content.

@shaojunda
Copy link
Contributor

I understand what you mean, but not all cell data is code. cell data can be normal data, so dada_hash is meaningless to normal data. @jordanmack

@jordanmack
Copy link
Author

A data_hash may be irrelevant in some cases, but it is highly relevant for a code_hash and also dynamic loading. For anything that is executable, like a script, library, or module, it is very beneficial to have this information.

If the purpose of an explorer is to allow a user an easy interface to walk through the blockchain, then being able to match the data_hash is the final step for tracing any script. I can see this being very beneficial to developers trying to understand CKB, and I would like to use this functionality as part of the lesson plans currently being developed.

@shaojunda
Copy link
Contributor

My current point is that most data will not be a script, but common data. For tracing script, We are considering adding a Script module. It can be understood as a separate page, the user can enter this page by clicking code_hash in the script.

@jordanmack
Copy link
Author

I agree that the data in the majority of cells will not be scripts, but if it's not relevant to the user it can just be ignored. It's a single line in a JSON structure.

If you have a better way of presenting it in mind, I'm fine with that as long as it completely addresses the needs. Tracing a code_hash is the most common, but we may also see growing use in the future from libraries and dynamic loaded modules. Ultimately the bridge needed is to determine if an outpoint specified by the user has the data hash being searched for. As long as that is accomplished by this solution, we're in agreement.

@shaojunda
Copy link
Contributor

I agree that the data in the majority of cells will not be scripts, but if it's not relevant to the user it can just be ignored. It's a single line in a JSON structure.

If you have a better way of presenting it in mind, I'm fine with that as long as it completely addresses the needs. Tracing a code_hash is the most common, but we may also see growing use in the future from libraries and dynamic loaded modules. Ultimately the bridge needed is to determine if an outpoint specified by the user has the data hash being searched for. As long as that is accomplished by this solution, we're in agreement.

Thank you very much for your suggestions, which we will discuss it internally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants