Post
Topic
Board Project Development
Merits 1 from 1 user
Re: "Proof of Work" - A game about the history of Bitcoin
by
askii
on 26/05/2025, 01:02:03 UTC
⭐ Merited by stwenhao (1)
Now I can generate addresses, based on seeds. There are only 2^32 possible combinations, so now I know, how exchange addresses were generated:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I also reached vanity address generator. However, it requires real Proof of Work, so it takes some effort, to mine addresses with given prefixes:
------------------------------------------------------------------------------------------------------------------------------------------------------------------------

I wonder, if future versions would allow importing 32-bit seeds, and hacking into different wallets.

By the way: in the past, some people lost real coins, by using weak seeds, so your code refers to things, which really happened.
Very amusing! Perhaps I should increase the range of seeds to allow for some more creativity. But yes, I do indeed plan on adding functionality to create wallets with mnemonic seed phrases (in-game BIP39 update), brainwallets, stealing funds, all of the above. I really want to emphasise private key storage security as well, e.g., if you click on a strange link, you might get a virus which will steal your keys from storage or memory, so even in the game it's safer to write down your seed phrases in real life, or buy a hardware wallet in the game.


Edit: I think I have a name for OP_CHECKSIG, if you will ever want to implement Script: OP_CHECKSEED. It should verify, that the transaction creator knows the seed, without revealing it explicitly, like I did. Now, I will try to explore, how seeds are picked, so maybe you could use them as public keys, and pick something else as a private key. I also wonder, how signatures should look like.
My initial idea, which I temporarily discarded for simplicity, was to have gen_privkey(seed) -> gen_pubkey(privkey), whenever generated, the game will store these keypairs internally. For signatures, I can just write a gen_sig(privkey, data), where in the game's db, each signature is referenced as "belonging" to a private key/data pair.

Since the player is the only entity we need to worry about being able to sign and spend transactions, OP_CHECKSIG could be as simple as "what private key was this signature generated from, is the data correct, and does that private key generate the public key". From an educational/realism standpoint, I think it would fake ECDSA well enough  Wink Cheating isn't really something I'll bother to do anything about right now, it's a singleplayer game and really it's the player's choice if they want to cheat etc. In a multiplayer setting, you would obviously have to use actual cryptography libraries, but I can keep it simpler for now.

As far as I know, there are two secret commands: one is "p2pcurrency", and another one is what we are supposed to guess. I think I know the command to the first secret, but for unknown reason, it shows just some Unicode garbage, instead of showing some meaningful message, like "p2pcurrency" does.

So, should I dig deeper, and try to write some code, to decrypt that Unicode garbage, or is it just a bug, which should be fixed?
That's really strange... no, that is not intentional, if you get it right (and enter it in the SATMiner console) it should show up as legible text, not unicode garbage.
If you get it wrong, it should not output anything, it should throw an error along the lines of an "Operation failure. I guess it depends on what browser you're using - if you maybe want to PM with your browser and the command that you tried, I'll try to see if I can recreate it and find out what the problem is.

Just a heads up though, the first secret is just a stupid in-joke between me and some of my friends  Cheesy I'll add a lot more actually interesting secrets down the line.