Skip to content

feat(connect): support ordinals purpose for P2TR addresses#30

Open
marcopeereboom wants to merge 1 commit into
MetaMask:mainfrom
marcopeereboom:feat/enable-p2tr-ordinals
Open

feat(connect): support ordinals purpose for P2TR addresses#30
marcopeereboom wants to merge 1 commit into
MetaMask:mainfrom
marcopeereboom:feat/enable-p2tr-ordinals

Conversation

@marcopeereboom
Copy link
Copy Markdown
Contributor

Explanation

bitcoin:connect with purposes: ['ordinals'] currently throws
"Only payment addresses are supported." The satsConnect connect handler
explicitly rejects any purpose other than payment, and
#standardAccountToSatsAccount hardcodes AddressType.p2wpkh.

This PR removes the payment-only guard and passes purposes through to
#standardAccountToSatsAccount. When ordinals is requested, it returns
AddressType.p2tr and AddressPurpose.Ordinals. Payment-only requests
continue to return P2WPKH — no behavioral change for existing callers.

The v4 request('getAddresses', ...) path also passes purposes through
so ordinals works via both the wallet standard and satsConnect v4 APIs.

README updated with ordinals connect examples for both APIs.

Requires the companion snap PR to serve P2TR accounts from the keyring.

References

Checklist

  • I've updated the test suite for new or updated code as appropriate
  • I've updated documentation (JSDoc, Markdown, etc.) for new or updated code as appropriate
  • I've communicated my changes to consumers by updating changelogs for packages I've changed
  • I've introduced breaking changes in this PR and have prepared draft pull requests for clients and consumer packages to resolve them

@marcopeereboom
Copy link
Copy Markdown
Contributor Author

FWIW, I tested all of this code using metamask flask and I was able to send and move ordinals.

Remove the payment-only guard from the satsConnect connect handler.
When purposes includes ordinals, return P2TR address type and
AddressPurpose.Ordinals. Payment-only requests continue to return
P2WPKH with no behavioral change for existing callers.
@marcopeereboom marcopeereboom force-pushed the feat/enable-p2tr-ordinals branch from f88a8e9 to 2de2004 Compare April 28, 2026 15:52
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.

1 participant