Thanks for the input, I have a few questions. Hopefully you can clarify a few things for me.
...indeed the risk is that somebody finney attacks you. You can reduce the risk by requiring both parties to sign for the output
I'm not sure I understand how this would work, but could the sender still just release a new version of the payment?
Sender addy A ---> Receiver addy B (maybe with a locktime, or unsigned output)
Both the sender and receiver have to sign it before it is added to the blockchain. So the sender can just refuse to sign the transaction until they want the coins to be spendable, but this requires the sender to be alive/remember his keys/sign the transaction at the time he wants it to be spendable.
Plus couldn't he just refuse to sign the transaction and keep the coins?
In my example #2 I was going for a way that the sender "fires and forgets" a transaction with coins, and no matter what the receiver will have those coins available to him, after some amount of time.
but there isn't really a good way to do what you want short of a hard forking rule change. And I don't see any use cases that would justify that.
We wouldn't have to take over the nLockTime parameter and change its meaning from today. Could we just come up with a new parameter scrubadubLockTime (or whatever) that is treated differently and would work for case #2. Would this prevent a hard fork?
Again I would suggest that the transaction is added to a block immediately, but the receiver can not spend those coins until the scrubadubLockTime expires, so the parent transaction would have to be checked when the receiver tries to spend them. And there is nothing the sender can do to get the coins back since they are in the blockchain.
you can get the behavior of #2 by using a chain of transactions. No need for a hard fork.
1. Create a transaction Tx1 that spends the amount to an output requiring two pubkeys (sender and receiver). Broadcast.
2. Create a transaction Tx2 that spends the output of Tx1 to an address controlled by the receiver. Add preferred nLockTime, and set the sequence number to < UINT_MAX to not make it final. Sign and send to the receiver.
The receiver waits until Tx1 is in a block, and so the possibility of a Finney attack is gone. The sender has no control over the coins anymore. The coins are spendable to the receiver after nLockTime by first broadcasting Tx2.
A similar one to this and other fun constructs can be found in the article Contracts on the wiki
Who controls the address that Tx1 is being sent to? An escrow service of some kind or the sender, or is it just some dead address that no one is supposed to have access to (how can you know that someone doesnt control the private keys)?
Ok so after Tx1 is sent, both parties sign the transaction and it goes into a block. Like you say the sender (and receiver?) dont have control over the coins at this point.
Who creates this Tx2? wouldn't they have to know the private keys of the output from Tx1? So whoever can create a Tx2 with nlocktime without it being final could update that transaction to remove those restrictions right?
I read through the contracts wiki again, I think you were describing the escrow example, but I'm not sure it fulfills my #2 transaction example.
https://en.bitcoin.it/wiki/Contracts#Example_2:_Escrow_and_dispute_mediationCould you be a little more verbose in your example for me?
Thanks