<blockquote>
  <ol>
  <li>Assume I created address#1 and address#2 under same wallet. How to transfer funds? Should I open a channel to do that?</li>
  </ol>
</blockquote>

<p>You seem to confuse bitcoin addresses and lightning network ids. If you have a lightning node you have a <code>node pubkey</code> (called the <code>node_id</code>). Of course there is a corresponding private key / secret. From this you can derive bitcoin addresses in your bitcoin wallet that is attached to the lightning node. Those addresses are used to fund your node or to claim funds from channels that for some reason hit the chain. </p>

<blockquote>
  <ol start="2">
  <li>Is it possible to send funds from address in lightning network to simple bitcoin address?</li>
  </ol>
</blockquote>

<p>As from the first part of the answer. once the channels hit the chain they are in the bitcon network and can be send to any other bitcoin address. There are <code>exchange</code>-services that allow and atomic on/off-chain swap. means you pay in invoice on lightning so that onchain bitcoin arrive at some address and vice versa.</p>

<blockquote>
  <ol start="3">
  <li>Are there any ways to choose sender address (in case users created thousands different addresses and user wants to send satoshis on behalf of himself)</li>
  </ol>
</blockquote>

<p>If I understand your question correctly I would say it is possible. In the current setting people who offer a custodial wallet service seem to sign all invoices with the node ID of the lightningnode that is powering the custodial wallet. There speaks nothing against giving every user their own secrete and their own node id / bitcoin keys. You could even have virtual payment channels between the exchanges lightning network node that you maintain an run and between the "virtual" nodes of your customers which are basically private and suggest in the routing hints of the invoice to use the lightning node of your service.
In order to do these kinds of tricks you might want to switch to c-lightning as with their plugin infrastructure have an API that allow easier customization for such features.</p>

CC BY-SA 4.0
2019-08-15T10:22:35.860Z
I still dont get it:  if I want to users allow to make payments (each with their own bitcoin address) to each other, I need many LND instances running? Because if there are only lightning nodes, connected by payment channel (= 2 users in blockchain "connected" by having a 2-of-2 multisig address), then I need as many nodes as many users(=unique addresses) I have?
newbie
CC BY-SA 4.0
2019-08-16T10:02:52.033Z
When using lightning the users don't have to have a Bitcoin address lightning nodes have a different address space / scheme. You can do all of this on top of one lightning network node but then it is custodial. The power of lightning is that every user should run their own node anyway but I guess this goes against the service you might want to offer
Rene Pickhardt
CC BY-SA 4.0
2019-08-16T13:31:17.183Z
Big thanks, your answer helped me a lot! Can you clarify a bit what you meant when said "do this on top of one lightning node"?
newbie
CC BY-SA 4.0
2019-08-14T13:09:24.950Z
2019-08-14T13:09:24.950Z
Rene Pickhardt
<ol>
<li><p>Bitcoin has addresses but there is no such thing as a Lightning "address" where you send the Lightning funds. A Lightning channel is opened by sending funds to a 2-of-2 multisignature Bitcoin address. From that point onwards invoices are sent back and forth using the Lightning protocol with balances updated as users agree to pay the invoices.</p></li>
<li><p>To receive your Bitcoin onchain and effectively leave the Lightning Network you close the channel and send Bitcoin from the 2-of-2 multisignature Bitcoin address to a Bitcoin address that is solely controlled by you.</p></li>
<li><p>You can run multiple Lightning nodes and send funds from any of those nodes that can afford to transfer the funds. When the receiver requests a Lightning payment they send an invoice that can be paid by any Lightning node. There is no restriction on where those funds should come from.</p></li>
</ol>

CC BY-SA 4.0
2019-08-14T14:23:29.580Z
question #3. So that, the only way to transfer funds between addresses is to have many nodes (and each node will have own wallet)?  I probably don't understand it  good enough, but for now, it seems like waste of resources just to pay to someone once
newbie
CC BY-SA 4.0
2019-08-14T14:57:21.780Z
There are no Lightning addresses. Lightning nodes transfer funds to other Lightning nodes. There is also no global record of all Lightning transactions so there is no concern of "address reuse" or the same concerns on privacy leaks. If you want to do multiple Lightning payments you can do them from the same Lightning node without needing to spin up a new Lightning node each time.
Michael Folkson
CC BY-SA 4.0
2019-08-14T13:11:20.553Z
2019-08-14T13:11:20.553Z
Michael Folkson
<p>I want to develop Exchange where people would use my service to make payments using lightning network</p>

<p>I configured the LND node and created a wallet.</p>

<p>To implement this I would like to allow users to create addresses, and then to send money from one address to another (under same wallet)
Moreover, If they wanted to withdraw money to random simple-bitcoin address (like <em>1BzVLSNcwznjoynyuFgMXwaGeevycLgDEN</em>)</p>

<p>Therefore the very general question is: Is it possible?</p>

<p>The  questions are:</p>

<ol>
<li><p>Assume I created <strong>address#1</strong> and <strong>address#2</strong> under same wallet. How to transfer funds? Should I open a channel to do that?</p></li>
<li><p>Is it possible to send funds from address in lightning network to simple bitcoin address?</p></li>
<li><p>Are there any ways to choose sender address (in case users created thousands different addresses and user wants to send satoshis on behalf of himself)</p></li>
</ol>

CC BY-SA 4.0
2019-08-14T13:00:34.273Z
generally it makes more sense on this site to ask separate questions ins separate threats and have the question itself as the title and the text as elaboration.
Rene Pickhardt
<lightning-network><lightning-network-daemon>
A couple questions on lightning network
newbie
# A couple questions on lightning network

(Asked by: username_0 on 2019-08-14)

I want to develop Exchange where people would use my service to make payments using lightning network

I configured the LND node and created a wallet.

To implement this I would like to allow users to create addresses, and then to send money from one address to another (under same wallet)
Moreover, If they wanted to withdraw money to random simple-bitcoin address (like *1BzVLSNcwznjoynyuFgMXwaGeevycLgDEN*)

Therefore the very general question is: Is it possible?

The questions are:

1. Assume I created **address#1** and **address#2** under same wallet. How to transfer funds? Should I open a channel to do that?
2. Is it possible to send funds from address in lightning network to simple bitcoin address?
3. Are there any ways to choose sender address (in case users created thousands different addresses and user wants to send satoshis on behalf of himself)

**Tags:** lightning-network, lightning-network-daemon

> **Comments:**
> **username_1**: generally it makes more sense on this site to ask separate questions ins separate threats and have the question itself as the title and the text as elaboration.  

---

## 2 answers

### Answer by username_1 on 2019-08-14. Score: 2 | Accepted answer

> 1. Assume I created address#1 and address#2 under same wallet. How to transfer funds? Should I open a channel to do that?

You seem to confuse bitcoin addresses and lightning network ids. If you have a lightning node you have a `node pubkey` (called the `node_id`). Of course there is a corresponding private key / secret. From this you can derive bitcoin addresses in your bitcoin wallet that is attached to the lightning node. Those addresses are used to fund your node or to claim funds from channels that for some reason hit the chain.

> 2. Is it possible to send funds from address in lightning network to simple bitcoin address?

As from the first part of the answer. once the channels hit the chain they are in the bitcon network and can be send to any other bitcoin address. There are `exchange`-services that allow and atomic on/off-chain swap. means you pay in invoice on lightning so that onchain bitcoin arrive at some address and vice versa.

> 3. Are there any ways to choose sender address (in case users created thousands different addresses and user wants to send satoshis on behalf of himself)

If I understand your question correctly I would say it is possible. In the current setting people who offer a custodial wallet service seem to sign all invoices with the node ID of the lightningnode that is powering the custodial wallet. There speaks nothing against giving every user their own secrete and their own node id / bitcoin keys. You could even have virtual payment channels between the exchanges lightning network node that you maintain an run and between the "virtual" nodes of your customers which are basically private and suggest in the routing hints of the invoice to use the lightning node of your service.
In order to do these kinds of tricks you might want to switch to c-lightning as with their plugin infrastructure have an API that allow easier customization for such features.

> **Comments:**
> **username_0**: I still dont get it:  if I want to users allow to make payments (each with their own bitcoin address) to each other, I need many LND instances running? Because if there are only lightning nodes, connected by payment channel (= 2 users in blockchain "connected" by having a 2-of-2 multisig address), then I need as many nodes as many users(=unique addresses) I have?  
> **username_1**: When using lightning the users don't have to have a Bitcoin address lightning nodes have a different address space / scheme. You can do all of this on top of one lightning network node but then it is custodial. The power of lightning is that every user should run their own node anyway but I guess this goes against the service you might want to offer  
> **username_0**: Big thanks, your answer helped me a lot! Can you clarify a bit what you meant when said "do this on top of one lightning node"?  

---

### Answer by username_2 on 2019-08-14. Score: 1

1. Bitcoin has addresses but there is no such thing as a Lightning "address" where you send the Lightning funds. A Lightning channel is opened by sending funds to a 2-of-2 multisignature Bitcoin address. From that point onwards invoices are sent back and forth using the Lightning protocol with balances updated as users agree to pay the invoices.
2. To receive your Bitcoin onchain and effectively leave the Lightning Network you close the channel and send Bitcoin from the 2-of-2 multisignature Bitcoin address to a Bitcoin address that is solely controlled by you.
3. You can run multiple Lightning nodes and send funds from any of those nodes that can afford to transfer the funds. When the receiver requests a Lightning payment they send an invoice that can be paid by any Lightning node. There is no restriction on where those funds should come from.

> **Comments:**
> **username_0**: question #3. So that, the only way to transfer funds between addresses is to have many nodes (and each node will have own wallet)?  I probably don't understand it  good enough, but for now, it seems like waste of resources just to pay to someone once  
> **username_2**: There are no Lightning addresses. Lightning nodes transfer funds to other Lightning nodes. There is also no global record of all Lightning transactions so there is no concern of "address reuse" or the same concerns on privacy leaks. If you want to do multiple Lightning payments you can do them from the same Lightning node without needing to spin up a new Lightning node each time.  

---

