Skip to content

Conversation

@Polybius93
Copy link
Contributor

Enhance Proof of Reserve Calculation

Overview

This PR improves the Proof of Reserve calculation system by enhancing the vault deposit verification process. The main change is renaming the verifyVaultDeposit function to getVaultDepositAmount and improving it to correctly handle unconfirmed deposit-more transactions.

Key Changes

  • Renamed verifyVaultDeposit to getVaultDepositAmount with improved documentation
  • Enhanced transaction handling to properly account for deposit values from unconfirmed transactions that represent "deposit-more" operations
  • Simplified vault payment script generation with the new getVaultPayment helper function
  • Removed unnecessary attestor public key derivation in favor of using the extended public key directly
  • Added comprehensive test for unconfirmed deposit-more transactions
  • Added documentation in README about the Proof of Reserve calculation process

Technical Details

  • When a transaction is unconfirmed but represents adding funds to an existing vault, the system now returns the value of the input corresponding to the vault's multisig address
  • Simplified code paths for handling both withdraw-deposit and funding transactions
  • Updated parameter naming for better clarity (attestorGroupPublicKeyextendedAttestorGroupPublicKey)

Testing

  • Added a new test case that verifies the correct behavior for unconfirmed deposit-more transactions
  • All existing tests have been updated to use the new function names and parameters

Version

  • Bumped version from 2.6.5 to 2.6.6

…deposit amount if there are not enough confirmations
@Polybius93 Polybius93 merged commit 0d88019 into main Mar 14, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants