<p><code>decodescript</code> has this behavior because integers in Bitcoin are little endian. So <code>decodescript</code> is telling you what number the script interpreter would use when it processes your script.</p>

CC BY-SA 4.0
2020-10-26T22:31:00.840Z
2020-10-26T22:31:00.840Z
Ava Chow
<p>I want to lock a UTXO for 90 days.</p>
<p>My Binary is:</p>
<pre><code>00000000010000000011101101010011
</code></pre>
<p>And my sequence is: <code>533B40</code></p>
<p>When I decode the witness script with <code>bitcoin-cli decodescript</code> I can see <code>4209491</code>.
Where <code>4209491</code> comes from?</p>
<p><strong>UPDATE</strong></p>
<p>It's seems that the <code>533B40</code> convert into little endian and the convert into base 10</p>
<pre><code>printf 533B40 | tac -rs .. 
403B53
</code></pre>
<p>Then convert in base 2</p>
<pre><code>echo &quot;ibase=16; obase=2; 403B53&quot; | bc
10000000011101101010011
</code></pre>
<p>And then in base10</p>
<pre><code>echo &quot;ibase=2;10000000011101101010011&quot; | bc
4209491
</code></pre>
<p>why decodescript has this behaviour?</p>

<smartcontracts><hash-time-locked-contract>
Decode script return different value from my relative timelock
monkeyUser
# Decode script return different value from my relative timelock

(Asked by: username_0 on 2020-10-26)

I want to lock a UTXO for 90 days.

My Binary is:

```
00000000010000000011101101010011

```

And my sequence is: `533B40`

When I decode the witness script with `bitcoin-cli decodescript` I can see `4209491`.
Where `4209491` comes from?

**UPDATE**

It's seems that the `533B40` convert into little endian and the convert into base 10

```
printf 533B40 | tac -rs .. 
403B53

```

Then convert in base 2

```
echo "ibase=16; obase=2; 403B53" | bc
10000000011101101010011

```

And then in base10

```
echo "ibase=2;10000000011101101010011" | bc
4209491

```

why decodescript has this behaviour?

**Tags:** smartcontracts, hash-time-locked-contract


---

## 1 answers

### Answer by username_1 on 2020-10-26. Score: 2 | Accepted answer

`decodescript` has this behavior because integers in Bitcoin are little endian. So `decodescript` is telling you what number the script interpreter would use when it processes your script.


---

