Skip to content
This repository has been archived by the owner on Jan 13, 2025. It is now read-only.

Add drone RFC #1754

Merged
merged 5 commits into from
Nov 14, 2018
Merged

Add drone RFC #1754

merged 5 commits into from
Nov 14, 2018

Conversation

garious
Copy link
Contributor

@garious garious commented Nov 9, 2018

Goal

The goal of this RFC is to define an airdrop mechanism that authorizes funds
for a particular use.

Background

To run an on-chain program, a client must first acquire tokens to pay a Solana
cluster a transaction fee to instantiate the program. To acquire the tokens,
the client might request them from a special client called a drone.

Problems

  1. Once the client has tokens to instantiate the program, the client may choose
    to simply keep them.
  2. Loading a program requires two transaction fees - one for the airdrop and
    one to load the program.

Summary of Changes

Added RFC to propose a new term "stamp" to formalize a convention of sharing a signed transaction to authorize users to run programs without first needing tokens.

@garious garious requested review from aeyakovenko and mvines November 9, 2018 09:11
rfcs/0010-stamps.md Outdated Show resolved Hide resolved

## Example usage

Creator of on-chain game tic-tac-toe hosts a drone that responds to airdrop
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

BYOD seem tedious and very anti-chain. Perhaps an account can signal somehow that it's willing to pay the transaction fee for certain kinds of instructions, so joe public can get bootstrapped without using the s word (server that is).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. The general theme of Solana has been to move any off-chain functionality onto the chain. I see this stamps technique as sufficient, not ideal. In the current system, the fee is collected before the instruction is executed. We'd need to add another "who's buying?" entrypoint. A separate RFC? Perhaps even described as one intending to render this one obsolete?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If stamps are not ideal, what is driving this RFC? Can we wait until we can implement the ideal?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's driving the RFC is that the Tabletops release should require fees for all transactions but wanting to continue offering on-chain games that can be played by users without any tokens. This RFC offers a convention for doing that without any rearchitecture.

Copy link
Member

@aeyakovenko aeyakovenko Nov 10, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garious, so the drone can always pre-sign the transaction with a key to just pay the the fee and have the user sign the other key for actual execution

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you paraphrasing this RFC?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the point of the user signature. In this example, they are being given a game instance.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@garious upon closer inspection, yes :). I think the "stamp" wording is confusing. The functional part is multiple signatures per transaction, and instructions referencing any subset of the transaction keys. It's hard to infer that from the rfc

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see the point of the user signature. In this example, they are being given a game instance.

@garious if the original program requires the signature for the instruction's 0 key, the user would supply it. It would be up to the program.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@aeyakovenko, I don't see what problem is solved with a user signature. Maybe there's something I can do to clarify the scope of the RFC?

@garious
Copy link
Contributor Author

garious commented Nov 10, 2018

@CriesofCarrots rpc::tests::test_rpc_send_tx caused CI to fail

@garious
Copy link
Contributor Author

garious commented Nov 12, 2018

@mvines, do you approve of the method described by this RFC?

@mvines
Copy link
Contributor

mvines commented Nov 12, 2018

Yeah what we discussed on the call sounds good. I don't see that as being an exact 1-1 with what's current in this RFC but I get the intent that that's good enough for me. Filed #1786 for giving this a try sometime soon-ish

@garious
Copy link
Contributor Author

garious commented Nov 12, 2018

Good point, we discussed the possibility of a signing service being a more general purpose solution. That method might not use the term "stamp" or might use it with a different meaning such as, "stamping transactions with a signature after validation." Let's leave this PR open for now. I'd prefer to rewrite it than to have two RFCs, only one which is acknowledged in practice.

implement the existing drone, for example, it may only accept transaction data
with a `SystemProgram::Move` instruction transferring only up to a certain
amount of tokens. If the drone accepts the transaction, it shall return an
`Ok(Signature)` where `Signature` is a signature of the transaction data using
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There need to be a way for the user of the drone to figure the drone's public key as well for inclusion in the transaction, if the drone is only going to return a Signature.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, like it's URL it could be static and published. Alternatively, the drone's API can include a method for querying it.

rfcs/0010-drones.md Outdated Show resolved Hide resolved
the ledger. The client may do this maliciously or simply because it thinks the
first request was dropped. The drone should not simply query the cluster to
ensure the client has not already received an airdrop. Instead, it should use
`last_id` to ensure the previous request is expired before signing another.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does one determine the age of a last_id?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't offer a good way right now. We need a light client RFC for clients that just want to do PoH verification using a hash of each entry's transactions. This drone would be a light client and so would keep a recent_ids queue like the bank does. If the user's last_id is in the queue, it's not too old.

### Denial of Service

If the transaction data size is smaller than the size of the returned signature
(or descriptive error), a single client can flood the network. Considering
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't follow how a single client could flood the network in this case?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Say the input size was half the output size. Then a client can send 1/2 gbps of requests and see the drone flood the network 1 gbps of response data, preventing anyone else from getting responses.

@garious garious changed the title Add stamps RFC Add drone RFC Nov 14, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants