Skip to content

Stacks Pay: A Payment Request Standard for Stacks Blockchain Payments#202

Open
dantrevino wants to merge 8 commits intostacksgov:mainfrom
dantrevino:feature/stacks-pay
Open

Stacks Pay: A Payment Request Standard for Stacks Blockchain Payments#202
dantrevino wants to merge 8 commits intostacksgov:mainfrom
dantrevino:feature/stacks-pay

Conversation

@dantrevino
Copy link

Stacks Pay is a proposed standard for wrapping transaction information in a standard way for easy sharing.

@dantrevino dantrevino changed the title Feature/stacks pay Stacks Pay: A Payment Request Standard for Stacks Blockchain Payments Dec 2, 2024
@binxbrigandine
Copy link

Love standardization!

@markmhendrickson
Copy link

Thanks for proposing, @dantrevino! We'll review on the Leather team and provide thoughts.

Copy link

@kyranjamie kyranjamie left a comment

Choose a reason for hiding this comment

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

Great work @dantrevino

Copy link
Contributor

@whoabuddy whoabuddy left a comment

Choose a reason for hiding this comment

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

Overall looks good, happy to see you're putting this forward! I left a few small comments.

@human058382928 @r0zar @biwasbhandari these encoded URLs describe a Stacks transaction, might be something cool we can do there with @aibtcdev tooling!

@friedger
Copy link
Contributor

friedger commented Mar 7, 2025

How difficult is it to integrate into existing payment flows? E.g. compared to eth integration. Maybe something for the introduction.

@flormpecasique
Copy link

flormpecasique commented Apr 1, 2025

Hey Dan 👋

Awesome work on this! I wanted to share some thoughts based on my experience building Stacks Invoice Generator, where I tackled invoice generation for STX and Stacks tokens without smart contracts. One of the biggest challenges I faced was QR code functionality.

Initially, I wanted users to scan a QR code and have it automatically open their wallet (Xverse/Leather) with all payment details pre-filled—similar to Bitcoin or Ethereum payment URIs (e.g., bitcoin:address?amount=0.1). However, Stacks doesn’t currently support a universal payment link format, so I had to settle for QR codes that only contain the recipient’s address, requiring users to manually enter the amount and memo.

I believe adding universal payment links for STX and tokens (e.g., stackspay:stx1abc...xyz?amount=100&token=STX&memo=Invoice123) would be a game-changer for the ecosystem. It would:
✅ Enable seamless integration between wallets and apps.
✅ Improve the user experience by eliminating manual data entry.
✅ Make STX payments feel as smooth as Lightning payments in Bitcoin.

Would love to hear your thoughts on this! Is this something that could fit into Stacks Pay?

@dantrevino
Copy link
Author

Hey Dan 👋

Awesome work on this! I wanted to share some thoughts based on my experience building Stacks Invoice Generator, where I tackled invoice generation for STX and Stacks tokens without smart contracts. One of the biggest challenges I faced was QR code functionality.

Initially, I wanted users to scan a QR code and have it automatically open their wallet (Xverse/Leather) with all payment details pre-filled—similar to Bitcoin or Ethereum payment URIs (e.g., bitcoin:address?amount=0.1). However, Stacks doesn’t currently support a universal payment link format, so I had to settle for QR codes that only contain the recipient’s address, requiring users to manually enter the amount and memo.

I believe adding universal payment links for STX and tokens (e.g., stackspay:stx1abc...xyz?amount=100&token=STX&memo=Invoice123) would be a game-changer for the ecosystem. It would: ✅ Enable seamless integration between wallets and apps. ✅ Improve the user experience by eliminating manual data entry. ✅ Make STX payments feel as smooth as Lightning payments in Bitcoin.

Would love to hear your thoughts on this! Is this something that could fit into Stacks Pay?

QR codes are a core part of the experience i the proposal. Check out https://stackspay.org/ and the Merchant Section in the spec for details. The encoding also has the benefit of providing checksum so that users (stackpay parsers) can ensure that the QR codes have not been tampered with.

Copy link
Contributor

@friedger friedger left a comment

Choose a reason for hiding this comment

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

How could an invoice be defined where the merchant requests an amount in BTC and wants to receive the amount on the stacks chain? Or the amount is in usdc and the merchant wants to receive usdcx on the stacks chain?

Do we make an explicit mention of chain id? Default to mainnet if omitted? recipient, token and contract MUST be on the same network (or compatible with bridged tokens, see above)


| Name | Type / Format | Description |
|------|---------------|-------------|
| `recipient` | Stacks c32-address | Address that ultimately receives the payment. |
Copy link
Contributor

Choose a reason for hiding this comment

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

recipient could be also a contract (or in the future a bitcoin address #219)

| Name | Type / Format | Description |
|------|---------------|-------------|
| `recipient` | Stacks c32-address | Address that ultimately receives the payment. |
| `token` | **STX** \| SIP-010 contract address (`SP….<contract>`) | Asset used to pay. When omitted wallets **MUST** default to **STX**. |
Copy link
Contributor

Choose a reason for hiding this comment

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

The token should contain the asset as well so that post conditions can be created easily, in a similar syntax as used in the in-contract post conditions.


---

### 3.3 `mint`
Copy link
Contributor

Choose a reason for hiding this comment

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

Why mint? It could also make sense to have a generic execute operation.

This operation can also make sense for depositing tokens into a vault.


### 3.1 `support`

Description of support operation here
Copy link
Contributor

Choose a reason for hiding this comment

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

Is Description of support operation here a TODO or a title

## 7 Ratification Criteria

1. SIP accepted by governance.
2. At least one reference implementation passes test-vectors.
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are the test-vectors defined?

## 5 Security Considerations

* **Post-conditions** – Wallets **SHOULD** add appropriate post-conditions
limiting the transferred asset/amount.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
limiting the transferred asset/amount.
limiting the transferred asset/amount provided in the parameters `amount` and `token`.

cocoa007 added a commit to cocoa007/nip-caip358-zaps that referenced this pull request Feb 20, 2026
Extends NIP-57 (Lightning Zaps) to support on-chain payments using
CAIP-358 (wallet_pay) alongside BOLT-11 invoices.

Features:
- payment_type tag (bolt11 | caip358) on kind 9734/9735
- CAIP-358 payment request/receipt in zap events
- Stacks transfer types (sip10-transfer, stx-transfer)
- CAIP-19 asset IDs for Stacks tokens (sBTC, STX)
- Multi-chain payment options in single zap request
- Full backward compatibility with NIP-57

Includes real-world example: 200 sats sBTC zap from cocoa007 to
Stark Comet on Stacks mainnet with verified on-chain txids and
the corresponding Nostr event published to relay.damus.io and nos.lol.

References:
- NIP-57: https://github.com/nostr-protocol/nips/blob/master/57.md
- CAIP-358: https://standards.chainagnostic.org/CAIPs/caip-358
- SIP-029: stacksgov/sips#202
- sBTC zap spec: cocoa007/x402-nostr-relay#3
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.

8 participants