<p>I guess I found an answer:</p>

<pre><code>script = Bitcoin::Script.new([hash].pack('H*'))
</code></pre>

CC BY-SA 4.0
2019-04-10T14:16:24.403Z
2019-04-10T14:16:24.403Z
yegor256
<p>I have a script and it looks like this: <code>76a914af7a4a30243f2301e6a14a4979ae099d52f560d488ac</code>. How can I create an instance of class <code>Bitcoin::Script</code> from <a href="https://github.com/lian/bitcoin-ruby/issues/291" rel="nofollow noreferrer">ruby-bitcoin</a>? It has to be parsed, I believe, but how? I posted a GitHub <a href="https://github.com/lian/bitcoin-ruby/issues/291" rel="nofollow noreferrer">ticket</a> too.</p>

<ruby>
How to convert Script hash into opcodes, in Ruby?
yegor256
# How to convert Script hash into opcodes, in Ruby?

(Asked by: username_0 on 2019-04-10)

I have a script and it looks like this: `76a914af7a4a30243f2301e6a14a4979ae099d52f560d488ac`. How can I create an instance of class `Bitcoin::Script` from [ruby-bitcoin](https://github.com/lian/bitcoin-ruby/issues/291)? It has to be parsed, I believe, but how? I posted a GitHub [ticket](https://github.com/lian/bitcoin-ruby/issues/291) too.

**Tags:** ruby


---

## 1 answers

### Answer by username_0 on 2019-04-10. Score: 1

I guess I found an answer:

```
script = Bitcoin::Script.new([hash].pack('H*'))

```


---

