Bitcoin Forum
December 13, 2019, 11:32:44 AM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Trying to send bitcoin to c-lightning. Getting "Invalid Bitcoin Address"  (Read 126 times)
jimbobway
Legendary
*
Offline Offline

Activity: 1405
Merit: 1010



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?
1576236764
Hero Member
*
Offline Offline

Posts: 1576236764

View Profile Personal Message (Offline)

Ignore
1576236764
Reply with quote  #2

1576236764
Report to moderator
1576236764
Hero Member
*
Offline Offline

Posts: 1576236764

View Profile Personal Message (Offline)

Ignore
1576236764
Reply with quote  #2

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

Posts: 1576236764

View Profile Personal Message (Offline)

Ignore
1576236764
Reply with quote  #2

1576236764
Report to moderator
1576236764
Hero Member
*
Offline Offline

Posts: 1576236764

View Profile Personal Message (Offline)

Ignore
1576236764
Reply with quote  #2

1576236764
Report to moderator
achow101
Moderator
Legendary
*
Offline Offline

Activity: 1974
Merit: 2951


bc1qshxkrpe4arppq89fpzm6c0tpdvx5cfkve2c8kl


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

You probably missed a character.

jimbobway
Legendary
*
Offline Offline

Activity: 1405
Merit: 1010



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: 1405
Merit: 1010



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: 1484
Merit: 2129


Bitcointalk's Friendly Gay Negro from Outer Space


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: 1204
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: 1484
Merit: 2129


Bitcointalk's Friendly Gay Negro from Outer Space


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: 1204
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: 1484
Merit: 2129


Bitcointalk's Friendly Gay Negro from Outer Space


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!