keep-starknet-strange / shinigami

Bitcoin Script VM in Cairo
https://shinigamibtc.dev
MIT License
64 stars 59 forks source link

[feat] Add Block Height Flag Support to Bitcoin Transaction Script #277

Closed okhaimie-dev closed 2 weeks ago

okhaimie-dev commented 3 weeks ago

The current run_bitcoin_transaction.sh script needs to be updated to support Bitcoin script flags based on block height. This is necessary to properly validate transactions from different periods of Bitcoin's history where different features (BIPs) were active.

Expected Behavior

  1. Script should accept transaction hash and block height
  2. Calculate appropriate flags based on block height:
    • BIP16 (P2SH) >= 173805
    • BIP34 (Coinbase Height) >= 227931
    • BIP65 (CLTV) >= 388381
    • BIP66 (Strict DER) >= 363725
    • BIP141 (SegWit) >= 481824
    • BIP341 (Taproot) >= 709632
  3. Pass flags correctly to the Cairo function
  4. Successfully validate transaction with appropriate feature flags

Technical Details

Implementation Tasks

Example Usage (After Fix)


# Run transaction with block height
./run_bitcoin_transaction.sh <txid> <block_height>

# Example
./run_bitcoin_transaction.sh 8eb402c4e73c1002d9c891003cbde5c73074cfea53306f3e3b6b2e858bc22ec7 255018
supreme2580 commented 3 weeks ago

Hey guys can I be assigned to this?

Mystic-Nayy commented 3 weeks ago

@okhaimie-dev can I work on this

ShantelPeters commented 3 weeks ago

Please can I be assigned to this issue @okhaimie-dev

SoarinSkySagar commented 2 weeks ago

gm @okhaimie-dev and @b-j-roberts , I would like to handle this issue. I am providing my background, approach and ETA for this issue below.

My background:

I'm a web3 engineer with extensive experience in writing smart contracts in cairo.

My approach:

I will modify the shell file to now accept the <block_height> flag. Then modify the cairo function call's argument to properly handle the new flag. Lastly, I will add proper error handling for wrong or invalid block height flag.

ETA: 4 Days