Compiler for Bitcoin Transaction Scripts

in #cryptocurrency8 years ago

txsc is a young project with the goal of making it easier to write Bitcoin transaction scripts.

<p dir="auto">Rather recently I started working on <a href="https://github.com/Kefkius/txsc" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">txsc (<strong>transaction <strong>script <strong>compiler). With it, you can write the scripts that are present in Bitcoin (and other cryptocurrency) transactions without manually writing opcodes. <h2>What? <p dir="auto">It's easiest to understand with an example. Here is a script in the language that Bitcoin nodes understand: <p dir="auto"><code>2 3 OP_ADD <p dir="auto">Here is the equivalent script in the language created for txsc: <p dir="auto"><code>2 + 3; <p dir="auto">Not very impressive, right? It gets better as you go for more complex stuff. A common script in Bitcoin transactions is the <em>Pay-to-Public-Key-Hash script, which I've made an example for <a href="https://github.com/Kefkius/txsc/blob/master/examples/p2ph-script.txscript" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">here. <h2>Features <p dir="auto">See the <a href="https://github.com/Kefkius/txsc/blob/master/doc/txscript.md" target="_blank" rel="nofollow noreferrer noopener" title="This link will take you away from hive.blog" class="external_link">documentation on TxScript, the language I'm making for txsc. In addition to that, here is some stuff I have working (mostly) on my machine but haven't pushed to Github: <ul> <li>Support for defining functions. <li>Conditional statements. <p dir="auto">I'm not sure how many developers in the cryptocurrency field have arrived here. But I haven't really talked in depth about txsc publicly until now, so I figure it's fine material for my first post. :)