bitcoin-core / btcdeb

Bitcoin Script Debugger

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Doc Tapscript Example with Tap - Error: Invalid Script

BowTiedDeployer opened this issue · comments

https://github.com/bitcoin-core/btcdeb/blob/master/doc/tapscript-example-with-tap.md#generating-a-taproot-commitment
When running the example it gives an error about an invalid script instead of displaying it as on the doc example.

Tried on ARM chip Ubuntu and Intel chip Ubuntu.

tap $pubkey 2 $script_alice $script_bob
tap 0.4.22 -- type `tap -h` for help
WARNING: This is experimental software. Do not use this with real bitcoin, or you will most likely lose them all. You have been w a r n e d.
LOG: sign segwit taproot
Internal pubkey: f30544d6009c8d8d94f5d030b2e844b1a3ca036255161c479db1cca5b374dd1c
8 spending arguments present
- 1+ spend arguments; TAPSCRIPT mode
  #0: 9997a497d964fc1a62885b05a51166a65a90df00492c8d7cf61d6accf54803be
warning: opcode-like string was not an opcode: CHECKSIG]
  #1: 4f505f434845434b5349475d
  #2: 5b4f505f534841323536
  #3: 6c60f404f8167a38fc70eaf8aa17ac351023bef86bcb9d1086a19afe95bd5333
  #4: 88
  #5: 4edfcf9dfe6c0b5c83d1ab3f78d1b39a46ebac6798e08e19761f5ed89ec83c10
warning: opcode-like string was not an opcode: CHECKSIG]
  #6: 4f505f434845434b5349475d
2 scripts:
invalid script #0: 5b313434

+1 would really be helpful to understand this

The arguments when using bash instead of zsh have to be:

tap $pubkey 2 "${script_alice}" "${script_bob}"

Otherwise, an array argument is taken as multiple arguments instead of a single one.