Skip to content

SIP-030: Wallet RPC Standards #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open

SIP-030: Wallet RPC Standards #166

wants to merge 55 commits into from

Conversation

janniks
Copy link
Contributor

@janniks janniks commented Jan 12, 2024

Wallet RPC Standards

📓 Read the full SIP-030 on Wallet RPC Standards

  • Adds SIP for more modern standard for wallet API RPC (usable for browser-extensions as well as other settings)
  • Proposes standards for serialization of wallet RPC requests

Currently being reviewed and edited for final approval

@kyranjamie
Copy link

Great work @janniks. Leather supports this SIP 🖤

@janniks
Copy link
Contributor Author

janniks commented Feb 14, 2024

Thanks for the input @m-aboelenein @kyranjamie .
I updated the stuff we chatted about on the call, and also added some OPEN QUESTIONS to the top.

Do you think you could do another review with final remarks until ~Tue. 20.02.2024 to wrap this up with bipartisan support? 🙏

@janniks
Copy link
Contributor Author

janniks commented Feb 15, 2024

Added methods getAddresses and getAccounts for better compatibility with current solution.

@janniks
Copy link
Contributor Author

janniks commented Feb 29, 2024

@aryzing @kyranjamie I added an update to the encoding (as discussed on last weeks call).
Let me know what you think! This can be used as the canonical repr and Stacks.js would also migrate towards it. (Serialized hex encoded string could also still be used (easy to tell apart).

Also updated:

  • renamed functionName to name, functionArgs to arguments
  • merged contractName + contractAddress to contract -- which is a ${string}.${string} (how it's copy pasted from the explorer)
  • renamed some other params (see 425f81c for details)

Ping me if you disagree with anything -- trying to make the naming more logical and short

@janniks
Copy link
Contributor Author

janniks commented Feb 29, 2024

CC @pradel would also love to get your feedback on this updated approach to "Connect"/auth -- it's less convoluted, but also more explicit (might need multiple steps for some things, that were just magically done in auth previously , e.g. requesting a gaia token would be it's own step, (although wallets could also add it to something like getAddresses / getAccounts)

@pradel
Copy link

pradel commented Mar 1, 2024

@janniks I like this change, less magic on what's going on and the behavior seems to be pretty similar to how ETH is doing things, making it easier for ETH devs to use the API

@janniks janniks changed the title SIP: Wallet APIs via WebBTC SIP: Modern Wallet APIs Mar 5, 2024
@janniks
Copy link
Contributor Author

janniks commented Mar 5, 2024

CC @friedger would also love to get some of your feedback+expertise, since you've worked on this area in the past 🙏

@janniks
Copy link
Contributor Author

janniks commented Mar 5, 2024

Also, Thanks for all the feedback everyone! 👏

I feel like we're nearing a good document here. I think we can wrap it up soon 🫡

@janniks
Copy link
Contributor Author

janniks commented Mar 5, 2024

Let me know which email-addresses/github-usernames to add to the author list. cc @kyranjamie @m-aboelenein @aryzing

- `txid`: `string` hex-encoded
- `transaction`: `string` hex-encoded raw transaction

#### Method `stx_transferSip9Nft`
Copy link
Contributor

Choose a reason for hiding this comment

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

stx_transferSip13Sft could be added as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can't tell if here SFTs should be treated as FTs

Transfer

(transfer ((token-id uint) (amount uint) (sender principal) (recipient principal)) (response bool uint))

Transfer a token from the sender to the recipient. It is recommended to leverage Clarity primitives like ft-transfer? to help safeguard users. The function should return (ok true) on success or an err response containing an unsigned integer on failure. The failure codes follow the existing conventions of stx-transfer? and ft-transfer?.

Copy link
Contributor

Choose a reason for hiding this comment

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

SFTs have one more parameter, therefore, it should be specified as well.

- Bytes are serialized as hex-encoded strings (without a 0x prefix).
- Predefined formats from previous SIPs are used where applicable.
- Addresses are serialized as Stacks c32-encoded strings.
- Clarity values, post-conditions, and transactions are serialized to bytes (defined by SIP-005) and used as hex-encoded strings.
Copy link
Contributor

Choose a reason for hiding this comment

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

SIP-003 is also relevant here

Copy link
Contributor

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

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

I think this SIP is in a good place, with only minor comments remaining.

Can the technical CAB take a look and consider advancing this SIP? cc @obycode @kantai et al.

@Hero-Gamer
Copy link
Contributor

"This SIP is considered Ratified after at least two wallet providers with significant user adoption (> 10,000 monthly active users) have implemented and launched the new standard."

Has this been met? Do we have 2 wallet provider confirm to implement? If so, maybe useful to drop their confirmation here?

Anything else outstanding? If not I will ask the Technical CAB chair to table it for official vote.

@kyranjamie
Copy link

Leather now supports SIP-30

janniks and others added 2 commits March 4, 2025 22:41
Copy link
Contributor

@jiga jiga left a comment

Choose a reason for hiding this comment

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

@jcnelson @MarvinJanssen @GinaAbrams_

@Hero-Gamer
Copy link
Contributor

Leather now supports SIP-30

Great it's passed CAB vote!

Last thing, @kyranjamie & @janniks:

To help the Steering Committee review whether the activation criteria have been met, it was mentioned that there are two wallet providers, with Leather being one of them. How can we verify who the second wallet provider is and confirm that they have implemented and launched the new standard?

Activation
This SIP is considered Ratified after at least two wallet providers with significant user adoption (> 10,000 monthly active users) have implemented and launched the new standard.

@wileyj wileyj requested a review from jiga March 24, 2025 20:51
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.