How to create off-chain transaction, the one that exchanges uses. I know that exchanges just update their databases when transaction between customers occur. But how this affect blockchain? How to build such kind of transaction and I am not asking about lighting network because I already have lighting network node and that's not what I am searching for. What tools to use for crafting off-chain transaction? Can someone guide me how to create it?
2 Answers
I know that exchanges just update their databases when transaction between customers occur.But how this affect blockchain?
It has no effect on the Bitcoin blockchain. None.
At midnight on Monday, John asks the exchange to transfer ₿3 to Mary. Both are customers of the same exchange.
Here's how that changes the spreadsheet in the laptop of rich Eddy, the exchange owner:
Day | I owe John | I owe Mary |
---|---|---|
Monday | ₿10 | ₿10 |
Tuesday | ₿7 | ₿13 |
Heres how that affects the blockchain²
Day | John has¹ | Mary has¹ | Eddy has¹ |
---|---|---|---|
Monday | 0 | 0 | ₿100 |
Tuesday | 0 | 0 | ₿100 |
Note that the number in Eddy's column could as easily be 0. Eddy might have long ago spent it all.
When you give money to a trusted third party, such as an exchange, you give them control of that money
The Bitcoin blockchain records changes in control of money. The Blockchain does not record debts
When an exchange deletes their IOU to John and creates an IOU to Mary, there is no change in control over Bitcoin money. It is still the exchange in control.
Remember, Bitcoin was invented so that one party could pay a second party without involving any trusted third party. There's no good reason to hold money in an exchange unless you are some kind of day trader.
How to create off chain transaction the one that exchanges uses.
Use whatever methods your particular exchange provides. Every exchange is different. Ask them. Maybe they have an API, maybe not.
¹ control over. ² in the UTXO set derived from it - if you know the public keys etc of each.
Some exchanges enable their customers to send funds to each other by using an email address. The recipient then receives an email informing them of the pending payment offer. The recipient must log in (or create an account) to accept the transfer, at which point the exchange updates their accounting. This does not case any on-chain transaction, the funds are still in custody of the exchange. These sort of service features generally only work among customers of the same exchange, and not all exchanges offer it.
If you cannot find any such feature on the exchange you are using, you should contact the exchange’s customer service to inquire whether it is available and how to use it.
Most exchanges only permit withdrawing to yourself for KYC/AML reasons. If an exchange offers payments to others directly from your account, they may offer on-chain or Lightning as payment methods. Possibly some exchanges might use Liquid. I’m not aware of any exchanges facilitating off-chain payments to customers of other exchanges that are completely off-chain and not settled in some other blockchain based token or via Lightning.