opened
not-an-aardvark
username_0
In the long-term, we would like to have a 3DS Homebrew app that allows uploading to Porybox. However, it might be annoying to have to input your Porybox username and password into a 3DS, and it also leads to complications if the person who uploads the pk6 does not want to actually be its owner (e.g. if they are checking a Pokémon for someone else).

So I think it would be good to have a flow for anonymously uploading:

* A client, usually on a 3DS, sends one or more pk6 files to the server
* The server returns an unguessable, randomly-generated "claim code" to the client
* The homebrew app displays the claim code on the screen so that the user can read it
* Using a computer, the user logs into Porybox and enters the claim code into a form
* The uploaded pk6 files get moved to the client's account

This would provide a secure method for people to upload files anonymously from a 3DS, and claim them later. It would also allow people to check things and upload for other users; the checker could upload the data anonymously, then send the claim code to the Pokémon's owner, then the owner would type the claim code into Porybox.

---

Functional requirements for the porybox website:

* The server must have a method to accept pk6 data<sup>1</sup> without the client being logged in.
* The server must tie a valid uploaded chunk of data<sup>1</sup> to a unique, unguessable claim code.
  * Ideally the claim code should be human-readable, and short enough to type in manually without too much annoyance.
* If the uploaded data is invalid/unreadable/malformed, the server should reject it, and must not send a claim code. (i.e. validation should take place when the data is uploaded, not when it's claimed.)
* If the uploaded data is valid and readable but contains Pokémon that are prohibited from being uploaded (e.g. Kyurem-W), the server must accept all the Pokémon that are not prohibited and still send a claim code. The server should also indicate to the client that some of the uploads failed. When the client redeems this claim code, the prohibited Pokémon should not be included in the data that gets sent to the client's account.
* The client must be able to enter that claim code on the website, and send it to the server.
* If the ID number matches a previously-uploaded chunk of data<sup>1</sup>, that chunk of data gets sent to the account of the user that entered the claim code.
* If the ID number does not match any previous upload, the server must return an error and not transfer any data to the user's account. Codes should be case-sensitive if being case-sensitive increases their entropy (e.g. they should be case-sensitive if they're generated as base64, but not if they're generated as hex strings).
* If the user enters an ID number that has already been claimed by someone else, the server must return an error and not transfer any data to the user's account.
  * If two users enter the same claim code at the same time, only one of the requests should succeed (i.e. avoid race condition bugs)
* The server should provide a method for a client to verify that a claim code is valid, without actually redeeming it. This would be useful for event checkers to double-check that they are sending the owner the correct claim code.

<sup>1</sup> The server should be able to accept more than one pk6 file at a time; if a user wanted to upload their entire save from a 3DS, it would be very tedious to enter a claim code for each Pokémon. Possibly limit the upload size to 1000 Pokémon at a time; this would still be a reasonably small payload (200-300KB) and it would allow users to upload entire saves with only one claim code.

Questions to address:

* Should unclaimed uploads be deleted after a certain amount of time?
* What should claim codes look like? Hex strings are long enough that they're annoying to type. Some options include:
  * base64 strings (short with high entropy, but might contain some characters that are hard to read, e.g. 'I' vs 'l'
  * Random strings of a reduced set of characters (e.g. never include 'O' because it could be confused with '0')
  * Strings containing multiple random English words (easier to type, but the would need to be longer in order to have enough entropy)
* Should it be possible to view the contents of an unclaimed upload without redeeming it? This would allow for giveaways of the form "here's what I'm giving away, and I'll give you the claim code if you win the contest". However, it might complicate things a bit, because it would require us to have visibility settings for unclaimed things (and someone might want to make unclaimed things private, rather than viewable).
Spec for allowing anonymous uploads
issue
created
NotRaia
username_1
I like the idea, and it looks good so far.

Answers to questions:

* Yes, we should probably delete unclaimed things after 24-48 hours.
* I don't really like base64 strings because they're a pain to type. I would prefer options 2 or 3.
* Maybe limit showing the contents to just a list of species? I'm not really sure I understand the visibility issue though.
comment
created
not-an-aardvark
username_0
* Deleting unclaimed things after awhile: My concern is that if a checker does a check for an owner, and the owner is busy/in a different timezone, they might not get around to claiming the uploads within 24-48 hours.
* The issue with visibility is that we might want to allow unclaimed things to be viewed (but not claimed) by linking to them, the same way that we allow people to link to Pokémon without downloading them. This might require us to give unclaimed things a "private" setting if people wanted to opt-out of having their anonymous upload viewable with a link. Allowing uploads to be viewed with a link would also require us to display another random ID to the user when they upload, since they would need to have the link to view the uploaded thing.
comment
created
NotRaia
username_1
I probably wouldn't want to do links just to keep it simple. I think the main purpose of anonymous uploads should just be to get your files online; we probably don't need to consider giveaways.

I'm envisioning something like Mystery Gift, where you enter a code to get a preview of what you're receiving, then select Yes/No on whether you want to claim it.
comment
created
not-an-aardvark
username_0
Maybe delete it after 7 days or so? 24 hours just seems a bit too short in my opinion.
comment
created
NotRaia
username_1
7 days sounds like a lot of time to leave possibly hundreds of files in limbo, but I agree that 24 hours is too short. I'd lean towards 48-72 hours.
comment
created
TheSonAlsoRises
username_2
The outline seems good so far!

* I think 72 hours should be enough to claim the Pokémon.
* Typing a chain of 30 random characters when setting up the 3DS WiFi was painful enough. I think random English words would be a lot easier to input, even if they take longer to type.
* Probably not worth the effort in my opinion.
comment