Skip to content

Releases: k98kurz/tapescript

v0.7.3

Choose a tag to compare

@k98kurz k98kurz released this 03 Apr 09:52

0.7.3

Compiler

  • Bug fix: @#name syntax did not work with names of a single char

Tools

  • Added new make_timestamp_after_lock: 7 bytes
  • Added new make_timestamp_before_lock: 8-9 bytes
  • Added new make_timestamp_between_lock: 15-16 bytes
  • Optimized make_delegate_key_lock: saved 13 bytes (98-85)
  • Optimized make_delegate_key_chain_lock: saved 13 bytes (128-115)
  • Corrected make_graftap_lock: added sigflags passthrough parameter
  • REPL:
    • Changed sigfield macros ~s[1-8] to ~sf[1-8]
    • Added new ~s helper that decodes top stack item as utf-8 string

Misc

  • Clarified in docstrings for int_to_bytes and uint_to_bytes that only the former is correct for encoding stack values; deprecated uint_to_bytes

Full Changes: v0.7.2...v0.7.3

v0.7.2

Choose a tag to compare

@k98kurz k98kurz released this 16 May 05:08

0.7.2

VM

  • Bugfix: run_auth_scripts now copies definitions between Tapes used to
    execute scripts in a sequence.
  • Documentation: clarified order that more ops pull values from the stack.

Tools

  • Added new Certificate utility class for parsing certs used in some tools.
  • Improved HTLC lock creation tools with ability to be created with either a
    preimage or a hash digest. Useful for copying hash locks.

Misc

  • Moved version() into its own file.

Full Changes: v0.7.1...v0.7.2

v0.7.1

Choose a tag to compare

@k98kurz k98kurz released this 08 May 18:02

0.7.1

VM

  • Added new run_auth_scripts function to run scripts sequentially in the same
    runtime environment.
  • Added deprecation warning to run_auth_script.
  • Updated package to replace calls to run_auth_script with calls to run_auth_scripts
  • Similarly updated documentation to replace calls to the deprecated function

Full Changes: v0.7.0...v0.7.1

v0.7.0

Choose a tag to compare

@k98kurz k98kurz released this 28 Feb 19:31

From chanelog.md:

0.7.0

Compiler

  • Added @#name syntactic sugar for OP_READ_CACHE_SIZE s"name"
  • Added more aliases:
    • EQ for OP_EQUAL
    • EQV for OP_EQUAL_VERIFY
    • CS for OP_CHECK_SIG

VM

  • Changed OP_TAPROOT to take the root from the stack instead of from the tape;
    it also now takes an allowable_sigflag param from the tape instead of from
    cache keyb'trsf'. Locking script syntax now consistent with OP_CHECK_SIG:
    push x<root> taproot x<allowable_sigflags>.
  • Fixed OP_EVAL: it will now cause a ScriptExecutionError with message
    "callstack limit exceeded" instead of a Python "max recursion limit exceeded"
    error. This change makes it subject to the same callstack limit of everything
    else, and calls to it increase the callstack count.
  • Added option to include aliases in add_opcode

Tools

  • REPL:
    • Added decompilation feature to repl (type ~~ followed by the hexadecimal
      byte codes of a script to see the disassembled script)
    • Can now pass a cache_file path to the repl invocation, and it will load it
    • Repl now automatically sets the "timestamp" cache value to the Unix epoch
      timestamp at the time the repl is invoked
    • Added macro:
      • ~ts to set the timestamp in the cache to current Unix epoch ts.
      • ~~ followed by the hexadecimal byte codes of a script to disassemble it
      • ~d to decode the top stack item into a signed int and print it
      • ~f to decode the top stack item into a float and print it
      • ~s[1-8] value to set a sigfield to the value; if the value has "x" in
        the first 2 chars, it will be interpreter as hexadecimal; otherwise, it
        will be interpreted as a string
  • Added sign_script_prefix parameter to many make_*_witness functions
  • Added ability to pass SigningKey objects to make_*_witness functions
  • Added ability to pass VerifyKey objects as pubkeys to functions that make
    locks
  • Updated tooling for delegate keys:
    • Updated make_delegate_key_cert:
      • Optimized the system by concatenating timestamps into the cert, saving 6
        bytes in the unlocking script and enabline cert chains
      • Appended a bool to indicate if the delegate can further delegate access,
        adding 1 byte of overhead per cert
      • Overall, the changes result in 5 bytes saved for one cert
    • Updated make_delegate_key_lock parsing to account for new cert format
    • Optimized make_delegate_key_lock, saving 27 bytes compared to 0.6.2 (from
      125 bytes to 98), including the updated parsing
    • Updated make_delegate_key_unlock:
      • Renamed to make_delegate_key_witness
      • New cert format saved 5 bytes overall (down to 173 bytes)
    • Added make_delegate_key_chain_lock - 128 bytes
    • Added make_delegate_key_chain_witness - 66 bytes + 108 bytes per cert
  • Added new tools for using balanced Merklized script trees:
    • create_script_tree_balanced
    • create_merklized_script_balanced
  • Added new tools for graftroot:
    • make_graftroot_lock - 58 bytes
    • make_graftroot_witness_keyspend - 67 bytes
    • make_graftroot_witness_surrogate - 68-69 byte overhead
  • Added new tools for graftroot within taproot ("graftap")
    • make_graftap_lock - 36 bytes
    • make_graftap_witness_keyspend - 66 bytes
    • make_graftap_witness_scriptspend - 145 byte overhead
  • Updated make_taproot_lock tool to reflect new OP_TAPROOT syntax; locking
    scripts are now 36 bytes long.
  • Updated make_taproot_witness_keyspend to remove pushing sigflags to cache
    b'trsf', saving 9 bytes in such witnesses (now just 67 bytes; 66 bytes for
    witness that signed without blanking any sigfields).
  • Added make_nonnative_taproot_lock that implements OP_TAPROOT as a demo of
    cryptographic ops and a hacky optimization trick. Script size is 72 bytes.
  • Added option to include aliases in add_soft_fork