# Grin Wallet URL Format

**URL:** <https://forum.grin.mw/t/grin-wallet-url-format/188>\
**Category:** Development and Technical Discussion\
**Created:** [February 16, 2018, 2:56am UTC](https://forum.grin.mw/t/grin-wallet-url-format/188 "2018-02-16T02:56:24Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodarmor](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/rodarmor/32/13_2.png) [@rodarmor](https://forum.grin.mw/u/rodarmor)\
**Post date:** [February 16, 2018, 2:56am UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/1 "2018-02-16T02:56:24Z")

</div>

Greetings all!

Grin payees currently provide IP addresses to payers so that their wallets can rendezvous and complete the payment. We’ll need to switch to a more robust address scheme eventually, and I wanted to create this thread to get the discussion going.

The current scheme has a number of drawbacks:

- Vulnerable to man-in-the-middle attacks
- Requires the payee to be publicly reachable, which in practice will require the payee to configure their firewall or NAT
- Reveals the network location of the participants to one another, and to others who might observe the address, for example if a request for payment is posted in a public forum or on a mailing list
- May expire unpredictably, since not all IP addresses are static

I’ve written a [wiki page outlining a number of possible alternatives](https://github.com/casey/grin/wiki/Addresses). I intend for it to be comprehensive, so do let me know if I’ve left something out!

My personal suggestion, although this shouldn’t carry much weight as I won’t be able to help implement it, is as follows:

I think that first switching to `pubkeyhash@ip` / `pubkeyhash@domain` and using the key to authenticate and encrypt the connection is probably prudent. This would fix the current vulnerability to man-in-the-middle attacks. Also, the code to implement this scheme will not be obviated by later improvements, so it won’t be wasted effort, even if we switch to another scheme.

After that, I think that using Tor hidden services is the best longterm solution. This would eliminate firewall and NAT issues, as hidden service clients and servers use outbound connections only, obscure network addresses, and allow a new address to be generated per payment.

However, Tor is a somewhat painful dependency, as it is written in C, and we would need to include a separate Tor binary in standalone Grin distributions, or require that the end user install it with a package manager.

What do y’all think?

---

<div class="post-metadata">

**Author:** ![igno.peverell](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/igno.peverell/32/4_2.png) [@igno.peverell](https://forum.grin.mw/u/igno.peverell)\
**Post date:** [February 16, 2018, 10:20pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/2 "2018-02-16T22:20:20Z")

</div>

Superficial level first: I wouldn’t talk about addresses or address format, that’s going to confuse people. Whatever we come up with will have totally different characteristics and will live at a different stack level compared to say bitcoin addresses. So how about wallet URL?

Otherwise I share your conclusions. Thanks for doing this!

---

<div class="post-metadata">

**Author:** ![rodarmor](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/rodarmor/32/13_2.png) [@rodarmor](https://forum.grin.mw/u/rodarmor)\
**Post date:** [February 16, 2018, 10:54pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/3 "2018-02-16T22:54:26Z")

</div>

“Wallet URL” sounds totally reasonable to me, especially since it might even get its own scheme, like so:

`grin:4acth47i6kxnvkewtm6q7ib2s3ufpo5sqbsnzjpbi7utijcltosqemad`

I think that people will call it an address anyway, but that can’t really be helped.

---

<div class="post-metadata">

**Author:** ![harry.potter](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/harry.potter/32/99_2.png) [@harry.potter](https://forum.grin.mw/u/harry.potter)\
**Post date:** [February 18, 2018, 12:20pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/4 "2018-02-18T12:20:02Z")

</div>

Obviously we need vaults, not wallet urls, we can devise a few prefixes (optional) based on weather the address is or is a multiplicate of 2/10,3,4,5,7,11,1/13

vault:4acth47i6kxnvkewtm6q7ib2s3ufpo5sqbsnzjpbi7utijcltosqemad  
safe:4acth47i6kxnvkewtm6q7ib2s3ufpo5sqbsnzjpbi7u  
depositbox:4acth47i6kxnvkewtm6q7ib2s3

---

<div class="post-metadata">

**Author:** ![Anon136](https://avatars.discourse-cdn.com/v4/letter/a/3bc359/32.png) [@Anon136](https://forum.grin.mw/u/Anon136)\
**Post date:** [March 1, 2018, 1:42am UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/5 "2018-03-01T01:42:46Z")

</div>

Haha vaults! I like it!

It’s good optics anyway to push for calling it something other than an address. It makes it clear that this is not a fork of bitcoin.

---

<div class="post-metadata">

**Author:** ![harry.potter](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/harry.potter/32/99_2.png) [@harry.potter](https://forum.grin.mw/u/harry.potter)\
**Post date:** [March 11, 2018, 8:15am UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/8 "2018-03-11T08:15:33Z")

</div>

@rodarmor

For what you are suggesting… we need our own DNS system to provide addresses or wallet URLS as you call them. I’d preffer to call them Vaults that are similar to a bitcoin wallet address in that it is base58 text.

We need a time stamped ledger of peers  
We only need keep the most recent location for the peer  
This isnt unheard of and is sort of what hashgraph uses  
However this information ought to be encrypted and needs a key to decrypt it  
The decryption key is packaged in the Vault address

A peers most recent endpoint consists of public key and (encrypted) signed ip/hostname(dns/i2p/tor)

There’s not much we can do about peers that are using things like tor when the sender has no local tor node. So I’d really like us to put i2p and tor on the back burner and just use IP’s and DNS lookups for now.

A Vault is simply a public key and the peer decryption key converted to base58. However I have a new method that I’d like to share with the world for transcoding to base58, so the output is still base58 but how it works is new.

The latest peer endpoint is looked up.

Success = Vault { pub key, peer decryption key } \> Peer { decrypted signed IP/Port }

Edit: so yeah DHT sounds like the way to go, I’ll help if I can, I’ve been wanting to get stuck into rust somewhere

---

<div class="post-metadata">

**Author:** ![willish](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/willish/32/101_2.png) [@willish](https://forum.grin.mw/u/willish)\
**Post date:** [March 11, 2018, 1:04pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/9 "2018-03-11T13:04:29Z")

</div>

> [@harry.potter](#):
>
> Edit: so yeah DHT sounds like the way to go, I’ll help if I can, I’ve been wanting to get stuck into rust somewhere

I am currently doing research into anonymous communications systems, so ill be following this topic with interest. Since GRIN requires some basic rdv mechanism, it would be pretty nice if this use case could be a motivator for building a scaleable messaging system with real anonymity properties. But I may be dreaming and projecting my own interests a little here 😃

As for DHTs, there are some ideas for building in some degree of anonymity, such as Octopus ([https://arxiv.org/pdf/1203.2668.pdf](https://arxiv.org/pdf/1203.2668.pdf))

The downsides of things such as Tor/I2P, apart from the dependencies, is that they are not really built to withstand an attack from a global passive adversary. Although I think I2P (& Kovri) are probably a little better than Tor.

In the case of Grin, as opposed to Tor+I2P, bandwidth is not a big requirement, so it can be sacrificed for stronger anonymity.

---

<div class="post-metadata">

**Author:** ![igno.peverell](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/igno.peverell/32/4_2.png) [@igno.peverell](https://forum.grin.mw/u/igno.peverell)\
**Post date:** [March 11, 2018, 8:07pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/11 "2018-03-11T20:07:35Z")

</div>

I wouldn’t call them Vaults, as it usually means this (that’s what I thought you were going to talk about first):

> **[How to Implement Secure Bitcoin Vaults](https://hackingdistributed.com/2016/02/26/how-to-implement-secure-bitcoin-vaults/)**
>
> We have come up with a simple and elegant technique for implementing hack-proof Bitcoin vaults, to deter Bitcoin thefts.

If you directly share peer IPs, how do you allow any privacy layer?

---

<div class="post-metadata">

**Author:** ![harry.potter](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/harry.potter/32/99_2.png) [@harry.potter](https://forum.grin.mw/u/harry.potter)\
**Post date:** [March 11, 2018, 11:10pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/13 "2018-03-11T23:10:13Z")

</div>

Very interesting.

Vaults would be a lovely thing for us to support in the future.

Let’s stick with grin wallet i.e {network name}:{pubkey / peer id}

We could begin by implementing Chord DHT and later convert it to Octopus

---

<div class="post-metadata">

**Author:** ![antioch](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/antioch/32/45_2.png) [@antioch](https://forum.grin.mw/u/antioch)\
**Post date:** [May 22, 2018, 3:03pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/14 "2018-05-22T15:03:59Z")

</div>

Just got Wireguard ([https://www.wireguard.com/](https://www.wireguard.com/)) installed on a couple of machines, primarily to test out running a personal VPN. Their “Cryptokey Routing” ([WireGuard: fast, modern, secure VPN tunnel](https://www.wireguard.com/#cryptokey-routing)) concept got me thinking back to this topic. Specifically the concept of public keys verifying point to point communication (and distributing them out of band somehow).

> At the heart of WireGuard is a concept called Cryptokey Routing, which works by associating public keys with a list of tunnel IP addresses that are allowed inside the tunnel. Each network interface has a private key and a list of peers. Each peer has a public key. Public keys are short and simple, and are used by peers to authenticate each other. They can be passed around for use in configuration files by any out-of-band method, similar to how one might send their SSH public key to a friend for access to a shell server.

> In other words, when sending packets, the list of allowed IPs behaves as a sort of routing table, and when receiving packets, the list of allowed IPs behaves as a sort of access control list.

Makes me wonder if this might be worth a deeper look - I could imagine a possible world where each Grin wallet endpoint is running an embedded WireGuard and communicates with other endpoints based on an “internal” (to the VPN) IP and a known public key.

Edit: adding some info on the Wireguard protocol and encryption used (mainly a wishlist of modern “best practice”) -

> **[Protocol & Cryptography - WireGuard](https://www.wireguard.com/protocol/)**

- ChaCha20 for symmetric encryption, authenticated with Poly1305, using RFC7539’s AEAD construction
- Curve25519 for ECDH
- BLAKE2s for hashing and keyed hashing, described in RFC7693
- SipHash24 for hashtable keys
- HKDF for key derivation, as described in RFC5869

Wireguard is an implementation of the Noise Protocol [http://noiseprotocol.org/](http://noiseprotocol.org/)

---

<div class="post-metadata">

**Author:** ![dewdeded](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/dewdeded/32/60_2.png) [@dewdeded](https://forum.grin.mw/u/dewdeded)\
**Post date:** [June 24, 2018, 12:39pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/15 "2018-06-24T12:39:12Z")

</div>

> [@harry.potter](#):
>
> or what you are suggesting… we need our own DNS system to provide addresses or wallet URLS as you call them. I’d preffer to call them Vaults that are similar to a bitcoin wallet address in that it is base58 text.

Could his suggestion not be done with [https://openalias.org/](https://openalias.org/) ?

---

<div class="post-metadata">

**Author:** ![harry.potter](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/harry.potter/32/99_2.png) [@harry.potter](https://forum.grin.mw/u/harry.potter)\
**Post date:** [June 24, 2018, 8:10pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/16 "2018-06-24T20:10:48Z")

</div>

i dont know, octopus dht just needs a chord implementation to begin with

---

<div class="post-metadata">

**Author:** ![tianshi](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@tianshi](https://forum.grin.mw/u/tianshi)\
**Post date:** [July 9, 2018, 4:20am UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/17 "2018-07-09T04:20:15Z")

</div>

Welcome to Matrix  
An open network for secure, decentralized communication  
[matrix.org](http://matrix.org)

---

<div class="post-metadata">

**Author:** ![lehnberg](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/lehnberg/32/159_2.png) [@lehnberg](https://forum.grin.mw/u/lehnberg)\
**Post date:** [July 9, 2018, 11:27am UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/18 "2018-07-09T11:27:30Z")

</div>

@tianshi I’ve been looking at Matrix as well in the context of transaction building. Do you have hands on experience using it? It appeared a bit… unstable and full of friction… last time I checked it out.

---

<div class="post-metadata">

**Author:** ![tromp](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/tromp/32/22_2.png) [@tromp](https://forum.grin.mw/u/tromp)\
**Post date:** [July 14, 2018, 7:30am UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/20 "2018-07-14T07:30:33Z")

</div>

Because there are no addresses in Mimblewimble and transacting requires interaction between sender and receiver.

---

<div class="post-metadata">

**Author:** ![tromp](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/tromp/32/22_2.png) [@tromp](https://forum.grin.mw/u/tromp)\
**Post date:** [July 14, 2018, 4:13pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/22 "2018-07-14T16:13:44Z")

</div>

No; the wallet doesn’t care what IP address you use. It scans all new outputs and rangeproofs to see which ones could have been produced from your private keys.

---

<div class="post-metadata">

**Author:** ![tromp](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/tromp/32/22_2.png) [@tromp](https://forum.grin.mw/u/tromp)\
**Post date:** [July 14, 2018, 4:59pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/24 "2018-07-14T16:59:39Z")

</div>

You could create outputs in advance if you knew the amount to receive, but you still need interaction with the sender to create the transaction, so there’s no point in doing that.

---

<div class="post-metadata">

**Author:** ![tianshi](https://avatars.discourse-cdn.com/v4/letter/t/8dc957/32.png) [@tianshi](https://forum.grin.mw/u/tianshi)\
**Post date:** [August 2, 2018, 2:09pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/26 "2018-08-02T14:09:52Z")

</div>

> **[libp2p/libp2p](https://github.com/libp2p/libp2p)**
>
> A modular and extensible networking stack which solves many challenges of peer-to-peer applications. - libp2p/libp2p

  
i think its better for grin

---

<div class="post-metadata">

**Author:** ![condiosluzverde](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/condiosluzverde/32/827_2.png) [@condiosluzverde](https://forum.grin.mw/u/condiosluzverde)\
**Post date:** [January 4, 2019, 2:26pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/27 "2019-01-04T14:26:55Z")

</div>

I am interested in how IPFS protocols and implementations can be used in communication or collaboration between senders and recipients of grin.

To broaden the reference resources, see the following:

- IPFS - [https://ipfs.io/](https://ipfs.io/)

And perhaps more specifically regarding URL format:

- IPLD - [https://ipld.io/](https://ipld.io/)

---

<div class="post-metadata">

**Author:** ![lehnberg](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.grin.mw/lehnberg/32/159_2.png) [@lehnberg](https://forum.grin.mw/u/lehnberg)\
**Post date:** [January 4, 2019, 4:21pm UTC](https://forum.grin.mw/t/grin-wallet-url-format/188/28 "2019-01-04T16:21:37Z")

</div>

> <https://github.com/mimblewimble/grin/issues/1798>

[Next page](https://forum.grin.mw/t/grin-wallet-url-format/188.md?page=2)
