Replying to Avatar gsovereignty

Problem: paid relays are difficult to run

Nostr is increasingly relying on paid relays, but they are expensive to run and difficult to scale.

The skill set required to manage paid relays is considerably diverse, covering many differing fields of expertise.

The work of relay operators is often duplicated by other operators, making the overall economics less efficient than it could be.

The risk of doing all of this needs to be taken by a single person, and the only real way to spread this risk out at the moment is to create some kind of centrally planned business structure.

### Possible Solution:

Deploy a Rocket to manage a set of paid relays.

Separate out the different skills involved in running a paid relay such that there are more people available because the required skill set is narrower.

Developers can focus on incrementally solving problems to improve the relay software.

Devops guys can focus on devops stuff.

Frontend guys can focus on making it easy for users to subscribe.

Everyone who's solving problems in the critical path becomes a merit holder, as is standard behaviour under the nostrocket protocol.

Payment for subscribing to the paid relay set goes directly to merit holders in proportion to their merits, as is standard under the non-custodial nostrocket protocol.

### How this might work

This would start with a single relay, deployed by this Rocket's first contributor.

Problem: there is no relay deployed under this Rocket.

Solution: first contributor deploys an instance of the Rocket's relay (probably just nostr-rs-relay with a grpc management layer).

The relay subscribes to the Nostrocket state to get a list of allowed pubkeys (people who have paid this "relay" Rocket).

The first contributor submits a merit requests for the cost of the VPS and his time (and approves it himself).

When there's a problem that falls outside of his domain of expertise or outside his time constraints (e.g. perhaps something to do with the relay implementation), he logs a problem in the relay Rocket's branch of the problem tracker.

If he was fair and reasonable with his first merit request, then perhaps someone with the required skill set will send a patch to resolve the problem, and then submit a merit request for this. If the first contributor approves the solution, this second contributor now has merits to vote on subsequent merit requests. By definition, both parties completely agree that the number of merits each now holds are in direct proportion to the value of the work they did to contribute to this paid relay rocket.

When users pay to join the relay, the payments round-robin between these two merit holders, weighted by the percentage of merits they hold. This makes payments to the set of merit holders non-custodial and eventually-consisitent with the "cap table" of this rocket. This is standard behaviour for all payments for products/services created through Nostrocket.

Now when there's a problem that is in neither of these two contributors field of expertise, perhaps someone else will contribute. And the process continues.

If there's a problem with spam, this probably something that can be improved upon with a patch from a developer.

If users are having trouble subscribing because the web interface sux, a frontend guy can solve that with a patch.

### Architecture of the relay set

The architecture of the relay set would probably be something like this:

Relays forward all incoming events that they haven't seen before to all the other relays in the set, so that new events can then be seen on any relay in the set.

Paid users only need to connect to a single relay in the set.

They should connect to whichever one is fastest for them. Would be pretty easy to make a simple PWA to find the fastest one.

If there are not enough relay deployments available to handle the number of paid users, that's simply a problem to solve. It could be solved by the first contributor if they have the time and inclination administer a second instance, or it could be solved by anyone else, by deploying a new instance of the same relay software.

Since each relay instance can be run by different people, there's redundancy not only in terms of technical aspects but also social aspects.

If a relay operator doesn't comply with the protocol (perhaps they take payments directly instead of through the official channels), then the merit holders would probably vote to remove them from the set, and deny all further merit requests by them. This would also be the case if they are unable to continue solving the original problem (making a relay available). Shouldn't be too hard to write a script to solve the problem of validating uptime and speed standards.

Anyway, just an idea.

Problem: don't have an easy way to deploy a new relay

There's currently no super easy way to deploy a new relay that can subscribe to nostrocket state.

Solution:

A build script that can be executed to install everything required to deploy a relay that authorizes pubkeys based on nostrocket state.

Reply to this note

Please Login to reply.

Discussion

Problem: no way for the relay to see which pubkeys have paid

There is currently no way to do this because payments haven't been implemented in the Nostrocket Engine yet.

As per the Nostrocket Unprotocol, payments for products/services need to round-robin between the lightning addresses of merit holders, weighted by how many merits they have so that it is eventually-consistent.

I'm tagging [Problem: no way for the relay to see which pubkeys have paid] with the Rocket: nostrocket

I'm tagging [Problem: no way for the relay to see which pubkeys have paid] with the Rocket: nostrocket

I'm claiming [Problem: no way for the relay to see which pubkeys have paid] on the nostrocket problem tracker so that I can work on it and other people don't duplicate my efforts.

I previously claimed [Problem: no way for the relay to see which pubkeys have paid] on the nostrocket problem tracker, but I'm not abandoning it and freeing it up for other people to claim.

Problem: can't derive the next payment address from current state of nostrocket

There's currently no implementation of the nostrocket payment round-robin algorithm.

This is core to nostrocket being non-custodial.

Using lightning prisms is one option, but there are currently no best practices to make this non-custodial, it currently relies on lightning nodes to do the actual work of splitting the payments and forwarding the sats to multiple wallets. This is not an option for Nostrocket because it must remain non-custodial and therefor cannot recieve payments.

Payments for products/services created through Nostrocket must go directly to the meritholders of the rocket recieving the payment.

The Nostrocket payment round-robin is an algorithm to determine the next-payment-address from the current set of merit-holders such that incoming payments are eventually-congruent with the proportion of merits held by pubkeys within a rocket.

This algorithm is defined in detail by the Nostrocket Unprotocol but it is not yet implemented.

I'm claiming [Problem: can't derive the next payment address from current state of nostrocket] on the nostrocket problem tracker so that I can work on it and other people don't duplicate my efforts.

I'm closing [Problem: can't derive the next payment address from current state of nostrocket] on the nostrocket problem tracker, it's been resolved or become obsolete.

Problem: can't pay for specific products/services

We can derive the next payment address from the current nostrocket state, but we can't actually store the result of payments anywhere.

Soluton:

Allow rocket maintainers to add predefined amounts (in sats) for incoming payments. This way we can create a new invoice for the next payment address for each payment amount and store this invoice in state.

When a user makes a payment, the client will publish an event that contains the preimage, proving that the payment has been made. When the state machine sees this it adds the payment to state, mapped to the pubkey of the user who paid.

This will introduce a vulnerability whereby someone could "frontrun" the preimage, but whatever it's good enough for now.

I'm claiming [Problem: can't pay for specific products/services] on the nostrocket problem tracker so that I can work on it and other people don't duplicate my efforts.

Problem: rocket products cannot recieve payments

Product's can't currently receive payments.

Solution:

Generate the next payment invoice based on the next-payment-address in state.

I'm claiming [Problem: rocket products cannot recieve payments] on the nostrocket problem tracker so that I can work on it and other people don't duplicate my efforts.

I'm closing [Problem: rocket products cannot recieve payments] on the nostrocket problem tracker, it's been resolved or become obsolete.

I'm closing [Problem: can't pay for specific products/services] on the nostrocket problem tracker, it's been resolved or become obsolete.

I'm closing [Problem: no way for the relay to see which pubkeys have paid] on the nostrocket problem tracker, it's been resolved or become obsolete.

I'm claiming [Problem: don't have an easy way to deploy a new relay] on the nostrocket problem tracker so that I can work on it and other people don't duplicate my efforts.

I'm claiming [Problem: don't have an easy way to deploy a new relay] on the nostrocket problem tracker so that I can work on it and other people don't duplicate my efforts.

I'm closing [Problem: don't have an easy way to deploy a new relay] on the nostrocket problem tracker, it's been resolved or become obsolete.