Repository navigation
docs: encrypt the 69-byte compact xpub in the contact-request guide - #5087
Conversation
The book's contact-request guide encrypted the full 78-byte BIP32 xpub. DIP-15 and every receiver (the reference mobile wallets and our Rust, Swift and Kotlin SDKs) use the 69-byte compact form: parent fingerprint, chain code and public key. Both lengths pad to the same 80-byte ciphertext, so the contract accepts the document and the recipient's wallet then drops it. The helper now slices the compact form out of the decoded xpub. Also corrects doc comments that no longer match the code: - build_contact_accounts only queues work for the signer-backed drain - displayHidden hides a contact; it is not the ignore feature - contactInfo privateData plaintext is the DIP-15 var-int encoding, not CBOR - the pending contact-crypto queue is not restored on load, and nothing blocks that any more - SpvEventForwarder and TokenWallet were replaced by LockNotifyHandler and IdentitySyncManager - the shielded example and bench no longer mirror an iOS raw-seed bind or a drive-abci seeder Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 43 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: dashpay/platform/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (11)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
📖 Book Preview built successfully. Download the preview from the workflow artifacts. Updated at 2026-09-27T23:06:16.756Z |
|
🕓 Queued for automated review — 1st in line, estimated start in ~10 min (commit bc7e3cf)
|
Basic explanation
What this does: fixes the book page that shows how to build a DashPay contact request. It told apps to encrypt the full 78-byte form of the sender's contact key. DashPay (DIP-15) and every wallet that reads these requests expect a shorter 69-byte form. A request built from the old page is accepted on chain, but the recipient's wallet cannot use it and drops it, so the contact never forms. The page now builds the 69-byte form.
It also corrects doc comments in the wallet crates that no longer match the code.
Example:
platform_encryption::COMPACT_XPUB_LENand the mobile wallets require.Both lengths pad to the same 80-byte AES-CBC ciphertext, which is why the contract's 96-byte
encryptedPublicKeycheck cannot catch the mistake.Value: apps that follow the book can now create contact requests that other wallets accept.
Risks: None. Documentation and comments only.
Issue being fixed or feature implemented
Found while checking the committed DashPay specs removed in #5060 against the code.
book/src/evo-sdk/dashpay-contact-requests.md(#3787) says "the sender's 78-byte serialized contact xpub", whilepackages/rs-platform-encryption/src/compact_xpub.rsdefines the plaintext asparentFingerprint(4) ‖ chainCode(32) ‖ publicKey(33)and refuses any other length on receive.What was done?
book/src/evo-sdk/dashpay-contact-requests.md: explain the 69-byte compact layout and why the contract cannot detect a 78-byte plaintext;serializedXpubPayloadbecomescompactXpubPayload, which slices bytes 5..9 and 13..78 out of the decoded BIP32 xpub.rs-platform-wallet:build_contact_accountsdescribed an older synchronous build; it now only queues work for the signer-backed drain, and the doc says so.ContactInfoPrivateData::display_hiddenis not "the cross-device ignore signal"; ignore is a separate, device-local feature.DashPayState::pending_contact_cryptosaid cold-load restore was "blocked upstream"; the storage crate's reader says nothing blocks it any more.SpvEventForwarder(nowLockNotifyHandler) andTokenWallet(nowIdentitySyncManager) mentions updated; the latter was also a broken intra-doc link.rs-platform-encryption:encrypt_private_datasaid the plaintext is CBOR; it is the DIP-15 var-int encoding.How Has This Been Tested?
Checked the new slice against BIP32 test vector 1 (
xpub68Gmy5Edvgib..., chain m/0H): bytes 5..9 are the parent fingerprint3442193e, 13..45 the chain code, 45..78 the public key, 69 bytes total.rustfmt --checkon every touched Rust file. No code changes.Breaking Changes
None.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
bc7e3cf/skip-botsproceeds without the ones not yet reported/self-reviewedonce the bots are doners-platform-wallet(packages/rs-platform-wallet/examples/shielded_sync_paloma.rs,packages/rs-platform-wallet/src/wallet/asset_lock/manager.rs,packages/rs-platform-wallet/src/wallet/asset_lock/sync/proof.rsand 6 more) — HashEngineering or ZocoLini or llbartekll or romchornyiWhen every box is checked the
PR Hygienecheck passes and this can merge.