jam icon indicating copy to clipboard operation
jam copied to clipboard

Show xpubs for accounts

Open realJogicodes opened this issue 2 years ago • 5 comments

Is your feature request related to a problem? Please describe.

In my don't trust verify attitude, I wanted to understand what the flavors in JAM are and what they do and if the seed phrase and address derivation works as expected. I always do that for new wallets. It was more difficult here, because xpubs were not shown. I could pull it off in the end, but considerable effort was required.

Describe the solution you'd like

Would be good to have a power user mode where users can display xpubs/zpubs for each flavor (account)

realJogicodes avatar Jun 01 '23 14:06 realJogicodes

tank you for the input, afaik we have plans for that: https://www.figma.com/file/kfejZJFlwBywvLEnPEmJo1/JoinMarket-UI?type=design&node-id=4139-77309&t=btiIGZLJOw9L8jKf-11

image

editwentyone avatar Jun 01 '23 21:06 editwentyone

Is there JM RPC API call that returns xpubs currently? In any case, I think way forward would be to return output descriptors that Jam could convert to plain xpub, zpub or whatever, if needed.

kristapsk avatar Jun 01 '23 22:06 kristapsk

Would be good to have a power user mode where users can display xpubs/zpubs for each flavor (account)

This is already partly shown in the Jar details (as shown by @editwentyone). However, only for "deposit" addresses and only always encoded as xpub (as far as I am aware, you need to re-encode it as zpub for some wallets). But you are right, it is currently not possible to show it for the "whole" account (as Jam cannot retrieve this info from JM and it only retrieves the seed phrase to show it to the user - not to infer any keys by itself).

Is there JM RPC API call that returns xpubs currently?

Yes there is: The wallet/{walletname}/display contains this information. However, only for "external addresses" (not the first "internal addresses" branch m/84'/{account}'/0'/1) and it is rather unstructured (within the "branch" property, separated by tabs \t), e.g.

  • "external addresses m/84'/1'/0'/0 tpubDEpNJqC8Ly5knQFgyHTeMR1Kx8KmixYL7ZN5qV8nGxqvKAms5QweeUc6xj9WPsVmv2PbK8pvqEhPdg6tFcrghjsfBEMF2HR9eGknxDSdawS"
  • "internal addresses m/84'/1'/0'/1 "

e.g. example response of /display (from a regtest wallet):

{
  "walletname": "Satoshi.jmdat",
  "walletinfo": {
    "wallet_name": "JM wallet",
    "accounts": [
      {
        "account": "0",
        "account_balance": "75.00000000",
        "available_balance": "75.00000000",
        "branches": [
          {
            "branch": "external addresses m/84'/1'/0'/0 tpubDEpNJqC8Ly5knQFgyHTeMR1Kx8KmixYL7ZN5qV8nGxqvKAms5QweeUc6xj9WPsVmv2PbK8pvqEhPdg6tFcrghjsfBEMF2HR9eGknxDSdawS",
            "entries": [
              {
                "hd_path": "m/84'/1'/0'/0/0",
                "address": "bcrt1q00044syeumewv58ntnjklkj7hm2k2rn79lv45m",
                "status": "reused",
                "label": "",
                "extradata": "",
                "amount": "75.00000000",
                "available_balance": "75.00000000"
              },
              [...]
            ],
            "balance": "75.00000000",
            "available_balance": "75.00000000"
          },
          {
            "branch": "internal addresses m/84'/1'/0'/1 ",
            "entries": [],
            "balance": "0.00000000",
            "available_balance": "0.00000000"
          },
          {
            "branch": "internal addresses m/84'/1'/0'/2 tpubDEpNJqC8Ly5kr7vqEEGoTFbaF97LKwDBEY9KtJbXEC9LNGGb1Lui5TJH8vT33A1opgp49Huo7wYV8HRAtACBzvMq6wg8dxeSwFe8FvuXS4r",
            "entries": [],
            "balance": "0.00000000",
            "available_balance": "0.00000000"
          },
          {
            "branch": "internal addresses m/84'/1'/0'/3 tpubDEpNJqC8Ly5kuWRg1EeKf4zE9z5yhvbJyRw4yzKkvNrjphM7zV6ewYX2hNnjSZda2BEe34gdZUT6y6awhZpU9g1roGfcYjUSczR6a9K7gZS",
            "entries": [],
            "balance": "0.00000000",
            "available_balance": "0.00000000"
          }
        ]
      },
      [...]
    ],
    "total_balance": "75.00000000",
    "available_balance": "75.00000000"
  }
}

theborakompanioni avatar Jun 02 '23 15:06 theborakompanioni

Hi @theborakompanioni ,I would like to work on this issue. Could you please assign it to me?

kunal-595 avatar Oct 13 '25 20:10 kunal-595

Hi @theborakompanioni ,I would like to work on this issue. Could you please assign it to me?

Yes! Nice. Assigned!

I think this should be done for the v2 branch. Either JM provides proper xpubs or Jam can infer it from the seed phrase in the seed modal only (Jam should not retrieve the seed without the user asking for it).

theborakompanioni avatar Oct 15 '25 20:10 theborakompanioni