Bitcoin Forum
May 05, 2024, 10:05:34 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Help me understand pkey + “spending twice”  (Read 137 times)
glascake (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 30


View Profile
September 02, 2021, 10:46:15 PM
Merited by vapourminer (1), ABCbits (1), PrimeNumber7 (1)
 #1

Just to clarify:
I will refer to an address as pKey.

I have this scenario:

Bob sends money to Tim
txIn ——txOut
pKey1->pKey2
0.5———>0.5
Now Tim sends his cash to Hannah
txIn ——txOut
pKey2->pKey3
0.5———>0.5

But Tim receives again money from Bob (to the same address)
txIn ——txOut
pKey4->pKey2
0.5———>0.5
Can he now spend 0.5 btc with pKey2 as input?




Second question more important one. (That’s the reason I’m asking the first one, so I can understand better)
Let’s say I have a address, on this address I received 0.1 btc daily.
Now I am using electrums sweep to transfer the funds to my real wallet. Will I be able to do indefinitely, meaning keep receiving 0.1btc/day on this one address and then using electrums sweep to transfer the funds once a week to my wallet?




1714903534
Hero Member
*
Offline Offline

Posts: 1714903534

View Profile Personal Message (Offline)

Ignore
1714903534
Reply with quote  #2

1714903534
Report to moderator
1714903534
Hero Member
*
Offline Offline

Posts: 1714903534

View Profile Personal Message (Offline)

Ignore
1714903534
Reply with quote  #2

1714903534
Report to moderator
According to NIST and ECRYPT II, the cryptographic algorithms used in Bitcoin are expected to be strong until at least 2030. (After that, it will not be too difficult to transition to different algorithms.)
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714903534
Hero Member
*
Offline Offline

Posts: 1714903534

View Profile Personal Message (Offline)

Ignore
1714903534
Reply with quote  #2

1714903534
Report to moderator
1714903534
Hero Member
*
Offline Offline

Posts: 1714903534

View Profile Personal Message (Offline)

Ignore
1714903534
Reply with quote  #2

1714903534
Report to moderator
1714903534
Hero Member
*
Offline Offline

Posts: 1714903534

View Profile Personal Message (Offline)

Ignore
1714903534
Reply with quote  #2

1714903534
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6581


Just writing some code


View Profile WWW
September 02, 2021, 10:58:35 PM
Merited by vapourminer (1), ABCbits (1), PrimeNumber7 (1), BlackHatCoiner (1), glascake (1)
 #2

Yes, to both. Addresses do not expire. There is no consensus rule that prevents address reuse. It is only recommended to not reuse addresses for privacy reasons.

glascake (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 30


View Profile
September 02, 2021, 11:18:04 PM
 #3

Thank you for the clarification:)
PrimeNumber7
Copper Member
Legendary
*
Offline Offline

Activity: 1624
Merit: 1899

Amazon Prime Member #7


View Profile
September 03, 2021, 04:44:54 AM
 #4

When you receive bitcoin to an address/public key, in order to spend that bitcoin, you need to use a private key associated with that specific address to spend that specific output. When you sign a transaction that spends your bitcoin, you are signing that you are spending a specific output to a specific transaction.

For example, if you receive a transaction to address bc1abc123...3 that is the 3rd output to txid 34def...45, you must use the private key associated bc1abc123...3 that signs that you are spending the 3rd output to txid 34def...45.
glascake (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 30


View Profile
September 03, 2021, 09:23:19 AM
 #5

When you receive bitcoin to an address/public key, in order to spend that bitcoin, you need to use a private key associated with that specific address to spend that specific output. When you sign a transaction that spends your bitcoin, you are signing that you are spending a specific output to a specific transaction.

For example, if you receive a transaction to address bc1abc123...3 that is the 3rd output to txid 34def...45, you must use the private key associated bc1abc123...3 that signs that you are spending the 3rd output to txid 34def...45.

Thanks for explaining the obvious, but that was not the question. Cheesy
The question was refering to receiving on a address (public+private key pair) which already has been used as output.
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3214



View Profile
September 08, 2021, 12:56:38 PM
 #6

Now I am using electrums sweep to transfer the funds to my real wallet. Will I be able to do indefinitely, meaning keep receiving 0.1btc/day on this one address and then using electrums sweep to transfer the funds once a week to my wallet?

Rather than "sweeping" the private key periodically, it would probably be more convenient to create another electrum wallet using that private key.

1. Select "Create new wallet" or "New/Restore".
2. Name the new wallet.
3. Select "Import Bitcoin addresses or private keys".

Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
glascake (OP)
Newbie
*
Offline Offline

Activity: 26
Merit: 30


View Profile
September 09, 2021, 03:19:50 PM
 #7

Rather than "sweeping" the private key periodically, it would probably be more convenient to create another electrum wallet using that private key.
1. Select "Create new wallet" or "New/Restore".
2. Name the new wallet.
3. Select "Import Bitcoin addresses or private keys".

thats a good idea, but if i want to send the bitcoin i still would have to pay the "high" transactoin fee
odolvlobo
Legendary
*
Offline Offline

Activity: 4298
Merit: 3214



View Profile
September 09, 2021, 05:29:31 PM
Merited by ABCbits (1), PrimeNumber7 (1), glascake (1)
 #8

Rather than "sweeping" the private key periodically, it would probably be more convenient to create another electrum wallet using that private key.
1. Select "Create new wallet" or "New/Restore".
2. Name the new wallet.
3. Select "Import Bitcoin addresses or private keys".

thats a good idea, but if i want to send the bitcoin i still would have to pay the "high" transactoin fee

It's potentially one less fee:

Code:
imported private key wallet ⟶ payee

instead of

Code:
private key ⟶ wallet ⟶ payee


Join an anti-signature campaign: Click ignore on the members of signature campaigns.
PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!