chainhook icon indicating copy to clipboard operation
chainhook copied to clipboard

[Chainhook] Events after a number of confirmation

Open friedger opened this issue 2 years ago • 7 comments

I would like to use chainhooks to trigger an action only when a transaction was confirmed on bitcoin say 2 times.

Is there a way to express that in a predicate? Do chainhooks support it?

friedger avatar Jan 12 '23 09:01 friedger

hey @friedger! there is a field available in the chainhook specifications payload, but the mechanic behind it is not yet implemented. we can definitely increase the priority of this feature if this requirement is important for you!

lgalabru avatar Jan 12 '23 17:01 lgalabru

@lgalabru: This has come up from Emil & Tycho from the Zest team, and they have expressed a similar need. +1 to looking into it.

sabbyanandan avatar Jan 12 '23 17:01 sabbyanandan

@lgalabru The use case is for register and reveal (e.g. BNS, or random NFT tiers) where 1 tx has to be placed in a block after the first tx or later

friedger avatar Jan 12 '23 19:01 friedger

I see. In that case you'd be registering 2 chainhooks predicates, no? The first predicate would be watching commit operations being mined. The chainhook handler would broadcast the reveal transaction. The second predicate would be watching reveal operations and run whatever actions that your service have to perform when BNS names are registered. Does that make sense? What was the confirmation based design you had in mind?

lgalabru avatar Jan 13 '23 15:01 lgalabru

A predicate where I can specify the number of required confirmations.

Your proposal would make it 3 txs? Not sure I understood correctly. @lgalabru

friedger avatar Jan 13 '23 15:01 friedger

@MicaiahReid Is this complete?

smcclellan avatar Jun 18 '24 19:06 smcclellan

@smcclellan No, this hasn't been started.

MicaiahReid avatar Jun 18 '24 21:06 MicaiahReid