8000 "success" condition · Issue #2 · ajtowns/bllsh · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

"success" condition #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ajtowns opened this issue Dec 13, 2024 · 0 comments
Open

"success" condition #2

ajtowns opened this issue Dec 13, 2024 · 0 comments

Comments

@ajtowns
Copy link
Owner
ajtowns commented Dec 13, 2024

What should the "success" condition for a bll expression be? (ie, what result(s) from the expression should be treated as "the input is authorised to be spent as part of this transaction", vs "this tx is invalid")

  1. Anything except nil -- logical, matches the success path of the if opcode
  2. Exactly the single byte atom \x01 -- matches the result of (not (= 1 2)), limits malleability
  3. Exactly nil -- is the result of the (softfork) opcode, matches what chia would see as "no additional requirements", limits malleability
  4. Anything that is not an exception -- very broad
  5. Any atom other than nil -- similar to bitcoin's "cleanscript" rule
  6. Any atom that is not equivalent to 0 -- matches bitcoin's rule

I think I'm leaning towards "anything that is not an exception". However, a problem with that is it's annoying to convert falseyness to an exception, you have to write (a (i (CONDITION) nil '(x))).

Perhaps it would be worth having a "verify" opcode, so you could reduce that to (verify (CONDITION)), where verify acts like x if its argument is nil, but evaluates to 1 otherwise. In that case, if you had an expression that expected to be run in one of the contexts above, you could convert it to context 4 as:

  1. (verify (CONDITION))
  2. (verify (= 1 (CONDITION)))
  3. (verify (notall (CONDITION)))
  4. (CONDITION)
  5. (verify (| (CONDITION)))
  6. (verify (+ (CONDITION)))

which feels like a more reasonable level of overhead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant
0