Skip to content

Commit

Permalink
Change to SpreadCoin
Browse files Browse the repository at this point in the history
  • Loading branch information
bitbandi committed May 18, 2015
1 parent cd1a728 commit 4a662ea
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 34 deletions.
8 changes: 4 additions & 4 deletions keyconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ main(int argc, char **argv)

if (generate) {
unsigned char *pend = (unsigned char *) pbuf;
addrtype = 0;
privtype = 128;
addrtype = 63;
privtype = 191;
EC_KEY_generate_key(pkey);
res = i2o_ECPublicKey(pkey, &pend);
fprintf(stderr, "Pubkey (hex): ");
Expand Down Expand Up @@ -182,9 +182,9 @@ main(int argc, char **argv)
}

switch (privtype) {
case 128: addrtype = 0; break;
case 191: addrtype = 63; break;
case 239: addrtype = 111; break;
default: addrtype = 0; break;
default: addrtype = 63; break;
}

if (verbose) {
Expand Down
17 changes: 6 additions & 11 deletions oclvanitygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ usage(const char *name)
fprintf(stderr,
"oclVanitygen %s (" OPENSSL_VERSION_TEXT ")\n"
"Usage: %s [-vqrik1NTS] [-d <device>] [-f <filename>|-] [<pattern>...]\n"
"Generates a bitcoin receiving address matching <pattern>, and outputs the\n"
"Generates a spreadcoin receiving address matching <pattern>, and outputs the\n"
"address and associated private key. The private key may be stored in a safe\n"
"location or imported into a bitcoin client to spend any balance received on\n"
"location or imported into a spreadcoin client to spend any balance received on\n"
"the address.\n"
"By default, <pattern> is interpreted as an exact prefix.\n"
"By default, if no device is specified, and the system has exactly one OpenCL\n"
Expand All @@ -57,8 +57,7 @@ usage(const char *name)
"-i Case-insensitive prefix search\n"
"-k Keep pattern and continue search after finding a match\n"
"-1 Stop after first match\n"
"-N Generate namecoin address\n"
"-T Generate bitcoin testnet address\n"
"-T Generate spreadcoin testnet address\n"
"-X <version> Generate address with the given version\n"
"-e Encrypt private keys, prompt for password\n"
"-E <password> Encrypt private keys with <password> (UNSAFE)\n"
Expand Down Expand Up @@ -86,8 +85,8 @@ version, name);
int
main(int argc, char **argv)
{
int addrtype = 0;
int privtype = 128;
int addrtype = 63;
int privtype = 191;
int regex = 0;
int caseinsensitive = 0;
int opt;
Expand Down Expand Up @@ -123,7 +122,7 @@ main(int argc, char **argv)
int i;

while ((opt = getopt(argc, argv,
"vqik1NTX:eE:p:P:d:w:t:g:b:VSh?f:o:s:D:")) != -1) {
"vqik1TX:eE:p:P:d:w:t:g:b:VSh?f:o:s:D:")) != -1) {
switch (opt) {
case 'v':
verbose = 2;
Expand All @@ -140,10 +139,6 @@ main(int argc, char **argv)
case '1':
only_one = 1;
break;
case 'N':
addrtype = 52;
privtype = 180;
break;
case 'T':
addrtype = 111;
privtype = 239;
Expand Down
10 changes: 5 additions & 5 deletions oclvanityminer.c
Original file line number Diff line number Diff line change
Expand Up @@ -554,13 +554,13 @@ dump_work(avl_root_t *work)
wip != NULL;
wip = workitem_avl_next(wip)) {
printf("Pattern: \"%s\" Reward: %f "
"Value: %f BTC/Gkey\n",
"Value: %f SPR/Gkey\n",
wip->pattern,
wip->reward,
wip->value);
}
if (pbatch->nitems > 1)
printf("Batch of %d, total value: %f BTC/Gkey\n",
printf("Batch of %d, total value: %f SPR/Gkey\n",
pbatch->nitems, pbatch->total_value);
}
}
Expand Down Expand Up @@ -639,7 +639,7 @@ server_context_submit_solution(server_context_t *ctxp,
POINT_CONVERSION_UNCOMPRESSED,
NULL);
snprintf(urlbuf, sizeof(urlbuf),
"%s?key=%s%%3A%s&privateKey=%s&bitcoinAddress=%s",
"%s?key=%s%%3A%s&privateKey=%s&spreadcoinAddress=%s",
ctxp->submit,
work->pattern,
pubhex,
Expand Down Expand Up @@ -1024,7 +1024,7 @@ main(int argc, char **argv)
wip = workitem_avl_next(wip)) {
fprintf(stderr,
"Searching for pattern: \"%s\" "
"Reward: %f Value: %f BTC/Gkey\n",
"Reward: %f Value: %f SPR/Gkey\n",
wip->pattern,
wip->reward,
wip->value);
Expand All @@ -1043,7 +1043,7 @@ main(int argc, char **argv)
}

fprintf(stderr,
"\nTotal value for current work: %f BTC/Gkey\n",
"\nTotal value for current work: %f SPR/Gkey\n",
active_pkb_value);
res = vg_context_start_threads(vcp);
if (res)
Expand Down
6 changes: 5 additions & 1 deletion pattern.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,9 +1390,13 @@ vg_prefix_context_add_patterns(vg_context_t *vcp,
const char *ats = "bitcoin", *bw = "\"1\"";
switch (vcpp->base.vc_addrtype) {
case 5:
ats = "bitcoin script";
ats = "spreadcoin script";
bw = "\"3\"";
break;
case 63:
ats = "spreadcoin";
bw = "\"S\"";
break;
case 111:
ats = "testnet";
bw = "\"m\" or \"n\"";
Expand Down
2 changes: 1 addition & 1 deletion util.c
Original file line number Diff line number Diff line change
Expand Up @@ -880,7 +880,7 @@ vg_decode_privkey_any(EC_KEY *pkey, int *addrtype, const char *input,
res = vg_pkcs8_decode_privkey(pkey, input, pass);
if (res > 0) {
/* Assume main network address */
*addrtype = 128;
*addrtype = 191;
}
return res;
}
Expand Down
18 changes: 6 additions & 12 deletions vanitygen.c
Original file line number Diff line number Diff line change
Expand Up @@ -296,9 +296,9 @@ usage(const char *name)
fprintf(stderr,
"Vanitygen %s (" OPENSSL_VERSION_TEXT ")\n"
"Usage: %s [-vqnrik1NT] [-t <threads>] [-f <filename>|-] [<pattern>...]\n"
"Generates a bitcoin receiving address matching <pattern>, and outputs the\n"
"Generates a spreadcoin receiving address matching <pattern>, and outputs the\n"
"address and associated private key. The private key may be stored in a safe\n"
"location or imported into a bitcoin client to spend any balance received on\n"
"location or imported into a spreadcoin client to spend any balance received on\n"
"the address.\n"
"By default, <pattern> is interpreted as an exact prefix.\n"
"\n"
Expand All @@ -311,8 +311,7 @@ usage(const char *name)
"-i Case-insensitive prefix search\n"
"-k Keep pattern and continue search after finding a match\n"
"-1 Stop after first match\n"
"-N Generate namecoin address\n"
"-T Generate bitcoin testnet address\n"
"-T Generate spreadcoin testnet address\n"
"-X <version> Generate address with the given version\n"
"-F <format> Generate address with the given format (pubkey or script)\n"
"-P <pubkey> Specify base public key for piecewise key generation\n"
Expand All @@ -331,9 +330,9 @@ version, name);
int
main(int argc, char **argv)
{
int addrtype = 0;
int addrtype = 63;
int scriptaddrtype = 5;
int privtype = 128;
int privtype = 191;
int pubkeytype;
enum vg_format format = VCF_PUBKEY;
int regex = 0;
Expand Down Expand Up @@ -361,7 +360,7 @@ main(int argc, char **argv)

int i;

while ((opt = getopt(argc, argv, "vqnrik1eE:P:NTX:F:t:h?f:o:s:")) != -1) {
while ((opt = getopt(argc, argv, "vqnrik1eE:P:TX:F:t:h?f:o:s:x")) != -1) {
switch (opt) {
case 'v':
verbose = 2;
Expand All @@ -384,11 +383,6 @@ main(int argc, char **argv)
case '1':
only_one = 1;
break;
case 'N':
addrtype = 52;
privtype = 180;
scriptaddrtype = -1;
break;
case 'T':
addrtype = 111;
privtype = 239;
Expand Down

1 comment on commit 4a662ea

@cryptoons
Copy link
Member

Choose a reason for hiding this comment

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

There seems to be an issue with this update.
Please read my comment: https://bitcointalk.org/index.php?topic=1045373.msg11511322#msg11511322

Please sign in to comment.