Skip to content

Commit

Permalink
Add: Rationale section
Browse files Browse the repository at this point in the history
  • Loading branch information
moonsettler committed Nov 15, 2024
1 parent 40f0b0f commit 59249d9
Showing 1 changed file with 31 additions and 6 deletions.
37 changes: 31 additions & 6 deletions bip-PC.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,6 @@ Using in sequence `OP_CHECKTEMPLATEVERIFY`, `OP_PAIRCOMMIT`, `OP_INTERNALKEY`
and `OP_CHECKSIGFROMSTACK` we can construct a rebindable channel that is also
optimal.

If `OP_CAT` was available, it could be used to combine multiple stack elements,
that get verified with `OP_CHECKSIGFROMSTACK` as a valid state update.

`OP_PAIRCOMMIT` solves this specific problem without introducing a wide range
of potentially controversial new behaviors, such as novel 2-way peg mechanisms.

The number of SHA256 iterations is minimized in the primary use case we
can optimize for, which is LN-Symmetry. Since the Tag can be pre-computed as
mid-state, it would only take 1 or 2 hash cycles in validation for the
Expand Down Expand Up @@ -132,6 +126,37 @@ A reference implementation is provided here:

https://github.com/lnhance/bitcoin/pull/6/files

## Rationale

If `OP_CAT` was available, it could be used to combine multiple stack elements,
that get verified with `OP_CHECKSIGFROMSTACK` as a valid state update.

`OP_PAIRCOMMIT` solves this specific problem without introducing a wide range
of potentially controversial new behaviors, such as novel 2-way peg mechanisms.

### Behaviours LNhance tries to avoid introducing

The following behaviors are out of scope for LNhance and should not be enabled
as a side effect without explicit consensus:

* Fine grained introspection
* State carrying covenants
* Bigint operations
* New arithmetic capabilities using lookup tables

### Alternative approaches

The following list of alternative approaches were discussed and rejected for
various reasons, either for expanding the scope or for unnecesary complexity:

Check warning on line 150 in bip-PC.md

View workflow job for this annotation

GitHub Actions / Typo Checks

"unnecesary" should be "unnecessary".

* OP_CAT
* SHA256 streaming opcodes
* Merkle operation opcodes
* 'Kitty' CAT: result or inputs arbitrarily limited in size
* OP_CHECKTEMPLATEVERIFY committing to the taproot annex in tapscript
* OP_CHECKSIGFROMSTACK on n elements as message
* OP_VECTORCOMMIT:

## Backward Compatibility

By constraining the behavior of OP_SUCCESS opcodes, deployment of the BIP
Expand Down

0 comments on commit 59249d9

Please sign in to comment.