Bitcoin Bridge Smart Contract Implementation#1
Open
peace-source wants to merge 8 commits intomainfrom
Open
Conversation
- Defined error codes for various contract operations including authorization, amount validation, balance checks, bridge status, transaction processing, oracle validation, recipient validation, deposit limits, and transaction hash validation.
- Defined core configuration variables including bridge owner, bridge pause status, bridge fee percentage, and maximum deposit amount. - Added bridge state variable to track the total locked Bitcoin.
…recipient management, and user balances - Defined maps for managing authorized oracles, tracking processed transactions, whitelisting recipients, and storing user balances.
- Defined the wrapped Bitcoin fungible token. - Added private functions for authorization checks, principal validation, transaction hash validation, and retrieving user balance amounts.
- Defined a private function to validate Bitcoin transactions by checking the transaction hash, amount, and authorization status of the validator.
…dge controls, configuration updates, and core bridge operations - Added public functions to add and remove oracles, manage recipient whitelist, pause and unpause the bridge, update bridge fee and maximum deposit amount. - Implemented core bridge operation for depositing Bitcoin, including input validation, bridge state validation, transaction processing, and state updates.
- Added read-only functions to get total locked Bitcoin, user balance, oracle authorization status, and bridge owner status.
… contribution guidelines
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR implements a comprehensive Bitcoin Bridge smart contract that enables secure bridging of Bitcoin to wrapped tokens (wBTC) on the Stacks blockchain.
Changes
Core Contract Implementation
Documentation
Implementation Details
1. Constants and Error Codes
2. Core Configuration
3. Storage and State Management
4. Security Features
Security Considerations
Deployment Notes
Checklist