-
Notifications
You must be signed in to change notification settings - Fork 51
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
Proposal: moneyd with Multiple Currencies / Uplinks #90
Comments
It's a bit rare that you'll be using the same instance of moneyd to do sending and receiving. Codius hosts, for example, are typically run on a remote machine. I guess in the future you might have some kind of wallet that does sending and receiving, though. On currency aware applications, I think the use of currencies to denominate amounts should be separate from the actual currency that the uplink is configured with. If we used something like landmark-based price discovery (as in https://github.com/interledgerjs/ilp-price) then any application could denominate amounts in any currency that the user specifies, so long as there's a destination on the network that supports it. |
Clarifying question: Are you suggesting that local clients of I am assuming the former...
I don't think it would be a good idea to break the Given that 'moneyd' listens on a single default port, how would you propose it differentiate between clients that use different currencies?
Part of our TODO list for the new connector architecture is to update
I think they have to be otherwise it becomes very difficult to, for example, run an SPSP server because you can't tell clients what asset you accept. |
The experience I'm imagining is for what a user or developer would run on their local machine. Right now it is exceptionally difficult to get yourself set up locally to try out ILP and use features like sending cross-currency payments. This makes it hard for us to get more developers interested in using ILP and building with it.
Both
Good point. Agreed.
I meant should applications be able to specify what currency they're using. They definitely need to be able to find out what they are using once they're connected. |
As Evan noted, we agree that whatever app is used to connect to Interledger should support multiple uplinks simultaneously, for different currencies. We've been working on an SDK and desktop wallet that implements this concept for cross-currency exchanges. (Unfortunately, this has taken longer than we anticipated, as working through the UX has exposed challenges in some of the plugins/underlying infrastructure -- slow settlements, handling fees, etc).
👍I really like the idea of spawning a new "account" per application, e.g. to enable per-client balance limitations. Also seems like a natural way to implement choosing a specific currency. However, I don't think you'd want a new uplink for each client/how would that work? |
I'm not a big fan of the idea of spawning a new account/plugin per client that connects. I think we should move in a more stateless direction such that the most that's stored in memory is a way to correlate ILP Prepare packets with the Fulfill/Reject. |
I don't really follow this. You seem to be mixing concepts. Request/reply correlation is one thing but plugins do a lot more (like dealing with settlement). If you don't have a plugin for each client, how does a client settle with the connector? Do you not track a balance for each client at all? The If you don't want to do settlement you could spawn a "pass-through" plugin. |
I'm thinking you'd track the in the database without instantiating anything in memory for that client. Settlement could either be done when the balance in the db gets to a certain level or there could be a separate payment channel manager that does that. |
I feel like we're conflating two separate things. While today spawning a new "account" instantiates a plugin and middleware stack (in the connector refactor), it's conceivable that it could load account-related data from the DB on a per-request/as-needed basis and keep very little in the V8 memory (only persistent services, e.g. the BTP server/connection, an LND/eth node/Rippled connection, and/or channel watcher). (Evan's argument I think being that (e.g.) Redis is more optimized from a memory standpoint compared to keeping everything in JS throughout the connection). Regardless of whether we go in that direction, I'm just saying I like the notion of each account/client connection having its own unique middleware config, for the moneyd use case. |
moneyd
was originally envisioned as a daemon for holding a single currency that would let the user send and receive all Interledger payments from a single account. However, as pointed out by @karzak and @kincaidoneil, among others, many people want to be able to transact and trade multiple currencies. Previously, the question we asked was howmoneyd
or applications connected to it would determine what currency to use at a given moment. The assumption was that we would needmoneyd
to have a local view of the respective value of the currencies in order to decide automatically.We should:
moneyd
to connect to multiple uplinks at the same timeThis is partially inspired by the experience of using
rustup
with Rust. You can install multiple versions of the rust compiler and toolchain (rustup install stable
), set the default toolchain to use (rustup default nightly
), and then run specific commands using a given toolchain (rustup run stable <command>
). (This isn't a perfect comparison becausemoneyd
is a daemon that keeps running, rather than a toolchain you'll use to run a single command.)Open questions:
moneyd
while it is set to use one currency, should that application keep using that currency even if moneyd's settings change?spsp server --asset=XRP --port=3000 && spsp pay --asset=ETH --receiver=http://localhost:3000 --amount 10000
What do you think?
The text was updated successfully, but these errors were encountered: