Bitcoin Forum
October 21, 2018, 04:04:57 PM *
News: Make sure you are not using versions of Bitcoin Core other than 0.17.0 [Torrent], 0.16.3, 0.15.2, or 0.14.3. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Trying to send bitcoin to c-lightning. Getting "Invalid Bitcoin Address"  (Read 84 times)
jimbobway
Legendary
*
Offline Offline

Activity: 1403
Merit: 1007



View Profile
January 23, 2018, 01:00:18 AM
Merited by DannyHamilton (2)
 #1

I'm following these instructions at https://github.com/ElementsProject/lightning to open a channel:

Quote
First you need to transfer some funds to lightningd so that it can open a channel:

# Returns an address <address>
cli/lightning-cli newaddr

# Returns a transaction id <txid>
bitcoin-cli -testnet sendtoaddress <address> <amount>


Lightning gives me a new address that starts with a "2", 2xxxxxxxxxxxxxxxxxxxxxxx.

I try to send bitcoins to this address using sendtoaddress but it says:

error code: -5
error message:
Invalid Bitcoin address


What am I doing wrong?
1540137897
Hero Member
*
Offline Offline

Posts: 1540137897

View Profile Personal Message (Offline)

Ignore
1540137897
Reply with quote  #2

1540137897
Report to moderator
1540137897
Hero Member
*
Offline Offline

Posts: 1540137897

View Profile Personal Message (Offline)

Ignore
1540137897
Reply with quote  #2

1540137897
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1540137897
Hero Member
*
Offline Offline

Posts: 1540137897

View Profile Personal Message (Offline)

Ignore
1540137897
Reply with quote  #2

1540137897
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 1554
Merit: 1704


3F1Y9yquzvY6RWvKbw2n2zeo9V5mvBhADU


View Profile WWW
January 23, 2018, 01:03:06 AM
 #2

You probably missed a character.

jimbobway
Legendary
*
Offline Offline

Activity: 1403
Merit: 1007



View Profile
January 23, 2018, 01:05:55 AM
 #3

I just tripled checked my copy and paste and I did not miss any characters.  Huh
jimbobway
Legendary
*
Offline Offline

Activity: 1403
Merit: 1007



View Profile
January 23, 2018, 01:17:55 AM
Merited by DannyHamilton (2)
 #4

God dammit, I figured it out.  By default c-lightning runs on testnet.  To run on mainnet you have to use:

lightningd/lightningd --network=bitcoin

The address started with a '2' because it's a testnet address.
BobLawblaw
Legendary
*
Offline Offline

Activity: 1064
Merit: 1542


Bitcointalks Most Fabulously Gay Black Power-Top


View Profile
February 08, 2018, 11:58:01 AM
 #5

Quote
First you need to transfer some funds to lightningd so that it can open a channel:

# Returns an address <address>
cli/lightning-cli newaddr

# Returns a transaction id <txid>
bitcoin-cli sendtoaddress <address> <amount>

Related. Where are the private keys located for newaddr, and how do I see a list of addr's currently funded ? I'm running on Mainnet.

When I do bitcoin-cli listreceivedbyaddress 1 true, I'm not seeing the "newaddr" showing up in bitcoind, and can't seem to find how lightning handles its generated addresses.

Don't feel comfortable funding a newaddr with BTC until I understand the relationship between lightning-cli newaddr and bitcoind addresses.

What happens if my lnd or bitcoind crashes, for example ?

Right now, it's looking to me like I lose all the information. lightningd doesn't even remember the connections I'm previously established when I stop and re-run the daemon Sad
ncsupanda
Legendary
*
Offline Offline

Activity: 1106
Merit: 1000



View Profile
February 08, 2018, 03:53:00 PM
 #6

Quote
First you need to transfer some funds to lightningd so that it can open a channel:

# Returns an address <address>
cli/lightning-cli newaddr

# Returns a transaction id <txid>
bitcoin-cli sendtoaddress <address> <amount>
-snip-
When I do bitcoin-cli listreceivedbyaddress 1 true, I'm not seeing the "newaddr" showing up in bitcoind, and can't seem to find how lightning handles its generated addresses.
-snip-

If you haven't sent any funds to the address, then isn't listreceivedbyaddress working correctly?
BobLawblaw
Legendary
*
Offline Offline

Activity: 1064
Merit: 1542


Bitcointalks Most Fabulously Gay Black Power-Top


View Profile
February 08, 2018, 04:15:14 PM
 #7

If you haven't sent any funds to the address, then isn't listreceivedbyaddress working correctly?

Fair point. Ok, so it's properly communicating directly with bitcoind then.

In which case, my question then becomes, "How do I see a list of address that have been generated with newaddr and are under my control ?"
ncsupanda
Legendary
*
Offline Offline

Activity: 1106
Merit: 1000



View Profile
February 08, 2018, 04:31:16 PM
 #8

If you haven't sent any funds to the address, then isn't listreceivedbyaddress working correctly?

Fair point. Ok, so it's properly communicating directly with bitcoind then.

In which case, my question then becomes, "How do I see a list of address that have been generated with newaddr and are under my control ?"

Change the 1 to a 0? This would show a list of addresses in your wallet with 0 confirmations as opposed to 1.
BobLawblaw
Legendary
*
Offline Offline

Activity: 1064
Merit: 1542


Bitcointalks Most Fabulously Gay Black Power-Top


View Profile
February 08, 2018, 05:08:17 PM
 #9

Change the 1 to a 0? This would show a list of addresses in your wallet with 0 confirmations as opposed to 1.

Only shows the initial wallet.dat address, and the segwit address I created and funded.

No luck for displaying anything newaddr related Sad Hrmph. I'll try a very small 100 sat transfer later on tonight and see if that doesn't get the address showing up properly.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!