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

Implement bits_to_target Function #9

Closed
AbdelStark opened this issue Jul 31, 2024 · 5 comments
Closed

Implement bits_to_target Function #9

AbdelStark opened this issue Jul 31, 2024 · 5 comments
Assignees
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@AbdelStark
Copy link
Contributor

Create a function to convert the compact bits representation to the full 256-bit target.

Acceptance Criteria:

  • Implement bits_to_target(bits: u32) -> Result<U256, Error>
  • Extract exponent and mantissa from bits
  • Calculate the full target value
  • Ensure the target doesn't exceed the maximum allowed value
  • Handle potential overflow errors

Resources:

  • ZeroSync Cairo 0 code: block_header.cairo
@AbdelStark AbdelStark added the enhancement New feature or request label Jul 31, 2024
@harsh-ps-2003 harsh-ps-2003 mentioned this issue Aug 1, 2024
3 tasks
@maciejka
Copy link
Collaborator

maciejka commented Aug 1, 2024

Welcome and thanks for contribution.
Please add unit tests. And add comment to the issue #15 so I can assign you.

@maciejka maciejka added good first issue Good for newcomers help wanted Extra attention is needed labels Aug 1, 2024
@harsh-ps-2003
Copy link
Contributor

Kindly assign this issue, I will add the unit test soon!

Copy link

onlydustapp bot commented Aug 1, 2024

Hey @harsh-ps-2003!
Thanks for showing interest.
We've created an application for you to contribute to Raito - Bitcoin ZK Client.
Go check it out on OnlyDust!

@harsh-ps-2003
Copy link
Contributor

I am not associated to OnlyDust!

@maciejka
Copy link
Collaborator

maciejka commented Aug 1, 2024

I am not associated to OnlyDust!

That is how you might get paid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants