Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Escape Hatch: Add a way for owners of a funding-failed deposit to ask nicely for their UTXO(s) back #583

Merged
merged 7 commits into from
Apr 20, 2020

Conversation

Shadowfiend
Copy link
Contributor

@Shadowfiend Shadowfiend commented Apr 18, 2020

To allow for mistakes in funding that can't be managed on-chain, this PR introduces a new deposit function, requestFunderAbort, that can only be called by the TDT holder after deposit setup has failed. The function merely emits a FunderAbortRequested event that carries a funder-specified output script. Signers should, though they are not obligated by protocol or cryptoeconomically incentivized, coordinate to return any UTXO to the signer-controlled wallet back to the requested output script in the abort request.


Remaining:

  • Tests.

Closes #550.

This is the term used in the spec, so keep consistency throughout
comments and revert messages.
It was still implying the output script had to be a P2WPKH script.
Funders no longer bond, they pay, and that payment is refunded in case
of a fault that they did not cause.
Copy link
Member

@mhluongo mhluongo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK. Question about storage, but I'm not the expert so I'll leave that to @NicholasDotSol

/// requests the return of a sent UTXO to _abortOutputScript. It
/// imposes no requirements on the signing group. Signers may or may
/// not send their UTXO to the requested output script, at their
/// discretion and with no penalty for failing to do so. This can be
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's worth explaining that while "there's no protocol incentive" a signer still "should" return funds, or similar? Just being clear that while the protocol can't enforce it, that doesn't mean depositors need to expect signers will steal their funds. Most signers at launch will be known entities after all

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a pass at this, have a look.

solidity/contracts/deposit/DepositUtils.sol Outdated Show resolved Hide resolved
This acts as a signal to the signing group corresponding to a deposit
that failed funding that the depositor would like their UTXO back. This
signal is completely unenforced by the system, as once it is deliverable
the funding process has already failed completely and the signers have
retrieved their bonds. However, it allows for off-chain coordination to
return the funder's UTXO in unusual cases such as a funding transaction
that was unprovable to the contract.
@Shadowfiend Shadowfiend marked this pull request as ready for review April 19, 2020 05:40
@Shadowfiend Shadowfiend requested review from a team and NicholasDotSol and removed request for a team April 19, 2020 05:40
@Shadowfiend
Copy link
Contributor Author

@NicholasDotSol one more for youuuu.

Copy link
Contributor

@NicholasDotSol NicholasDotSol left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good to me

)
})

beforeEach(async () => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, but we can move all of this to the before block, and then:

    beforeEach(async () => {
      await createSnapshot()
    })

    afterEach(async () => {
      await restoreSnapshot()
    })

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bah, I actually wanted to do this, but I think we're close enough here that I'm going to punt it to an imaginary future improvement.

@Shadowfiend Shadowfiend merged commit 9651d53 into master Apr 20, 2020
@Shadowfiend Shadowfiend deleted the escape-hatch branch April 20, 2020 23:54
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Whoops I misfunded, please return" function?
3 participants