<p>From an exchange's perspective, the best option would be to write mostly your own software. From a technical perspective, an exchange only has to fulfill the following in order to be accepting a crypto-currency:</p>
<ul>
<li>Must allow deposits of Bitcoin or coin the exchange claims to accept.</li>
<li>Must allow withdraws of Bitcoin or coin the exchange claims to accept.</li>
</ul>
<p>Normally <code>bitcoind</code> or the altcoin variant of it, <code>litecoind</code>, <code>dogecoind</code>, etc., take care of both for a user of a crypto-currency. But an exchange has special demands. Here are some issues I can think of that may happen to an exchange if they used the core client.</p>
<ul>
<li>Core clients are not designed to work in a multiple server environments, something vital for large exchanges.</li>
<li>Private keys and corresponding addresses need to be stored under special conditions. An exchange may want add a username along with an address or even reuse addresses for efficiency.</li>
<li>Core clients aren't exactly lightweight. An exchange doesn't need a lot of features commonly packaged together with a core client. As an example, accounts; it's purely for organizing money cosmetically, something exchanges don't need.</li>
<li>Core clients don't allow for more intricate control of transactions or other components, <a href="https://en.bitcoin.it/wiki/SatoshiDice" rel="nofollow noreferrer">SatoshiDice</a> is impossible to create using <code>bitcoind</code> because it require manipulation of transaction inputs to create sends, something you can't currently do with <code>bitcoind</code>.</li>
</ul>
<p><strong>So what should an exchange be doing?</strong></p>
<p>Using a combination of the two, or even ditching the core client. There are many programming libraries that simplify all aspects of Bitcoin technology, <a href="http://libbitcoin.dyne.org/doc/" rel="nofollow noreferrer">libbitcoin</a> is a C++ library that allows you to make a partial or full node in no time. SatoshiDice is constructed on <a href="https://code.google.com/p/bitcoinj/" rel="nofollow noreferrer">BitcoinJ</a>, a popular Java library for Bitcoin. There are also many libraries available for other languages, but the point is that building a node isn't too hard.</p>
<p>I recommend a hybrid use because <code>bitcoind</code> is a lot more safe and bug-free than your own code. You can accidentally create code that creates invalid transactions or even accidentally send coins to the wrong address. I'd use a library and my favorite language to detect deposits and accredit them to accounts, and then push raw transactions to a <code>bitcoind</code> instance running on my own or possibly the same server where it will validate it and take care of sending it other nodes in the network. Less space to mess up in code.</p>
<p>For altcoins, you'd need an instance running or just doing small modifications to the code to differentiate. There isn't a huge difference between the protocols all the crypto-currencies use. You should know anyways if you're planning to accept a coin as an exchange.</p>
<p><strong>TL;DR</strong></p>
<p>Exchanges should be using software they wrote themselves. This isn't hard to do as there are many libraries available that give you nitty-gritty access to Bitcoin. Core clients <em>can</em> be a bottleneck at times <strong>but</strong> can be used in conjunction to avoid said bottlenecks while maintaining a safety net for an exchange and can even simplify certain parts.</p>

CC BY-SA 3.0
2014-03-25T03:33:37.113Z
Thanks for the answer, but this all sounds like speculation.
Stephen Melvin
CC BY-SA 3.0
2014-03-25T03:40:05.193Z
That's true it is an educated guess on what they should be doing. No exchange has detailed how their wallets works precisely but the approach I've explained is really efficient and likely. For all we know they can be using bad implementations like Mt. Gox supposedly did. Hard to prove.
John T
CC BY-SA 3.0
2014-03-25T17:53:09.630Z
Fair enough, although not an exact answer it's still good information. I read on reddit that a common approach is to interact with the daemons with the json (rpc?) interface. I'm wondering if that is a good solution up until a certain volume of transactions.
Stephen Melvin
CC BY-SA 4.0
2014-03-25T03:29:46.730Z
2022-03-14T13:48:02.390Z
2022-03-14T13:48:02.390Z
John T
<p>I don't think exchanges are actually managing wallets for you, for two reasons:</p>

<ol>
<li><p>For many cryptocoins, it takes time to transfer funds into a wallet. But when you purchase a certain cryptocoin on an exchange, it immediately ends up in your 'wallet'.</p></li>
<li><p>AntShares do not support fractions. You can only own whole units of them in a wallet. When you purchase AntShares on an exchange, you can purchase them in fractions and they will sit in your 'wallet' in fractions. It's not until you transfer them to your own wallet (no quotes) that the decimals will be truncated and you are left with whole units.</p></li>
</ol>

<p>My conclusion is that exchanges merely keep records of what you own. These records may be viewed as IOUs. When you withdraw, they will tap into their own wallets.</p>

<p>I don't see how else it could work.</p>

CC BY-SA 3.0
2017-06-25T06:46:02.653Z
You're right concerning balance changes within the exchange, but when the exchanges perform withdrawals these obviously must happen on the blockchains. What do you think do they use to create transactions on various blockchains?
Murch
CC BY-SA 4.0
2022-03-14T12:34:03.643Z
Also when withdrawing, how they send money from "your exchange address" -> "your withdrawal address" instantly? Because they don't keep it in "your exchange address", and if you withdraw money, you can see that transaction starts from "your exchange address". If exchange first transfers money from "their hot wallet" -> "your exchange address", that would add delay+fee, i don't see such delays?
cc @Murch
Jemshit
CC BY-SA 4.0
2022-03-14T12:44:00.460Z
I think they don't send back your money (when withdrawin) from "your exchange address", but from "their hot wallet": https://support.kraken.com/hc/en-us/articles/115006441267-Differences-between-a-crypto-exchange-and-a-crypto-wallet-service
Jemshit
CC BY-SA 4.0
2022-03-14T13:49:46.157Z
Right, if they first staged the withdrawal in a specific address and then sent it to you, they'd just do two payments when one would suffice.
Murch
CC BY-SA 3.0
2017-06-24T11:26:00.537Z
2017-06-24T11:26:00.537Z
Jay
<p>Do they write wrappers around <code>bitcoind</code> or is there a better solution out there? Some exchanges handle dozens of digital currencies, does this mean they are running <code>bitcoind</code>, <code>litecoind</code>, <code>dogecoind</code>, etc concurrently?</p>

<wallet><exchanges>
What software do exchanges use to manage wallets?
Stephen Melvin
# What software do exchanges use to manage wallets?

(Asked by: username_0 on 2014-03-24)

Do they write wrappers around `bitcoind` or is there a better solution out there? Some exchanges handle dozens of digital currencies, does this mean they are running `bitcoind`, `litecoind`, `dogecoind`, etc concurrently?

**Tags:** wallet, exchanges


---

## 2 answers

### Answer by username_1 on 2014-03-25. Score: 1 | Accepted answer

From an exchange's perspective, the best option would be to write mostly your own software. From a technical perspective, an exchange only has to fulfill the following in order to be accepting a crypto-currency:

* Must allow deposits of Bitcoin or coin the exchange claims to accept.
* Must allow withdraws of Bitcoin or coin the exchange claims to accept.

Normally `bitcoind` or the altcoin variant of it, `litecoind`, `dogecoind`, etc., take care of both for a user of a crypto-currency. But an exchange has special demands. Here are some issues I can think of that may happen to an exchange if they used the core client.

* Core clients are not designed to work in a multiple server environments, something vital for large exchanges.
* Private keys and corresponding addresses need to be stored under special conditions. An exchange may want add a username along with an address or even reuse addresses for efficiency.
* Core clients aren't exactly lightweight. An exchange doesn't need a lot of features commonly packaged together with a core client. As an example, accounts; it's purely for organizing money cosmetically, something exchanges don't need.
* Core clients don't allow for more intricate control of transactions or other components, [SatoshiDice](https://en.bitcoin.it/wiki/SatoshiDice) is impossible to create using `bitcoind` because it require manipulation of transaction inputs to create sends, something you can't currently do with `bitcoind`.

**So what should an exchange be doing?**

Using a combination of the two, or even ditching the core client. There are many programming libraries that simplify all aspects of Bitcoin technology, [libbitcoin](http://libbitcoin.dyne.org/doc/) is a C++ library that allows you to make a partial or full node in no time. SatoshiDice is constructed on [BitcoinJ](https://code.google.com/p/bitcoinj/), a popular Java library for Bitcoin. There are also many libraries available for other languages, but the point is that building a node isn't too hard.

I recommend a hybrid use because `bitcoind` is a lot more safe and bug-free than your own code. You can accidentally create code that creates invalid transactions or even accidentally send coins to the wrong address. I'd use a library and my favorite language to detect deposits and accredit them to accounts, and then push raw transactions to a `bitcoind` instance running on my own or possibly the same server where it will validate it and take care of sending it other nodes in the network. Less space to mess up in code.

For altcoins, you'd need an instance running or just doing small modifications to the code to differentiate. There isn't a huge difference between the protocols all the crypto-currencies use. You should know anyways if you're planning to accept a coin as an exchange.

**TL;DR**

Exchanges should be using software they wrote themselves. This isn't hard to do as there are many libraries available that give you nitty-gritty access to Bitcoin. Core clients *can* be a bottleneck at times **but** can be used in conjunction to avoid said bottlenecks while maintaining a safety net for an exchange and can even simplify certain parts.

> **Comments:**
> **username_0**: Thanks for the answer, but this all sounds like speculation.  
> **username_1**: That's true it is an educated guess on what they should be doing. No exchange has detailed how their wallets works precisely but the approach I've explained is really efficient and likely. For all we know they can be using bad implementations like Mt. Gox supposedly did. Hard to prove.  
> **username_0**: Fair enough, although not an exact answer it's still good information. I read on reddit that a common approach is to interact with the daemons with the json (rpc?) interface. I'm wondering if that is a good solution up until a certain volume of transactions.  

---

### Answer by username_2 on 2017-06-24. Score: 0

I don't think exchanges are actually managing wallets for you, for two reasons:

1. For many cryptocoins, it takes time to transfer funds into a wallet. But when you purchase a certain cryptocoin on an exchange, it immediately ends up in your 'wallet'.
2. AntShares do not support fractions. You can only own whole units of them in a wallet. When you purchase AntShares on an exchange, you can purchase them in fractions and they will sit in your 'wallet' in fractions. It's not until you transfer them to your own wallet (no quotes) that the decimals will be truncated and you are left with whole units.

My conclusion is that exchanges merely keep records of what you own. These records may be viewed as IOUs. When you withdraw, they will tap into their own wallets.

I don't see how else it could work.

> **Comments:**
> **username_3**: You're right concerning balance changes within the exchange, but when the exchanges perform withdrawals these obviously must happen on the blockchains. What do you think do they use to create transactions on various blockchains?  
> **username_4**: Also when withdrawing, how they send money from "your exchange address" -> "your withdrawal address" instantly? Because they don't keep it in "your exchange address", and if you withdraw money, you can see that transaction starts from "your exchange address". If exchange first transfers money from "their hot wallet" -> "your exchange address", that would add delay+fee, i don't see such delays? cc @username_3  
> **username_4**: I think they don't send back your money (when withdrawin) from "your exchange address", but from "their hot wallet": https://support.kraken.com/hc/en-us/articles/115006441267-Differences-between-a-crypto-exchange-and-a-crypto-wallet-service  
> **username_3**: Right, if they first staged the withdrawal in a specific address and then sent it to you, they'd just do two payments when one would suffice.  

---

