2

Is there a way where i can have a multi-sig address which will allow one of the signers to use only their single key after a set amount of time after each transaction/update on the address?

I want to have an address that requires 2 people to sign for outgoing transactions. But if after 30 days nothing has been done with the address at all a single signer can sign a transaction. But if there is ever anything such as an incoming or outgoing transaction the 30 days is reset.

3 Answers 3

1

Whereas it seems, that this is not directly possible, cause bitcoin script does not allow to reference a transaction "within last 30 days", one could think about a "workaround" with a business logic watching the P2SH address. An approach could be the nested "if", which is allowed in bitcoin script. If ever within last 30 days there was a payment, the 30 days need to get "reset" - maybe you would need to play with two P2SH addresses, and shift the funds to a second addresses (and vice versa). If your business logic discovers a transaction in the last 30 days, the funds are transferred to a second address, and then again to the first address. For this second address you'd have the same set of rules, just the tx output script (for it's address) changes. The business logic could have a "known secret", that noone else knows, and then shift the funds between the addresses, just as an idea, like this:

IF
  OP_HASH160  <length 0x14> <SECRET> OP_EQUAL
  <business pubkey> CHECKSIG
ELSE
  IF
    2 <Alice's pubkey> <Bob's pubkey> <Escrow's pubkey> 3 CHECKMULTISIG
  ELSE
    30d CHECKSEQUENCEVERIFY DROP
    <Alice's pubkey> CHECKSIG
  ENDIF
ENDIF

Obviously it becomes clear, that there are fees involved in such a scenario. It depends on the frequency of transactions within last 30 days, and the value of the funds, that are shifted around. The fees should not eat up your funds... And then again, maybe one might look into using Lightning as "transport mechanism" to shift values around?

0

...to use only their single key after a set amount of time after each transaction/update on the address?

This is not possible as there is no provision in bitcoin script to query past transactions within another transaction, so you cannot check the time of the last transaction to that address.

0

One workaround if the multi-sig address is not in cold storage and your usecase allows for it, would be to spend all the coins in the multi-sig address every time you make a new deposit to this address, thereby resetting the timer by "overwriting" it.

So if you have X coins in the multi-sig and want to deposit Y new coins, you make a transaction that also spends those X coins (requiring both signers to sign it) and make a new output of X+Y coins.

The output-script would then always be of the form:

IF
    2
ELSE
    30d CHECKSEQUENCEVERIFY DROP
    1
ENDIF
<Alice's pubkey> <Bob's pubkey> 2 CHECKMULTISIG

This would result in always exactly one unspent output in the multi-sig address with the current timer running.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.