Code Monkey home page Code Monkey logo

Comments (3)

kallewoof avatar kallewoof commented on July 17, 2024

I get an error when I try your line above; you may have missed copy-pasting all of it as it seems btcdeb expects more data.

The c:pk_h(...) part is simply trying to display your transaction as a Miniscript representation. I'll see if I can clarify that (maybe put the item at the bottom instead of the top...).

Try stepping and it should show you items being put on the stack as usual.

from btcdeb.

kallewoof avatar kallewoof commented on July 17, 2024

Yeah, verified in bitcoin-cli:

$ bitcoin-cli -datadir=x -regtest decoderawtransaction 0200000001602e636f316b16fc4bc0a966d71b0958b1f6104d93477672b7a836db4a357d95000000006a47304402201ff42f44fcd505e037c01605448641750bc99a3567a1c27ec330517491e25bb0022031faef6084ea2e7c9539e213e5c63caa41926492e3e5271064201b8d3f54ed2a012102b6c09f33d3cf812b01924877415f05135a20f0cdaaf35c75cf2e37e7c17480aafeffffff0280f0fa02000000001976a914814a2c0bb0d155667341be55633e7351a7d5c57888ac28f00a2701000000160014596b304f8ae291f6f588bc6759d8218d4cb478e87000000
error code: -22
error message:
TX decode failed

from btcdeb.

kallewoof avatar kallewoof commented on July 17, 2024

There was a missing '00'. Adding it let me see your tx. It does fail on the checksig part, though.

If you do DEBUG_SIGNING=1 DEBUG_SIGHASH=1 btcdeb [...] you get this:

#0007 OP_CHECKSIG
btcdeb> step
GenericTransactionSignatureChecker::CheckSig(72 len sig, 65 len pubkey, sigversion=0)
  sig         = 3045022100d15f16b3d27295a78cd3b51d0076e2267f4c13137ddae2bda21ad125e7f2f07a02207fb126e311e06da096e1ee281dd2cbf34a1d76f5b0b204bd7c26d4f3bbba7bd401
  pub key     = 045ca49382a5836bc13732efb3e66c5fd4ed159679517b7fdc48796e5b411af09f08d3a7b663610006f972162bd0f8f77a140782401f87b2f34f330777e59fb992
  script code = 76a914814a2c0bb0d155667341be55633e7351a7d5c57888ac
  hash type   = 01 (SIGHASH_ALL)
SignatureHash(nIn=0, nHashType=01, amount=50000000)
- sigversion = SIGVERSION_BASE (non-segwit style)
Serializing transaction
 << txTo.nVersion (00000001)
#004 01000000
 << nInputs = 1 [compact]
#001 01
(serialize input 0)
 << txTo.vin[nInput=0].prevout = COutPoint(821d4dee2b, 0)
#032 16402fe74ebc194f15f19ca11c5d49266608b024363c0b077a17c02bee4d1d82
#004 00000000
(SerializeScriptCode)
 << scriptCode.size()=25 - nCodeSeparators=0
#001 19
 << script:76a914814a2c0bb0d155667341be55633e7351a7d5c57888ac
#025 76a914814a2c0bb0d155667341be55633e7351a7d5c57888ac
 << txTo.vin[nInput].nSequence = 4294967295 [0xffffffff]
#004 ffffffff
 << nOutputs = 2 [compact]
#001 02
(serialize output 0)
#008 404b4c0000000000
#001 19
#025 76a91459fe1a9f9f0a5af33396c59990f064be1ca5127488ac
(serialize output 1)
#008 f0e1ad0200000000
#001 19
#025 76a914814a2c0bb0d155667341be55633e7351a7d5c57888ac
 << txTo.nLockTime = 0 [0x0]
#004 00000000
#004 01000000
  sighash     = 779302f71255f26c5c1734d7305d0ad80f78bee5b038c82b3109c1d02bbf22ec
  pubkey.Verify(sig=3045022100d15f16b3d27295a78cd3b51d0076e2267f4c13137ddae2bda21ad125e7f2f07a02207fb126e311e06da096e1ee281dd2cbf34a1d76f5b0b204bd7c26d4f3bbba7bd4, sighash=779302f71255f26c5c1734d7305d0ad80f78bee5b038c82b3109c1d02bbf22ec):
  result: FAILURE
- failed: VerifySignature() failed
error: Signature must be zero for failed CHECK(MULTI)SIG operation
btcdeb>

Not sure what's wrong there, but maybe you can spot the problem yourself?

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.