Giter Club home page Giter Club logo

Comments (5)

kallewoof avatar kallewoof commented on June 10, 2024 1

If tx is spending multiple inputs in txin, you have to select the input index you want to look at using the -s (--select) flag. Otherwise btcdeb will derive the first input being spent and pick that.

from btcdeb.

kallewoof avatar kallewoof commented on June 10, 2024

Some explorers allow you to see the raw hex value of a transaction, rather than seeing its "decoded" form.

Bitcoin-cli has a getrawtransaction command which lets you do this as well. If you know the block hash as well, you can use this to get the transaction hex value by doing

bitcoin-cli getrawtransaction <TXIN TXID> <TXIN CONTAINED BLOCK HASH>

from btcdeb.

panicfarm avatar panicfarm commented on June 10, 2024

Some explorers allow you to see the raw hex value of a transaction, rather than seeing its "decoded" form.

Bitcoin-cli has a getrawtransaction command which lets you do this as well. If you know the block hash as well, you can use this to get the transaction hex value by doing

bitcoin-cli getrawtransaction <TXIN TXID> <TXIN CONTAINED BLOCK HASH>

Thanks, my confusion was that --txin=<reftx hex> is the hex of the entire referenced transaction, that the input is referencing. Perhaps it should be clarified in btcdeb.md, it was unclear.

I still do not understand, if the --tx=<hex> has more than one input that reference the same --txin=<reftx hex>, which tx's input script btcdeb is going to debug?

from btcdeb.

panicfarm avatar panicfarm commented on June 10, 2024

Perhaps it's worth adding an example with all three --tx=<hex> --txin=<hex> --select=<input no> into btcdeb.md. I can look for a representative transaction and submit a PR, if you think it's useful. I also did a screen grab illustrating how btcdeb works for a non-trivial script.

Another question:

A script verification (most often) involves verification of (pubKey, signature) pairs, given the sighash. Is there an API to btcdeb that allows to return all (pubKey, signature) pairs, that have been successfully verified for a given input script (regardless of the script logic)?
Or, in the absence of a btcdeb API, perhaps linking to Bitcoin Core libraries and calling its C++ functions is a way to get the verified (pubKey, signature) pairs, given tx, txin and the input number?

This is the screenshot from btcdeb of what I am looking for:
pubkeys

from btcdeb.

kallewoof avatar kallewoof commented on June 10, 2024

Perhaps it's worth adding an example with all three --tx=<hex> --txin=<hex> --select=<input no> into btcdeb.md. I can look for a representative transaction and submit a PR, if you think it's useful. I also did a screen grab illustrating how btcdeb works for a non-trivial script.

Yeah, sounds like a good thing to have.

Another question:

A script verification (most often) involves verification of (pubKey, signature) pairs, given the sighash. Is there an API to btcdeb that allows to return all (pubKey, signature) pairs, that have been successfully verified for a given input script (regardless of the script logic)? Or, in the absence of a btcdeb API, perhaps linking to Bitcoin Core libraries and calling its C++ functions is a way to get the verified (pubKey, signature) pairs, given tx, txin and the input number?

This is the screenshot from btcdeb of what I am looking for: pubkeys

Nope, no such functionality at the moment.

from btcdeb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.