Skip to content

Feature/Enhancement Request: new OP_GRAFTROOT #15

Description

@k98kurz

Feature or Enhancement?

  • (x) New feature
  • ( ) Enhancement of existing feature

Description

In the current development cycle for v0.7.0, I have implemented tool functions generating scripts for graftroot lock, keyspend witness, and surrogate execution witness using tapescript code valid in v0.6.2. I also made tools for "graftap" (graftroot-within-taproot) to reduce the size of the locking script for scenarios in which locking scripts must be concise. Below are the byte code sizes for the resulting scripts:

Graftroot Graftaproot
Lock 58 36
Keyspend Unlock 67 66
Scriptspend (Overhead) 69 145

If an OP_GRAFTROOT opcode was implemented, it would reduce the size of a Graftroot locking script to 36 bytes if implemented similarly to the updated OP_TAPROOT syntax planned in #14. The witnesses could also be reduced by 1 byte -- selection of keyspend or surrogate branch was originally done in the locking script, but the dup size push d32 eq condition had an additional overhead of 5 bytes, so I instead made the branch selection in the witnesses (true or false at the end of the witness).

Tasks

  • Add OP_GRAFTROOT to VM
  • Add OP_GRAFTROOT to compiler and decompiler
  • Update tools

Additional context

Metadata

Metadata

Assignees

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions