[bullbitcoin-mobile] Implement BIP85 derivation for merchant keys (PGP, AES, password)#2
Open
BullishNode wants to merge 2 commits intomainfrom
Open
[bullbitcoin-mobile] Implement BIP85 derivation for merchant keys (PGP, AES, password)#2BullishNode wants to merge 2 commits intomainfrom
BullishNode wants to merge 2 commits intomainfrom
Conversation
This commit creates the merchant_payments feature folder structure following the Clean/Hexagonal architecture pattern documented in ARCHITECTURE.md: - domain/ - Contains entities, repository contracts, service contracts, and usecases - data/ - Contains datasources, models, and repository implementations - presentation/ - Contains BLoCs/Cubits for state management - ui/ - Contains screens and widgets The feature is registered in the app locator (lib/locator.dart) for dependency injection. Placeholder .gitkeep files are added to maintain directory structure. Fixes SatoshiPortal#27 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Adds key derivation service following the recoverbull BIP85 pattern for
deterministic generation of cryptographic keys from the wallet's master
mnemonic. This enables secure, recoverable key management for BullPOS
merchant functionality.
Implementation:
- Created KeyDerivationPort interface defining the key derivation contract
- Implemented MerchantKeyDerivationService with BIP85-based derivation
- PGP keypair derivation at m/83696968'/828365'/{bits}'/2026'/
- AES-256 key derivation at m/83696968'/128169'/256'/2026'/{index}'
- Server password derivation at m/83696968'/707764'/21'/2026'/
- Password returns 21-char Base64 string (~120 bits entropy)
- Registered service in MerchantPaymentsLocator
Testing:
- Comprehensive unit tests with 17 test cases covering:
- Deterministic key generation
- Correct path format validation
- Key uniqueness across indices
- Proper entropy levels
- All tests passing
Notes:
- PGP keypair generation returns placeholder pending OpenPGP library integration
- Entropy is correctly derived and can be used with OpenPGP library once added
- Service follows Clean Architecture pattern with ports/adapters
Fixes SatoshiPortal#29
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.
Summary
Implements BIP85 derivation for merchant cryptographic keys (PGP, AES, password) following the recoverbull pattern for deterministic key generation from the wallet's master mnemonic.
Changes
KeyDerivationPortinterface defining the key derivation contractMerchantKeyDerivationServicewith BIP85-based derivation:m/83696968'/828365'/{bits}'/2026'/m/83696968'/128169'/256'/2026'/{index}'m/83696968'/707764'/21'/2026'/MerchantPaymentsLocatorTesting
All unit tests pass:
Notes
Fixes SatoshiPortal#29