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

[FINAL] Adding an endpoint to fetch bitcoin block headers #298

Merged
merged 8 commits into from
Aug 20, 2024

Conversation

THLO
Copy link
Contributor

@THLO THLO commented Apr 4, 2024

The current Bitcoin integration API does not expose any information about block headers.
This information would be useful to verify blocks (e.g., obtained using HTTPS outcalls) by comparing the Merkle root hash with the root hash in the block header.

This PR introduces a new endpoint bitcoin_get_block_headers.

The PR also reorganizes some Bitcoin integration related definitions to make things easier to read from top to bottom.

@THLO THLO requested a review from a team as a code owner April 4, 2024 16:05
spec/index.md Show resolved Hide resolved
Copy link
Contributor

@ielashi ielashi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

API LGTM, leaving final approval from execution to @dsarlis.

spec/_attachments/ic.did Outdated Show resolved Hide resolved
spec/_attachments/ic.did Outdated Show resolved Hide resolved
spec/index.md Outdated Show resolved Hide resolved
Copy link
Member

@dsarlis dsarlis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving on behalf of execution. The API seems reasonable to me and the experimental marker allows us to tweak things if needed in the future.

Copy link
Member

@Dfinity-Bjoern Dfinity-Bjoern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, please synchronize merging with implementation effort.

@Dfinity-Bjoern Dfinity-Bjoern changed the title Adding an endpoint to fetch bitcoin block headers [FINAL] Adding an endpoint to fetch bitcoin block headers Apr 23, 2024
dragoljub-duric added a commit to dfinity/bitcoin-canister that referenced this pull request May 21, 2024
As stated in [here](dfinity/interface-spec#298),
candid interface should look as:

```
type bitcoin_block_header = blob;

type get_block_headers_request = record {
	start_height : nat32;
	end_height: opt nat32;
};

type get_block_headers_result = record {
	tip_height: nat32;
	block_headers: vec bitcoin_block_header;
};

bitcoin_get_block_headers : (get_block_headers_request) -> (get_block_headers_response);
```
This PR will add no-op endpoint for returning the block headers in the
[follow-up](#298) we
will implement specified function.
spec/index.md Outdated Show resolved Hide resolved
dragoljub-duric added a commit to dfinity/bitcoin-canister that referenced this pull request Jun 7, 2024
This PR implements `get_block_headers` endpoint as stated in
dfinity/interface-spec#298.
E2E test will be added in follow-up.
Charging cycles, and determining the cost of the endpoint will be added
in follow-up.

---------

Co-authored-by: Islam El-Ashi <islam.elashi@dfinity.org>
@mraszyk mraszyk merged commit 0a50e0c into master Aug 20, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

6 participants