<p>In Ripple, bridges often encode a Bitcoin address as an InvoiceID in a transaction. According to <a href="https://ripple.com/wiki/Services_API#Payments" rel="nofollow">Services API wiki page</a>, InvoiceID is represented as UInt256, so it should be padded. Which is the standard way of padding the InvoiceID?</p>

<p>For example, having an address in hex form - <code>00010966776006953D5567439E5E39F86A0D273BEED61967F6</code></p>

<ul>
<li><p>According to <a href="https://gist.github.com/justmoon/5886477" rel="nofollow">this code</a>, the address should be padded on the right, like <code>00010966776006953D5567439E5E39F86A0D273BEED61967F60000000000000000000000</code></p></li>
<li><p>If one submits a transaction to rippled without the padding, it gets padded on the left, like <code>000000000000000000000000010966776006953D5567439E5E39F86A0D273BEED61967F6</code></p></li>
</ul>

CC BY-SA 3.0
2013-11-06T14:34:03.397Z
Note that although the wiki (probably outdated) says that the InvoiceID is an encoded Bitcoin address, a more recent [post](https://ripple.com/forum/viewtopic.php?f=1&t=4059&p=21309&hilit=InvoiceID#p21309) by the an RL employee states that the InvoiceID is whatever the bridge provider sets it to. I.e. they can use whatever encoding or internal identifier they wish.
dchapes
CC BY-SA 3.0
2013-11-07T01:36:49.810Z
The standard implementation is [available on github](https://gist.github.com/justmoon/5886477) and this is what Bitstamp currently uses, but in principle a bridge can use any scheme they wish.
David Schwartz
<transactions><ripple><address><ripple-gateways>
What is the standard InvoiceID for a Ripple Bitcoin bridge?
ThePiachu
# What is the standard InvoiceID for a Ripple Bitcoin bridge?

(Asked by: username_0 on 2013-11-06)

In Ripple, bridges often encode a Bitcoin address as an InvoiceID in a transaction. According to [Services API wiki page](https://ripple.com/wiki/Services_API#Payments), InvoiceID is represented as UInt256, so it should be padded. Which is the standard way of padding the InvoiceID?

For example, having an address in hex form - `00010966776006953D5567439E5E39F86A0D273BEED61967F6`

* According to [this code](https://gist.github.com/justmoon/5886477), the address should be padded on the right, like `00010966776006953D5567439E5E39F86A0D273BEED61967F60000000000000000000000`
* If one submits a transaction to rippled without the padding, it gets padded on the left, like `000000000000000000000000010966776006953D5567439E5E39F86A0D273BEED61967F6`

**Tags:** transactions, ripple, address, ripple-gateways

> **Comments:**
> **username_1**: Note that although the wiki (probably outdated) says that the InvoiceID is an encoded Bitcoin address, a more recent [post](https://ripple.com/forum/viewtopic.php?f=1&t=4059&p=21309&hilit=InvoiceID#p21309) by the an RL employee states that the InvoiceID is whatever the bridge provider sets it to. I.e. they can use whatever encoding or internal identifier they wish.  
> **username_2**: The standard implementation is [available on github](https://gist.github.com/justmoon/5886477) and this is what Bitstamp currently uses, but in principle a bridge can use any scheme they wish.  

---

## 0 answers

