Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: btcusr on July 22, 2013, 05:42:59 AM



Title: puzzle; receive btc and make it spend-able only from different address
Post by: btcusr on July 22, 2013, 05:42:59 AM
How to do this?

I'd like to receive BTC to address1, forbid to spend from the corresponding key, and spend it using address2-private key. I'll be using address2 key pair only once, and for another transaction I want to use new address3 key pair, and so on..

I've asked this question before few months back, but this time I've just rephrased the same question.


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: DeathAndTaxes on July 22, 2013, 05:50:40 AM
It is not possible.


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: CIYAM on July 22, 2013, 05:51:59 AM
A UTXO (unspent transaction output) is what you "receive" when you are sent BTC. It is intrinsically *tied* to the address it was sent from and can only be spent by signing a tx that includes this UTXO.

So if you had an equivalent amount of BTC in some other UTXO(s) then you could spend that (using the Coin Control patch) but if you never want to sign a tx with the original UTXO then you simply cannot spend it.

Perhaps you want to look into mixing?


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: Foxpup on July 22, 2013, 06:01:40 AM
I'd like to lock a dollar bill in box 1, forbid unlocking and opening the box, and spend it by opening box 2...

What you're asking is equally impossible for the same reason. You can't spend coins from any address other than the one that received them, and you can't move coins from one address to another without spending them using the first address's private key. That's the core fundamental of how Bitcoin transactions work.


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: btcusr on July 22, 2013, 08:20:08 AM
It is not possible.

:(


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: Anduck on July 22, 2013, 08:23:50 AM
Could it be doable with multi-sign addresses?


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: btcusr on July 22, 2013, 08:25:51 AM
A UTXO (unspent transaction output) is what you "receive" when you are sent BTC. It is intrinsically *tied* to the address it was sent from and can only be spent by signing a tx that includes this UTXO.

So if you had an equivalent amount of BTC in some other UTXO(s) then you could spend that (using the Coin Control patch) but if you never want to sign a tx with the original UTXO then you simply cannot spend it.

Perhaps you want to look into mixing?


I don't want to hide my identity, and in fact I want to make it visible to everyone. So, mixing is not a solution.

May be what I'm asking is technically impossible now.

I just want to use single address forever, and spend using different keys every time. I can specify next-key with the current transaction, every time.


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: btcusr on July 22, 2013, 08:30:35 AM
Could it be doable with multi-sign addresses?

Yes, with 1-of-2 multi sign address.

But, every time this multi sign address also changes.. :(


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: Foxpup on July 22, 2013, 09:38:18 AM
I just want to use single address forever, and spend using different keys every time.
You can do this with a 1-of-n multisig address, though I can't imagine why you would want to. What exactly do you hope to achieve?

I can specify next-key with the current transaction, every time.
This is how change (https://en.bitcoin.it/wiki/Change) works normally. Though obviously if you want to spend your change with a different key or set of keys, it has to be sent to a different address. If you send change to the original address, or more coins are subsequently sent to your original address, they can only be spent with the same key you used originally (or any one of the original keys, if it is a 1-of-n address). That's inherent to the very definition of an address: an address specifies which key or keys may be used to spend coins sent to that address. Different key(s) == different address.


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: Abdussamad on July 22, 2013, 10:23:48 AM
What are you trying to achieve? Maybe if you told us your aim we could tell you how to do it.


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: btcusr on July 22, 2013, 10:35:38 AM
What are you trying to achieve? Maybe if you told us your aim we could tell you how to do it.

My aim is,

1. Use same address every time, a1
2. a1-primary-key can not be used to spend the funds from a1
3. I want to use new key every time to sign future trxns

Basically, a1 is just a dummy / constant address and fund from this address is controlled by another address..


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: DeathAndTaxes on July 22, 2013, 10:45:43 AM
I just want to use single address forever, and spend using different keys every time.
You can do this with a 1-of-n multisig address, though I can't imagine why you would want to. What exactly do you hope to achieve?

This.  "Forever" is impossible. but you could make n large.

1) Create a multi-sig script with n (say 100) addresses.
2) Create a P2SH address from the hash of the script.
3) Coins send to the P2SH address can be spent by any one of the 100 addressess.

Scripts need to be deterministic and independent of other executions of the script so the script can't enforce that you use each address only once however you could choose to only use each address only once.

You can't update the addresses.  Adding or changing the set of addresses would result in a new script hash and thus new P2SH address.

However I have a feeling we are dealing with an x-y problem here
http://mywiki.wooledge.org/XyProblem


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: Abdussamad on July 22, 2013, 10:53:23 AM
I think foxpup gets you the closest but here are my suggestions.

If you want to forward bitcoins sent to an address automatically to another address you can do that with blockchain.info receive api:

http://blockchain.info/api/api_receive

Another thing you might want to look at is the scripting language built into the bitcoin protocol:

Script: https://en.bitcoin.it/wiki/Script
Examples: https://en.bitcoin.it/wiki/Contracts


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: Foxpup on July 22, 2013, 11:40:52 AM
My aim is,

1. Use same address every time, a1
2. a1-primary-key can not be used to spend the funds from a1
3. I want to use new key every time to sign future trxns

Basically, a1 is just a dummy / constant address and fund from this address is controlled by another address..
Impossible by definition. As I explained earlier, an address specifies what key(s) can be used to spend coins sent to that address. By definition, if a key cannot be used to spend coins sent to a particular address, then that key is not (and never can be) related to the address in any way. If a particular key is one of the keys associated with an address, then it is (and always will be) able to spend coins sent to that address. That's how the key-address relationship works. It is also not possible for one address to "control" another (whatever that means).

If you want to require that a different key be used for every transaction (and you still haven't explained why you want to do this), you must create a new address for every time you get paid, and tell your payers to only send coins to your newest address and not re-use your old addresses. (This is the recommended method of using Bitcoin, as it allows you to label each address with the reason you expect to be paid there, so you can more easily tell who is paying you for what.)


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: btcusr on July 22, 2013, 02:49:26 PM
I just want to use single address forever, and spend using different keys every time.
You can do this with a 1-of-n multisig address, though I can't imagine why you would want to. What exactly do you hope to achieve?

This.  "Forever" is impossible. but you could make n large.

1) Create a multi-sig script with n (say 100) addresses.
2) Create a P2SH address from the hash of the script.
3) Coins send to the P2SH address can be spent by any one of the 100 addressess.

Scripts need to be deterministic and independent of other executions of the script so the script can't enforce that you use each address only once however you could choose to only use each address only once.

You can't update the addresses.  Adding or changing the set of addresses would result in a new script hash and thus new P2SH address.

closer, yet few things impossible as you said. :)


Title: Re: puzzle; receive btc and make it spend-able only from different address
Post by: marjamrob on July 23, 2013, 03:18:25 PM
I just want to use single address forever, and spend using different keys every time.
You can do this with a 1-of-n multisig address, though I can't imagine why you would want to. What exactly do you hope to achieve?

This.  "Forever" is impossible. but you could make n large.

1) Create a multi-sig script with n (say 100) addresses.
2) Create a P2SH address from the hash of the script.
3) Coins send to the P2SH address can be spent by any one of the 100 addressess.

Scripts need to be deterministic and independent of other executions of the script so the script can't enforce that you use each address only once however you could choose to only use each address only once.

You can't update the addresses.  Adding or changing the set of addresses would result in a new script hash and thus new P2SH address.

closer, yet few things impossible as you said. :)
If you just want to send from a different address, simply send your BTC from constant address to a temporary one.