keep-starknet-strange / raito

Bitcoin ZK client written in Cairo.
https://raito.wtf
MIT License
40 stars 34 forks source link

Shinigami integration patch #202

Closed b-j-roberts closed 1 month ago

b-j-roberts commented 1 month ago

Patch to import Shinigami as a library for script execution.

vercel[bot] commented 1 month ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
raito ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 18, 2024 5:30am
m-kus commented 1 month ago

Looks good overall, couple of questions: Where we should take the script flags from? Are they protocol specific? Ideally we should not provide them as program inputs I think.

maciejka commented 1 month ago

Looks good overall, couple of questions: Where we should take the script flags from? Are they protocol specific? Ideally we should not provide them as program inputs I think.

Agree.

b-j-roberts commented 1 month ago

Looks good overall, couple of questions: Where we should take the script flags from? Are they protocol specific? Ideally we should not provide them as program inputs I think.

Script flags can change based on the protocol or also the block, for instance the block version and height can change which scriptflags are used for execution. There are some examples in this function here from btcd: https://github.com/btcsuite/btcd/blob/2b53ed198955ac40fe5b3ce4a854e9f5bfa68258/blockchain/validate.go#L1206

This can be imported to get the script flag values https://github.com/keep-starknet-strange/shinigami/blob/main/packages/engine/src/scriptflags.cairo