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] Check if transaction output is provably unspendable #185

Closed
m-kus opened this issue Sep 12, 2024 · 11 comments · Fixed by #201
Closed

[feat] Check if transaction output is provably unspendable #185

m-kus opened this issue Sep 12, 2024 · 11 comments · Fixed by #201
Assignees
Labels
good first issue Good for newcomers

Comments

@m-kus
Copy link
Collaborator

m-kus commented Sep 12, 2024

There are cases when we can say with 100% guarantee that a particular output cannot be spent.
Such cases include:

  • Pubkey script begins with OP_RETURN
  • Pubkey script size is larger than the maximum allowed
  • Two coinbase transactions in the past (BIP-30)

Implement three helper functions:

  • is_pubscript_unspendable(pubscript: @ByteArray) in validation/transaction
  • is_bip30_unspendable(block_height: u32) in validation/coinbase
  • validate_bip30_block_hash(block_height: u32, block_hash: @Digest) in validation/block (ensures that these two exceptional blocks in the past has exact height/hash pair match)

Call validate_bip30_block_hash in validate_and_apply.

References:

@m-kus m-kus added the good first issue Good for newcomers label Sep 12, 2024
@mubarak23
Copy link
Contributor

mubarak23 commented Sep 12, 2024

@m-kus can i give this a go

kindly assign

Copy link

onlydustapp bot commented Sep 12, 2024

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

@Gerson2102
Copy link
Contributor

I would like to try this sir!

Copy link

onlydustapp bot commented Sep 12, 2024

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

@JoE11-y
Copy link
Contributor

JoE11-y commented Sep 12, 2024

Can I take a look at this @m-kus.

@Sravya-212
Copy link

I am applying to this issue via OnlyDust platform.

My background and how it can be leveraged

I am Blockchain developer with 2 years of experience, I have created and deployed many decentralized projects by mainly focussing on the the Smart Contracts development and secure transactions, I have built DApps, DeFi, which are realtime projects.

How I plan on tackling this issue

I would create a function that works in case of the following
Pubkey script begins with OP_RETURN
Pubkey script size is larger than the maximum allowed
Two coinbase transactions in the past (BIP-30)
and returns an event telling the user why the output cannot be spent by implementing the helper functions given into the specific paths.

@m-kus
Copy link
Collaborator Author

m-kus commented Sep 16, 2024

@Gerson2102 how is the progress on this task?

@Gerson2102
Copy link
Contributor

Currently working on it. I already have the first function. The two left don't know how to do them. I was about to start asking questions about it. But did not have time recently, so maybe at night i wil start working again on it and I'll prepare questions for it.

@Sravya-212
Copy link

@Gerson2102 @m-kus can I join the task too, you don’t have to pay me or anything, I just want to contribute and learn, please let me help in this.

@m-kus
Copy link
Collaborator Author

m-kus commented Sep 16, 2024

@Sravya-212 no worries, there's gonna be more good first issues

@Jemiiah
Copy link

Jemiiah commented Sep 17, 2024

@m-kus would love to contribute to upcoming issues as well

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

Successfully merging a pull request may close this issue.

6 participants