-
Notifications
You must be signed in to change notification settings - Fork 6
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
Make bitcoin-util evalscript functionality available as library call #71
Comments
cc @apoelstra |
We'd definitely prefer C to C++. And yes, I think this would be super useful and replace the primary (only?) usecase for rust-bitcoinconsensus. Though if it were in -inquisition rather than Core itself... hard to say how people would feel about that. I've never needed this functionality personally. And passing transaction data directly in, rather than having to marshall the whole transaction into a bytestring that the C code reparses, is even nicer. |
I was thinking develop it in -inquisition then merge it into core once we've got something we like.
I don't understand? The C++ code would want I think rust-bitcoinconsensus's API is just:
Do we want to just start with duplicating that, or some other API? |
Oh, I misunderstood you. When you said it "takes the following options" I missed that the transaction was just one object and everything else was non-transaction data. In my head you were somehow breaking the transaction up into version, sequence, inputs and outputs. In practice I think doing this would be a really messy proposal and probably not even simpler than using the existing API.
Yeah, I would say we should start by just duplicating that. |
evalscript as it stands does have separate arguments for the script, witness, internal pubkey and sigversion that would normally be determined by the tx/input index/scriptpubkey, which makes things easier for experimentation than having to bake them back into the transaction, so that might be what led you think that way? |
From bitcoin#29189 (comment)
Is having functionality like this available as a library function worth exploring as a feature in inquisition, to potentially eventually upstream to core?
The evalscript subcommand takes the following options:
SCRIPT_FLAG_*
names)base
,witness_v0
,tapscript
, representing the different script versions supported)It outputs a json object that looks like:
If it is interesting to make this available via a library, what should API look like? Should it be C++ or C?
The text was updated successfully, but these errors were encountered: