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

feat: Create a Block Content Proof API #651

Open
jsync-swirlds opened this issue Feb 14, 2025 · 1 comment
Open

feat: Create a Block Content Proof API #651

jsync-swirlds opened this issue Feb 14, 2025 · 1 comment

Comments

@jsync-swirlds
Copy link
Member

Persona

As an Hedera Network User

Request

I want to Prove a particular value as of a particular block

Goal

So that I can assure any third party that their transaction was executed correctly

Technical Notes

There are many uses for a Block Content Proof. As part of the State Proof Service (or as a separate Block Content Proof Service) we need to define an API that permits a client to request a Block Content Proof for a particular item in a particular block. This API must define request, successful response, and all probable failure responses (e.g. block does not exist, block not available, item is not present, item has a different value, etc...).

This feature is to define the API and create the API service in the Block Node. The actual creation of Block Content Proofs is a separate feature.

@AlfredoG87
Copy link
Contributor

AlfredoG87 commented Feb 15, 2025

Here is my suggestion for this API

Request:

  1. one of BlockItem or BlockHash
  2. BlockNumber

Response:
one of

  1. BlockProof --> Set of Bytes (Hashes)
  2. ErrorResponse --> BlockNotAvailable or BlockDoesNotExist or BlockItemHashNotExistsInGivenBlock, etc...

Also, either is part of a new Service, BlockProofService (just another suggestion for the name) or maybe a new method on BlockAccessService. Leaning towards a new Service.

Note:

An external party will have the blockProof which is the blockRootHash signed by the network.

The proof needs to provide all the hashes that the user needs in order to compute from the blockItemHash the rootBlockHash, however the Direction of the hashes matter so I would like to recommend for the proof to be a set of MerkleProofElement that is formed by a Hash (Bytes) and Direction (since we only have left or right a boolean should do it, or it can be a Direction Enum.)

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

No branches or pull requests

2 participants