meta
meta copied to clipboard
Improve URI `monero_wallet` standard by allowing optional <txid> string
Current Monero URI documentation: https://github.com/monero-project/monero/wiki/URI-Formatting#wallet-definition-scheme
There is a Monero gift card project that could benefit from including txids in the URI, not that scan_txid
is available.
Proposal
Only one of mnemonic_seed
and (spend_key,view_key)
may/must be specified. If height
is specified, then txid
should not be specified, and vice versa. Multiple txids
may be specified. txids
must not be specified if other incoming txids are sent to the wallet. For multi-use wallets, a height
should be specified instead.
Parameter | Type | Description |
---|---|---|
address | String | Raw (95-character) address |
spend_key | Hex String | Private spend key of a wallet. |
view_key | Hex String | Private view key of a wallet. |
mnemonic_seed | String | URL Encoded seed to restore a deterministic wallet. |
height | Long | Block height when the wallet was created. |
txid | String | txid(s) to scan |
Example:
monero_wallet:467iotZU5tvG26k2xdZWkJ7gwATFVhfbuV3yDoWx5jHoPwxEi4f5BuJQwkP6GpCb1sZvUVB7nbSkgEuW8NKrh9KKRRga5qz?spend_key=029c559cd7669f14e91fd835144916009f8697ab5ac5c7f7c06e1ff869c17b0b&view_key=afaf646edbff3d3bcee8efd3383ffe5d20c947040f74e1110b70ca0fbb0ef90d&txid=715d7f44aa641d562ea649d14152f10f84f5fd087caf637295b963cbcbb05a0e
Context/Use
There is a desire to use Monero "gift cards" with a small preloaded value on them. In situations where these cards are loaded in a single transaction, wallets can easily and near-instantly scan specific txids, for then sweeping into another seed automatically.
If only a restore height is specified, then scanning can take minutes or hours.
Scanning a monero_wallet URI with specific txids signals to the wallet that the only funds in this seed are from these specific txids.
This field serves 2 purposes:
- Specifying txids for significantly faster scanning.
- Indicating to wallets that this seed is for single-use only, and can be discarded (swept) once scanned.
Questions
- Should we allow multiple txids, or just 1?
- Should we allow specifying both a txid and block height? What use-case would this be for, and how should a wallet handle this?
Some great use cases for scan_tx (insta syncing a one-time-use gift wallet with 1 input -> to be transferred to the users own wallet via magic - ideally from a trusted node)
Sidenote: theres a bit of a bug with scan_tx where duplicates can be scanned and appear in your history list as amount "0" - probably causes issues elsewhere, jberman has a PR fixing it here https://github.com/monero-project/monero/pull/8566
1 txid , or a list separated by commas is easy to work with. proof of concept here https://github.com/plowsof/redeem_gift_poc
edit* this pull request to add multiple recipients to a payment uri uses ";" so for consistency txid should also https://github.com/monero-project/monero/pull/8665
I believe it's ready for final review now @luigi1111
@luigi1111 Cake Wallet is implementing the URI standard as written above, which deviates somewhat from the listed version in the wiki.
Should the wiki be updated?
to get this moving along, this needs to be a pull request to the actual wiki, then it can be reviewed conveniently before merging. thanks @SamsungGalaxyPlayer for this :1st_place_medal: ( @ofrnxmr (?) pointed out that connecting to a node as --trusted-daemon reduces network usage. in my PoC i found it reduced the time to claim a gift card from 18s to around 8s~ )
@plowsof how can I open a pull request for the wiki? I haven't done that before
@SamsungGalaxyPlayer sorry, the feature does not exist, removes foot from mouth will ask around what the best course of action here is
@SamsungGalaxyPlayer a suggestion was to make a PR to https://github.com/monero-project/meta/tree/master/api (adding a file called something like uri_formatting.md inside the api folder) because we can't make PRs/review @ the wiki
Well Cake is going forward with the standard above. If Core wants to update the wiki page to match this, only they can edit that page as far as I understand @luigi1111 @plowsof
https://github.com/monero-project/monero/wiki/URI-Formatting/_history isn't only Core, but I don't know off-hand how to do it (for non-maintainers).
We locked the wiki because people would add nonsense / malicious links.
I will re-open with changes. Our devs have advised me, and I've learned more about URIs in the process.