Skip to content

feat: support all address types#431

Open
ben-kaufman wants to merge 30 commits intomasterfrom
feat/multiple-addresses-types
Open

feat: support all address types#431
ben-kaufman wants to merge 30 commits intomasterfrom
feat/multiple-addresses-types

Conversation

@ben-kaufman
Copy link
Contributor

This PR adds support for multiple Bitcoin address types in the iOS app, allowing users to select and monitor different address formats. Users can select their preferred address type from: Legacy (P2PKH), Nested SegWit (P2SH-P2WPKH), Native SegWit (P2WPKH), and Taproot (P2TR).

This requires extensive testing across all functionalities, send, receive, channel open, channel close (funds should always go to native segwit address except when selected address when channel opened was Taproot, in which case it should be a Taproot address), cpfp, rbf. All should be checked for each address type, and for multiple address types combined (ie. send with utxos of different address types, open channel with inputs of different address types, boost txs with inputs of different address types, etc.)

@ben-kaufman ben-kaufman requested a review from ovitrif February 5, 2026 11:13
@claude

This comment has been minimized.

@ben-kaufman ben-kaufman force-pushed the feat/multiple-addresses-types branch from 919e450 to 8c8e243 Compare February 11, 2026 04:38
@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@claude

This comment has been minimized.

@jvsena42
Copy link
Member

@claude create a checklist of manual test flows

@claude

This comment has been minimized.

@ben-kaufman ben-kaufman force-pushed the feat/multiple-addresses-types branch from 1170e77 to b0e40c3 Compare February 16, 2026 14:11
@ovitrif ovitrif changed the title Support all address types feat: support all address types Feb 16, 2026
Copy link
Collaborator

@ovitrif ovitrif left a comment

Choose a reason for hiding this comment

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

Test 1

Ran successfully the 1st pass of tests: switching and receiving to each address type as configurable in settings.


@ben-kaufman
I noticed the Address Viewer only knows the native segwit address type. Maybe worth updating it with implementation matching the former react native functionality which allowed switching address type on that screen. Probably best done on another PR to keep the changes reviewable; can be stacked PR, targeting the branch of this one.

@ben-kaufman
Copy link
Contributor Author

@ovitrif I just updated the address viewer here since it was a very small change

Copy link
Member

@jvsena42 jvsena42 left a comment

Choose a reason for hiding this comment

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

Didn't find any actual bug, just some suggestions

Still testing...

do {
let newAddress = try await lightningService.newAddressForType(addressType)

UserDefaults.standard.set(newAddress, forKey: "onchainAddress")
Copy link
Member

Choose a reason for hiding this comment

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

nit could check defensively if the address matches the addressType before saving it and even add unit tests

@ben-kaufman ben-kaufman force-pushed the feat/multiple-addresses-types branch from 21fca73 to dc1ab2a Compare February 18, 2026 05:44
@ben-kaufman
Copy link
Contributor Author

@jvsena42 updated for all comments

@ovitrif ovitrif self-requested a review February 18, 2026 07:49
Co-authored-by: João Victor Sena <jvsena42@users.noreply.github.com>
@jvsena42
Copy link
Member

I didn't know that Claude would automatically commit 😶‍🌫️

@jvsena42
Copy link
Member

jvsena42 commented Feb 19, 2026

❌After send 1k sats of native segwit, the amount was subtracted but the activity was not displayed. Steps to reproduce:

  1. Have two 1k sats UTXO of each address type
  2. Enable manual coin selection
  3. Send 1k sats
  4. Select 2 native segwit UTXO
  5. It will send successfully but the activity will not be displayed in the list

Testing in emulator, IDK if it is possible to export the logs. When I finish the tests I can share the mnemonics but the logs are just local

I'm not sure if it is related to this branch

@ben-kaufman ben-kaufman force-pushed the feat/multiple-addresses-types branch from d436239 to 8956313 Compare February 19, 2026 10:10
@jvsena42

This comment was marked as outdated.

@jvsena42
Copy link
Member

❌ Nested Segwit Send activity not displayed

Also tested mine one block
It was displayed to the receiver ✅

Simulator.Screen.Recording.-.iPhone.16.-.2026-02-19.at.07.34.17.mp4
image image

@jvsena42
Copy link
Member

❌ Send Legacy activity not displayed

Simulator.Screen.Recording.-.iPhone.16.-.2026-02-19.at.08.39.30.mp4
image

bitkit_foreground_2026-02-19_11-20-12.log
bitkit_foreground_2026-02-19_11-00-37.log

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

Comments