Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>btc-scriptNew to Visual Studio Code? Get it now.
btc-script

btc-script

Ashish Thapa

|
92 installs
| (0) | Free
https://github.com/voidash/btc-script-vscode
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

BitcoinScriptVscode 🔗🔥

VScode plugin for Bitcoin Script within Rust files and (.btc) files.

Download it now: BitcoinScriptVscode

-----------------------------------------------------

Features 🍙

  • Syntax Highlighting: Added the textmate language grammar. Highlighting works on .rs files as the grammar is injected for Rust files
  • Instant Feedback: The stack content changes are shown on the right side with virtual text
  • Simple: Just add in the [main stack] and [alt stack] on top of your script

-----------------------------------------------------

How it works 🛠️

extension working

The first line should be in one of these formats:

  • [A, B] (just the main stack)
  • [A, B] [C] (the main stack and the alt-stack)

Inside script! ✍️

pub fn u8_extract_1bit() -> Script {
    script! {
        // [1,2], [3,4]
        OP_DUP
        OP_ADD
        256
        OP_2DUP
        OP_GREATERTHANOREQUAL
        OP_IF
            OP_SUB
            1
        OP_ELSE
            OP_DROP
            0
        OP_ENDIF
    }
}

Inside //btc-script comment block 📝

// btc-script
  [3,4]
  OP_DUP
  OP_TOALTSTACK
// end-btc-script

On .btc file 💼

You can also create a .btc file and then on top of the file. Add your main and alt stacks as mentioned above

-----------------------------------------------------

Acknowledgments 🙏

Inspired from this tweet by @t4t5 Repo bitcoin-script-hints

-----------------------------------------------------

Things to improve 📋

  • Instead of abstracting all the Hash opcodes, have a real hash and also real checksig verify
  • Add two modes, Toy mode and Real mode. Real mode works with real hashes and signatures
  • variable mapping for BitVM based script style, so compile time inference might be possible
  • script expansion with maybe intermediate cargo expand step for BitVM (no idea if this works or not)
  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft