-
Notifications
You must be signed in to change notification settings - Fork 95
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
multi: implement user onboarding game #2921
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
utAck.
How can I generate a prepaid bond that is not tied to an account?
func (dcr *ExchangeWallet) RedeemGeocode(code []byte, msg string) (dex.Bytes, uint64, error) { | ||
msgLen := len([]byte(msg)) | ||
if msgLen > stdscript.MaxDataCarrierSizeV0 { | ||
return nil, 0, fmt.Errorf("message is too long. must be %d > %d", msgLen, stdscript.MaxDataCarrierSizeV0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: must be %d < %d
// prepaid bond (code is a prepaid bond). If the user is not registered with | ||
// dex.decred.org yet, the dex will be added first. | ||
func (c *Core) RedeemGeocode(appPW, code []byte, msg string) (dex.Bytes, uint64, error) { | ||
const dcrBipID = 42 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should use the const from the network pkg? And say that this supports only dcr codes in the comment.
host := "dex.decred.org:7232" | ||
switch c.net { | ||
case dex.Testnet: | ||
host = "bison.exchange:17232" | ||
case dex.Simnet: | ||
host = "127.0.0.1:17273" | ||
} | ||
cert := CertStore[c.net][host] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Host should be a param. Maybe make it be part of the code?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that the server should be a parameter, but it can't be "part of the code". If we expand this, we'll just have to note the server on the paper in the cache. That would, of course, add friction when the user redeems, so I'm avoiding that for now. May change later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to follow up, here is my reasoning for hard-coding the hosts.
- When we make the host a parameter, we will be adding more steps and new things to break.
- We could start with radio buttons for our "known servers", but there is only one public mainnet server right now anyway.
- We could add an input field for a custom host, but since we're so late in the release cycle, I want to minimize new code, and I think there's a balance to be struck
* implement geogame * internationalize * remove superfluous module
This introduces functionality to play a geocache-like marketing game wherein we publish the GPS coordinates to caches placed in the real world that contain a code redeemable for DCR and a prepaid bond. Here's how it works
The user also has the option to encode a message of up to 256 characters in their redemption transaction.
Tested on testnet and mainnet.