How to send btc without wallet?

43 views
Skip to first unread message

Joseph

unread,
Dec 24, 2016, 10:41:55 PM12/24/16
to bitcoinj
Work on SPV mode.

Q1:  How to get balance when I import a new private key which have some btc?

Wallet wallet = new Wallet(params);
wallet.importKey(newKeys);

wallet.getBalance(); // always 0 btc

Q2: How to send btc without wallet?
I have a private key whiche have some btc, and how to create a transaction and broadcast?

Andreas Schildbach

unread,
Dec 25, 2016, 1:30:46 PM12/25/16
to bitc...@googlegroups.com
Sending coins without a wallet isn't really supported. You need to
import the key as you suggest, then you need to rescan the blockchain
for any payments to the key. After the scan the balance should be up to
date and you should be able to send any coins on the key.
> --
> You received this message because you are subscribed to the Google
> Groups "bitcoinj" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to bitcoinj+u...@googlegroups.com
> <mailto:bitcoinj+u...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout.


cerz

unread,
Dec 25, 2016, 8:46:32 PM12/25/16
to bitc...@googlegroups.com
But the rescan takes a long time, bitcoinj need re-download all blockchain with SPV mode..

2016-12-26 2:30 GMT+08:00 Andreas Schildbach <and...@schildbach.de>:
Sending coins without a wallet isn't really supported. You need to
import the key as you suggest, then you need to rescan the blockchain
for any payments to the key. After the scan the balance should be up to
date and you should be able to send any coins on the key.


On 12/25/2016 04:41 AM, Joseph wrote:
> Work on SPV mode.
>
> Q1:  How to get balance when I import a new private key which have some btc?
>
> Wallet wallet = new Wallet(params);
> wallet.importKey(newKeys);
>
> wallet.getBalance(); // always 0 btc
>
> Q2: How to send btc without wallet?
> I have a private key whiche have some btc, and how to create
> a transaction and broadcast?
>
> --
> You received this message because you are subscribed to the Google
> Groups "bitcoinj" group.
> To unsubscribe from this group and stop receiving emails from it, send
> For more options, visit https://groups.google.com/d/optout.


--
You received this message because you are subscribed to a topic in the Google Groups "bitcoinj" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/bitcoinj/XXIko8qNtzI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to bitcoinj+unsubscribe@googlegroups.com.

Andreas Schildbach

unread,
Dec 26, 2016, 6:33:35 AM12/26/16
to bitc...@googlegroups.com
Yes, that's how SPV works. Bitcoinj is not designed as a full node.


On 12/26/2016 02:46 AM, cerz wrote:
> But the rescan takes a long time, bitcoinj need re-download all
> blockchain with SPV mode..
>
> 2016-12-26 2:30 GMT+08:00 Andreas Schildbach <and...@schildbach.de
> <mailto:and...@schildbach.de>>:
>
> Sending coins without a wallet isn't really supported. You need to
> import the key as you suggest, then you need to rescan the blockchain
> for any payments to the key. After the scan the balance should be up to
> date and you should be able to send any coins on the key.
>
>
> On 12/25/2016 04:41 AM, Joseph wrote:
> > Work on SPV mode.
> >
> > Q1: How to get balance when I import a new private key which have some btc?
> >
> > Wallet wallet = new Wallet(params);
> > wallet.importKey(newKeys);
> >
> > wallet.getBalance(); // always 0 btc
> >
> > Q2: How to send btc without wallet?
> > I have a private key whiche have some btc, and how to create
> > a transaction and broadcast?
> >
> > --
> > You received this message because you are subscribed to the Google
> > Groups "bitcoinj" group.
> > To unsubscribe from this group and stop receiving emails from it, send
> > an email to bitcoinj+u...@googlegroups.com
> <mailto:bitcoinj%2Bunsu...@googlegroups.com>
> > <mailto:bitcoinj+u...@googlegroups.com
> <mailto:bitcoinj%2Bunsu...@googlegroups.com>>.
> > For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to a topic in
> the Google Groups "bitcoinj" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/bitcoinj/XXIko8qNtzI/unsubscribe
> <https://groups.google.com/d/topic/bitcoinj/XXIko8qNtzI/unsubscribe>.
> To unsubscribe from this group and all its topics, send an email to
> bitcoinj+u...@googlegroups.com
> <mailto:bitcoinj%2Bunsu...@googlegroups.com>.
> For more options, visit https://groups.google.com/d/optout
> <https://groups.google.com/d/optout>.
>
>
> --
> You received this message because you are subscribed to the Google
> Groups "bitcoinj" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to bitcoinj+u...@googlegroups.com
> <mailto:bitcoinj+u...@googlegroups.com>.
Reply all
Reply to author
Forward
0 new messages