Skip to content
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

Linting, security analysis via symbolic execution #12

Open
bitjson opened this issue Feb 22, 2019 · 3 comments
Open

Linting, security analysis via symbolic execution #12

bitjson opened this issue Feb 22, 2019 · 3 comments

Comments

@bitjson
Copy link
Member

bitjson commented Feb 22, 2019

It's probably not too difficult to programmatically determine if e.g. the locking script isn't secure against miners. Simplest check is to see if a checksig operation was done for each path.

If you'd be interested in this feature, please comment here.

@bitjson
Copy link
Member Author

bitjson commented Jan 17, 2021

Linting idea: recommend any evaluation with only one push be simplified to remove the unnecessary syntax: from $(< X >) to X.

@bitjson
Copy link
Member Author

bitjson commented Mar 29, 2022

Linting + autofix idea: find all script segments which include stack juggling operations:
OP_DUP OP_2DUP OP_3DUP OP_NIP OP_TUCK OP_DROP OP_2DROP OP_SWAP OP_2SWAP OP_OVER OP_2OVER OP_ROT OP_2ROT OP_TOALTSTACK OP_FROMALTSTACK <2> OP_PICK <3> OP_PICK <4> OP_PICK <5> OP_PICK <3> OP_ROLL <4> OP_ROLL <5> OP_ROLL, run the segment on a stack of 1 2 3 4 5 6 to get the resulting transformation, then pass the expected input/output to a stack operation optimizer. If the segment can be optimized, suggest/autofix to the more efficient construction.

@bitjson
Copy link
Member Author

bitjson commented Mar 29, 2022

RE: validation, we can definitely build a symbolic execution engine that demonstrates if a locking script has unhandled unlocking conditions (some set of inputs which unlock the script which aren't represented by a known unlocking script in the template) to verify the security of a particular contract.

@bitjson bitjson changed the title Linting, simple validation? Linting, security analysis via symbolic execution Mar 29, 2022
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