threecats
|
|
September 07, 2014, 07:29:26 PM |
|
Great article! Possible typo - did u mean to call it the Nxt ipo in the come from beyond bit?
|
|
|
|
PhilipMorris
|
|
September 07, 2014, 08:18:17 PM |
|
Great article! Possible typo - did u mean to call it the Nxt ipo in the come from beyond bit? A nice article indeed, but there's also another typo; BlueBerry instead of BoolBerry. Haha.
|
|
|
|
tk808
Legendary
Offline
Activity: 1512
Merit: 1124
Invest in your knowledge
|
|
September 07, 2014, 08:23:34 PM |
|
A nice article indeed, but there's also another typo; BlueBerry instead of BoolBerry. Haha.
I laughed at this one
|
|
|
|
jjiimm_64
Legendary
Offline
Activity: 1876
Merit: 1000
|
|
September 07, 2014, 08:33:18 PM |
|
I just tried to download the wallet from: Windows: https://mega.co.nz/#!a99DURDa!Xpb_x9QwUjfy2VcWxIEyJnSXv7JuGaRAMIwOhRkSCfE Sha-256 Download Checksum: 8815dcaae99b90a57df1041759e5ccc52593298787ee7ad70b5792b28932017e but since I am using an older version of firefox (13) I cannot download the client... WTF? I just want to download a file.... I sooo hate fancy HTML pretty dumb not to allow someone to download a file just because they dont want to use a fancy new browser!
|
1jimbitm6hAKTjKX4qurCNQubbnk2YsFw
|
|
|
visual111
|
|
September 07, 2014, 08:51:07 PM |
|
Is teleport being worked on right now?
if so, is it safe to expect to see a beta or working teleport this month?
after I get some dinner yes sorry, I didnt get a chance for dinner had to spend 1hr+ to answer an accusatory who was calling my assets a ponzi and other unethical behavior I am now in no mood for coding no teleport work till tomorrow The bigger supernet becomes, the more trolls and fudsters that will arrive. If you are going to answer every one, that will consume all your time. at worst it is a 2 week delay Ok. i think the procurement of a beta Teleport will reduce the negative noise. i myself have slipped from a very pro-BTCD stance to a much more neutral ground, due to the lack of Teleport. of course, i understand to an extent (having never arranged an ICO myself, cannot fully comprehend the work involved) how hectic Supernet has been. answering hundreds of questions and ensuring a level of fairness in distribution must be draining. i am just hoping to see evidence that teleport will actually work because as of now, it is incomplete. i can't read code so until i can use it myself i will remain neutral. as an investor it would be unwise of me to not hedge the risk that teleport might not work as planned. i wish more people would take this stance rather than attacking jl777 and spreading FUD or blindly supporting because they profited some coin with the recent rise in price of jl777 related investments i will wait and see what happens. best of luck to jl, for he is undertaking a substantially large project
|
|
|
|
Shadey
|
|
September 07, 2014, 08:58:50 PM |
|
Is teleport being worked on right now?
if so, is it safe to expect to see a beta or working teleport this month?
after I get some dinner yes sorry, I didnt get a chance for dinner had to spend 1hr+ to answer an accusatory who was calling my assets a ponzi and other unethical behavior I am now in no mood for coding no teleport work till tomorrow The bigger supernet becomes, the more trolls and fudsters that will arrive. If you are going to answer every one, that will consume all your time. at worst it is a 2 week delay Ok. i think the procurement of a beta Teleport will reduce the negative noise. i myself have slipped from a very pro-BTCD stance to a much more neutral ground, due to the lack of Teleport. of course, i understand to an extent (having never arranged an ICO myself, cannot fully comprehend the work involved) how hectic Supernet has been. answering hundreds of questions and ensuring a level of fairness in distribution must be draining. i am just hoping to see evidence that teleport will actually work because as of now, it is incomplete. i can't read code so until i can use it myself i will remain neutral. as an investor it would be unwise of me to not hedge the risk that teleport might not work as planned. i wish more people would take this stance rather than attacking jl777 and spreading FUD or blindly supporting because they profited some coin with the recent rise in price of jl777 related investments i will wait and see what happens. best of luck to jl, for he is undertaking a substantially large project If you look at the graph on cryptsy for BitcoinDark, and press the "ALL" button, you can easily see that BitcoinDark has gone nowhere but up the ENTIRE time it's been there. Clearly, BitcoinDark has some pretty damn good potential. People that hate on that obviously don't know what they're talking about. They need to be ignored, as they are only here to try and bring however many people they can down to their level with them so they're not the only ones missing out in the end lol.
|
|
|
|
visual111
|
|
September 07, 2014, 09:06:29 PM |
|
If you look at the graph on cryptsy for BitcoinDark, and press the "ALL" key, you can easily see that BitcoinDark has gone nowhere but up the ENTIRE time it's been there. Clearly, BitcoinDark has some pretty damn good potential. People that hate on that obviously don't know what they're talking about. They need to be ignored, as they are only here to try and bring however many people they can down to their level with them so they're not the only ones missing out in the end lol.
i prefer fundamentals
|
|
|
|
Shadey
|
|
September 07, 2014, 09:13:56 PM |
|
If you look at the graph on cryptsy for BitcoinDark, and press the "ALL" key, you can easily see that BitcoinDark has gone nowhere but up the ENTIRE time it's been there. Clearly, BitcoinDark has some pretty damn good potential. People that hate on that obviously don't know what they're talking about. They need to be ignored, as they are only here to try and bring however many people they can down to their level with them so they're not the only ones missing out in the end lol.
i prefer fundamentals You don't see the pattern going on? Edit: It's been like a staircase of profit the whole time lol
|
|
|
|
salsacz
|
|
September 07, 2014, 10:10:10 PM |
|
I could be Talking about Teleport in front of the whole Crypto industry in Shanghai. Just in 2 weeks I will be talking about anonymous technologies at the http://bitcoinexpo2014.com/ in China. I think there will be tons of experts and service providers etc curious also about Teleport. In order to add the Teleport into my speech I would have to invest significant amount of time to do the research and to make some nice infographics (like I did https://i.imgur.com/lHhDQ4k.png + https://i.imgur.com/pMkJqMt.jpg). Including consultations with university profs. But since researching and presenting cryptos is still my only job, I am asking for donations in order to do that, to research Teleport and to present it there (see my signature) That research and content will be then used also at the CoinsSource news site, where I am publishing, so there could be be more articles, some interviews with the BTCD devs etc. But still I feel that presenting Teleport in front of these people http://bitcoinexpo2014.com/#speakers, 20 media outlets with more attention to the chinese market could help Teleport become more accepted by the mainstream. When people speak just about one solution, it's just cheap self-promo. But if the Teleport was shown in the bigger picture, among other technologies, with real examples how it could be used... then it should have a higher effect, since I am still an independent researcher, not just a marketing monkey This is absolutely fantastic . I hope you get all the assistance you need to prepare. I am sure the community would appreciate being kept up to date on presentation. Info-graphics, and yours look really good, are always just so helpful to convey difficult subject matter. Good luck! https://twitter.com/search?f=realtime&q=supernet&src=typdhttp://www.coinssource.com/supernets-coin-offering-raises-over-2000-bitcoins-hours/I finally got my Visa. My offer is still valid. I spent only a weekend (30 hours) with the Teleport stuff, so I have some sources, but CryptoNote research took a month (300 hours) and a paper will be released tomorrow
|
|
|
|
torshammer
|
|
September 07, 2014, 10:52:09 PM |
|
My take on current BTCD price action is that dev needs to spend less time answering posts and slamming trolls and more time delivering the goods.
This is not Fud. This is "tough love" from someone who has been in BTCD from the start. And sees an enormous timesuck happening lately in the wrong direction. This thread - and the coin - was best when the dev was posting code, not victories over trolls.
|
|
|
|
jjiimm_64
Legendary
Offline
Activity: 1876
Merit: 1000
|
|
September 07, 2014, 10:54:02 PM |
|
My take on current BTCD price action is that dev needs to spend less time answering posts and slamming trolls and more time delivering the goods.
This is not Fud. This is "tough love" from someone who has been in BTCD from the start. And sees an enormous timesuck happening lately in the wrong direction. This thread - and the coin - was best when the dev was posting code, not victories over trolls.
It would also be better if I could actually download the wallet... why does the mega link require such a high end browser? what the F
|
1jimbitm6hAKTjKX4qurCNQubbnk2YsFw
|
|
|
apex944
|
|
September 07, 2014, 10:57:41 PM |
|
why does the mega link require such a high end browser? what the F
Could you take that up with Mega ? Nobody hear can help you with their business decisions. If you search the thread there is a client hosted on DropBox as well.
|
|
|
|
salsacz
|
|
September 07, 2014, 11:01:11 PM |
|
Dropbox here Is there another place to download the Windows wallet other than the mega link? The link isn't working and I want to move the coins I bought off the exchange.
Thanks
I am uploading it for you with dropbox. I have uploaded the windows wallet here. it is the original as I have downloaded it from the OP on July 14 https://www.dropbox.com/s/aujtjeoydzplzqr/BitcoinDark-win32-qt.rar?dl=0
|
|
|
|
crackfoo
Legendary
Offline
Activity: 3542
Merit: 1126
|
|
September 07, 2014, 11:09:31 PM |
|
My take on current BTCD price action is that dev needs to spend less time answering posts and slamming trolls and more time delivering the goods.
This is not Fud. This is "tough love" from someone who has been in BTCD from the start. And sees an enormous timesuck happening lately in the wrong direction. This thread - and the coin - was best when the dev was posting code, not victories over trolls.
I think the post you are looking for is here: https://bitcointalk.org/index.php?topic=684090.msg8717360#msg8717360If you were in from the beginning you should appreciate more, the fact that James so eloquently protects the investments and interests of all involved. I'd rather see a delay in product over an out of control FUD campaign.
|
ZPOOL - the miners multipool! Support We pay 10 FLUX Parallel Assets (PA) directly to block rewards! Get paid more and faster. No PA fee's or waiting around for them, paid instantly on every block found!
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
September 07, 2014, 11:12:29 PM |
|
Here is how Teleport works with SuperNET Each coin would implement the JSON handling specific to their coin, so when they receive the API command, they can process it. The SuperNET is the transport The services are applications Easier to understand is telephone system. yes this is very good analogy. There are local phone calls and long distance calls. The local calls are comms between people using the same coin. Long distance are comms between different coins. The area code is the coin. Doesnt matter who you are calling, you can use the same phone connected to the same socket. here is where it is not so exact, but thing of a service as a specific type of phone. some phones have video, others have cameras, not exactly right, but hopefully you get the idea. all the data is on the internect all the different services are sending packets directly between two computers each computer can properly decrypt all the packets sent to it and route the JSON request to the right service Currently it requires changing the source code to add a new API call and of course the code to actually perform the API function. I hope this is understandable, it is no easy to explain in english what should be a matter of showing some code fragments current commands static char **commands[] = { getpubkey, maketelepods, transporterstatus, telepod, transporter, tradebot, respondtx, processutx, publishaddrs, checkmsg, placebid, placeask, makeoffer, sendmsg, orderbook, getorderbooks, sellp, buyp, send, teleport, select };
example of one of the above static char *teleport[] = { (char *)teleport_func, "teleport", "V", "NXT", "secret", "amount", "dest", "coin", "minage", "M", "N", 0 };
the "glue" function that actually calls the teleport function char *teleport_func(char *sender,int32_t valid,cJSON **objs,int32_t numobjs,char *origargstr) { double amount; int32_t M,N; struct coin_info *cp; char NXTACCTSECRET[512],destaddr[512],minage[512],coinstr[512],*retstr = 0; if ( Historical_done == 0 ) return(clonestr("historical processing is not done yet")); copy_cJSON(NXTACCTSECRET,objs[1]); amount = get_API_float(objs[2]); copy_cJSON(destaddr,objs[3]); copy_cJSON(coinstr,objs[4]); copy_cJSON(minage,objs[5]); M = get_API_int(objs[6],1); N = get_API_int(objs[7],1); if ( M > N || N >= 0xff || M <= 0 ) M = N = 1; printf("amount.(%.8f) minage.(%s) %d | M.%d N.%d\n",amount,minage,atoi(minage),M,N); cp = get_coin_info(coinstr); if ( cp != 0 && sender[0] != 0 && amount > 0 && valid != 0 && destaddr[0] != 0 ) retstr = teleport(sender,NXTACCTSECRET,(uint64_t)(SATOSHIDEN * amount),destaddr,cp,atoi(minage),M,N); else retstr = clonestr("{\"error\":\"invalid teleport request\"}"); return(retstr); }
the teleport function, which triggers other API functions sometimes locally sometimes remotely, uses some genetic algo for telepod selection, etc. char *teleport(char *NXTaddr,char *NXTACCTSECRET,uint64_t satoshis,char *otherpubaddr,struct coin_info *cp,int32_t minage,int32_t M,int32_t N) { static unsigned char zerokey[crypto_box_PUBLICKEYBYTES]; char buf[4096]; uint8_t sharenrs[255]; struct telepod **pods = 0; struct NXT_acct *np,*destnp; struct transporter_log *log; int32_t n,err = -1; uint32_t height; if ( M <= 0 ) M = cp->M; if ( N <= 0 ) N = cp->N; if ( M <= 0 ) M = 1; if ( N <= 0 ) N = 1; memset(sharenrs,0,sizeof(sharenrs)); if ( N > 1 ) init_sharenrs(sharenrs,0,N,N); sprintf(buf,"%s -> teleport %.8f %s -> %s minage.%d | M.%d N.%d dest.(%s)\n",NXTaddr,dstr(satoshis),cp->name,otherpubaddr,minage,M,N,otherpubaddr); if ( minage == 0 ) minage = cp->minconfirms; destnp = search_addresses(otherpubaddr); height = (uint32_t)get_blockheight(cp); if ( (pods= evolve_transporter(&n,0,cp,minage,satoshis,height)) == 0 ) sprintf(buf,"{\"error\":\"teleport: not enough for %.8f %s to %s\"}",dstr(satoshis),cp->name,otherpubaddr); else { free(pods), pods = 0; np = find_NXTacct(NXTaddr,NXTACCTSECRET); if ( memcmp(destnp->pubkey,zerokey,sizeof(zerokey)) == 0 ) { query_pubkey(destnp->H.NXTaddr,NXTACCTSECRET); sprintf(buf,"{\"error\":\"no pubkey for %s, request sent\"}",otherpubaddr); } if ( memcmp(destnp->pubkey,zerokey,sizeof(zerokey)) != 0 ) { printf("start evolving at %f\n",milliseconds()); pods = evolve_transporter(&n,cp->maxevolveiters,cp,minage,satoshis,height); printf("finished evolving at %f\n",milliseconds()); if ( pods == 0 ) sprintf(buf,"{\"error\":\"unexpected transporter evolve failure for %.8f %s to %s\"}",dstr(satoshis),cp->name,otherpubaddr); else { log = send_transporter_log(NXTaddr,cp->NXTACCTSECRET,destnp,cp,minage,satoshis,pods,n,M,N,sharenrs,otherpubaddr); if ( log == 0 ) { sprintf(buf,"{\"error\":\"unexpected error sending transporter log %.8f %s to %s\"}",dstr(satoshis),cp->name,otherpubaddr); free(pods); pods = 0; } else { err = 0; sprintf(buf,"{\"result\":\"teleport AFTER CREATE BUNDLE to %s err.%d\"}",destnp->H.NXTaddr,err); printf("teleport AFTER CREATE BUNDLE to %s err.%d\n",destnp->H.NXTaddr,err); process_pingpong_queue(&Transporter_sendQ,log); } } } } return(clonestr(buf)); }
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
September 07, 2014, 11:16:15 PM |
|
The last set of code adds the teleport sequence to a queue. We of course need to process this queue, like so: int32_t process_transporterQ(void **ptrp,void *arg) // added when outbound transporter sequence is started { struct transporter_log *log = (*ptrp); struct NXT_acct *destnp,*np; unsigned char *buffer; int32_t i,sharei,err=0,verified = 0; struct telepod *pod; if ( log->cp->initdone < 2 ) return(0); np = search_addresses(log->cp->pubaddr); destnp = search_addresses(log->otherpubaddr); printf("log send %f complete %f\n",log->recvmilli,log->completemilli); if ( log->recvmilli != 0. && log->completemilli == 0. ) { for (i=0; i<log->numpods; i++) { //printf("check %d'th pod\n",i); if ( (pod= log->pods[i]) != 0 ) { printf("pod sentmilli %f complete %f clonetxid.(%c) cloneout.%d\n",pod->sentmilli,pod->completemilli,pod->clonetxid[0],pod->cloneout); if ( pod->clonetxid[0] != 0 && pod->cloneout >= 0 ) verified++; else if ( pod->sentmilli == 0. ) { void calc_shares(unsigned char *shares,unsigned char *secret,int32_t size,int32_t width,int32_t M,int32_t N,unsigned char *sharenrs); void gfshare_extract(unsigned char *secretbuf,uint8_t *sharenrs,int32_t N,uint8_t *buffer,int32_t len,int32_t size); if ( log->N > 1 ) { buffer = calloc(log->N+1,pod->len_plus1); calc_shares(buffer,_get_privkeyptr(pod,calc_multisig_N(pod)),pod->len_plus1 - 1,pod->len_plus1,log->M,log->N,log->sharenrs); gfshare_extract(buffer+log->N*pod->len_plus1,log->sharenrs,log->N,buffer,pod->len_plus1-1,pod->len_plus1); for (sharei=err=0; sharei<log->N; sharei++) { if ( teleport_telepod(log->cp->pubaddr,np->H.NXTaddr,log->cp->NXTACCTSECRET,destnp->H.NXTaddr,pod,log->totalcrc,sharei,i,log->M,log->N,buffer+sharei*pod->len_plus1) < 0 ) { err++; break; } } printf("back from calc_shares pod.%p (%s) %u %u %u\n",pod,_get_privkeyptr(pod,calc_multisig_N(pod)),_crc32(0,buffer,pod->len_plus1-1),_crc32(0,buffer+pod->len_plus1,pod->len_plus1-1),_crc32(0,buffer+2*pod->len_plus1,pod->len_plus1-1)); { char hexstr[4096]; init_hexbytes(hexstr,buffer+log->N*pod->len_plus1,pod->len_plus1); printf("DECODED.(%s)\n",hexstr); } free(buffer); } else { sharei = log->N; if ( teleport_telepod(log->cp->pubaddr,np->H.NXTaddr,log->cp->NXTACCTSECRET,destnp->H.NXTaddr,pod,log->totalcrc,sharei,i,1,1,_get_privkeyptr(pod,calc_multisig_N(pod))) < 0 ) err++; } printf("sharei.%d N.%d err.%d\n",sharei,log->N,err); if ( sharei == log->N ) { pod->sentmilli = milliseconds(); change_podstate(log->cp,pod,PODSTATE_SENT); } break; } } else printf("unexpected null pod at %d of %d\n",i,log->numpods); } //printf("verified.%d of %d, started %f\n",verified,log->numpods,log->startmilli); if ( verified == log->numpods ) { log->completemilli = milliseconds(); log->logstate |= TRANSPORTER_COMPLETED; save_transporter_log(log); return(1); } else if ( (milliseconds() - log->startmilli) > TELEPORT_MAX_CLONETIME ) { log->completemilli = milliseconds(); printf("exceed maximum cloning time!\n"); return(-1); } } else { for (i=0; i<log->numpods; i++) { //printf("check %d'th pod\n",i); if ( (pod= log->pods[i]) != 0 ) { if ( pod->completemilli == 0. && pod->confirmheight != 0 ) { pod->completemilli = milliseconds(); disp_telepod("confirm",pod); } } } if ( log->recvmilli == 0. && (milliseconds() - log->startmilli) > TELEPORT_TRANSPORTER_TIMEOUT ) return(-1); else if ( log->recvmilli != 0. && (milliseconds() - log->recvmilli) > TELEPORT_TELEPODS_TIMEOUT ) return(-1); } return(0); }
you can see it doing the M of N fragmenting and calling teleport_telepod int32_t teleport_telepod(char *mypubaddr,char *NXTaddr,char *NXTACCTSECRET,char *destNXTaddr,struct telepod *pod,uint32_t totalcrc,uint32_t sharei,int32_t ind,int32_t M,int32_t N,uint8_t *buffer) { cJSON *json; char numstr[32],hexstr[4096]; json = cJSON_CreateObject(); cJSON_AddItemToObject(json,"requestType",cJSON_CreateString("telepod")); cJSON_AddItemToObject(json,"crc",cJSON_CreateNumber(pod->crc)); cJSON_AddItemToObject(json,"i",cJSON_CreateNumber(ind)); cJSON_AddItemToObject(json,"h",cJSON_CreateNumber(pod->height)); cJSON_AddItemToObject(json,"c",cJSON_CreateString(pod->coinstr)); sprintf(numstr,"%.8f",(double)pod->satoshis/SATOSHIDEN); cJSON_AddItemToObject(json,"v",cJSON_CreateString(numstr)); cJSON_AddItemToObject(json,"a",cJSON_CreateString(pod->coinaddr)); cJSON_AddItemToObject(json,"t",cJSON_CreateString(pod->txid)); cJSON_AddItemToObject(json,"o",cJSON_CreateNumber(pod->vout)); cJSON_AddItemToObject(json,"p",cJSON_CreateString(pod->script)); if ( sharei == 0xff || sharei >= N ) sharei = N; init_hexbytes(hexstr,buffer,pod->len_plus1); cJSON_AddItemToObject(json,"k",cJSON_CreateString(hexstr)); cJSON_AddItemToObject(json,"L",cJSON_CreateNumber(totalcrc)); cJSON_AddItemToObject(json,"s",cJSON_CreateNumber(sharei)); cJSON_AddItemToObject(json,"M",cJSON_CreateNumber(M)); cJSON_AddItemToObject(json,"N",cJSON_CreateNumber(N)); cJSON_AddItemToObject(json,"D",cJSON_CreateString(mypubaddr)); return(sendandfree_jsoncmd(Global_mp->Lfactor,NXTaddr,NXTACCTSECRET,json,destNXTaddr)); }
turns out the actual teleporting is just making a JSON string! Now this is the "application" level stuff so it tends to be much simpler. clearly the magical sendandfree_jsoncmd() must contain some magic! James
|
|
|
|
apex944
|
|
September 07, 2014, 11:18:09 PM |
|
James, which dir on your Github site is this code located?
|
|
|
|
torshammer
|
|
September 07, 2014, 11:23:10 PM |
|
My take on current BTCD price action is that dev needs to spend less time answering posts and slamming trolls and more time delivering the goods.
This is not Fud. This is "tough love" from someone who has been in BTCD from the start. And sees an enormous timesuck happening lately in the wrong direction. This thread - and the coin - was best when the dev was posting code, not victories over trolls.
I think the post you are looking for is here: https://bitcointalk.org/index.php?topic=684090.msg8717360#msg8717360If you were in from the beginning you should appreciate more, the fact that James so eloquently protects the investments and interests of all involved. I'd rather see a delay in product over an out of control FUD campaign. Please spare me the "if" and the "should". The post your linking to simply states a rational to be always responding to every attack. My point is that that sort of blind responding becomes a giant timesuck that kills the golden goose.
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
September 07, 2014, 11:25:01 PM |
|
here is the sendmsg function, which is really the critical one: char *sendmessage(int32_t L,char *verifiedNXTaddr,char *NXTACCTSECRET,char *msg,int32_t msglen,char *destNXTaddr,char *origargstr) { uint64_t txid; char buf[4096]; unsigned char encodedD[4096],encodedL[4096],encodedP[4096],finalbuf[4096],*outbuf; int32_t len,createdflag; struct NXT_acct *np = 0,*destnp; //printf("sendmessage.(%s) -> NXT.(%s) (%s) (%s)\n",NXTaddr,destNXTaddr,msg,origargstr); if ( Server_NXTaddr == 0 ) { if ( Global_pNXT->privacyServer_NXTaddr[0] == 0 ) { sprintf(buf,"{\"error\":\"%s cant sendmessage.(%s) to null privacyServer\"}",verifiedNXTaddr,msg); return(clonestr(buf)); } np = get_NXTacct(&createdflag,Global_mp,Global_pNXT->privacyServer_NXTaddr); printf("set np <- NXT.%s\n",Global_pNXT->privacyServer_NXTaddr); } else { np = get_NXTacct(&createdflag,Global_mp,verifiedNXTaddr); if ( strcmp(Server_NXTaddr,destNXTaddr) == 0 ) { queue_message(np,msg,origargstr); sprintf(buf,"{\"result\":\"msg.(%s) from NXT.%s queued\"}",msg,verifiedNXTaddr); return(clonestr(buf)); } } destnp = get_NXTacct(&createdflag,Global_mp,destNXTaddr); memset(finalbuf,0,sizeof(finalbuf)); memset(encodedD,0,sizeof(encodedD)); // encoded to dest memset(encodedL,0,sizeof(encodedL)); // encoded to max L onion layers memset(encodedP,0,sizeof(encodedP)); // encoded to privacyserver if ( origargstr != 0 ) len = onionize(verifiedNXTaddr,NXTACCTSECRET,encodedD,destNXTaddr,(unsigned char *)origargstr,(int32_t)strlen(origargstr)+1); else { len = onionize(verifiedNXTaddr,NXTACCTSECRET,encodedD,destNXTaddr,(unsigned char *)msg,msglen); msg = origargstr = "<encrypted>"; } printf("sendmessage (%s) len.%d to %s\n",origargstr,msglen,destNXTaddr); if ( len > sizeof(finalbuf)-256 ) { printf("sendmessage, payload too big %d\n",len); sprintf(buf,"{\"error\":\"%s cant sendmessage.(%s) to %s too long.%d\"}",verifiedNXTaddr,msg,destNXTaddr,len); } else if ( len > 0 ) { outbuf = encodedD; printf("np.%p NXT.%s np->udp %p | destnp.%p destnp_udp.%p\n",np,np!=0?np->H.NXTaddr:"no np",np!=0?np->udp:0,destnp,destnp!=0?destnp->udp:0); if ( np != 0 && np->udp != 0 ) { if ( L > 0 ) { len = add_random_onionlayers(L,verifiedNXTaddr,NXTACCTSECRET,encodedL,outbuf,len); outbuf = encodedL; } len = onionize(verifiedNXTaddr,NXTACCTSECRET,encodedP,Global_pNXT->privacyServer_NXTaddr,outbuf,len); outbuf = encodedP; sprintf(buf,"{\"status\":\"%s sends via %s encrypted sendmessage to %s pending\"}",verifiedNXTaddr,Global_pNXT->privacyServer_NXTaddr,destNXTaddr); } else if ( Server_NXTaddr != 0 && destnp->udp != 0 ) { printf("can do direct!\n"); np = destnp; sprintf(buf,"{\"status\":\"%s sends direct encrypted sendmessage to %s pending\"}",verifiedNXTaddr,destNXTaddr); } else np = 0; // have to use p2p network if ( len > 0 && len < sizeof(finalbuf) ) { len = crcize(finalbuf,outbuf,len); if ( len > sizeof(finalbuf) ) { printf("sendmessage: len.%d > sizeof(finalbuf) %ld\n",len,sizeof(finalbuf)); exit(-1); } if ( np != 0 && len < 1400 ) { int32_t portable_udpwrite(const struct sockaddr *addr,uv_udp_t *handle,void *buf,long len,int32_t allocflag); printf("udpsend finalbuf.%d\n",len); portable_udpwrite(&np->Uaddr,(uv_udp_t *)np->udp,finalbuf,len,ALLOCWR_ALLOCFREE); } else if ( Server_NXTaddr != 0 ) // test to verify this is hub { printf("len.%d Server_NXTaddr.(%s) broadcast %d via p2p\n",len,Server_NXTaddr,len); txid = call_libjl777_broadcast((char *)finalbuf,600); if ( txid == 0 ) { sprintf(buf,"{\"error\":\"%s cant send via p2p sendmessage.(%s) [%s] to %s pending\"}",verifiedNXTaddr,origargstr,msg,destNXTaddr); } else { sprintf(buf,"{\"status\":\"%s sends via p2p encrypted sendmessage to %s pending\"}",verifiedNXTaddr,destNXTaddr); } } else sprintf(buf,"{\"error\":\"%s cant sendmessage.(%s) to %s unexpected case\"}",verifiedNXTaddr,msg,destNXTaddr); } else sprintf(buf,"{\"error\":\"%s cant sendmessage.(%s) to %s error encoding layer, len.%d\"}",verifiedNXTaddr,msg,destNXTaddr,len); } else sprintf(buf,"{\"error\":\"%s cant sendmessage.(%s) to %s probably no pubkey\"}",verifiedNXTaddr,msg,destNXTaddr); return(clonestr(buf)); }
the onion commands: int32_t onionize(char *verifiedNXTaddr,char *NXTACCTSECRET,unsigned char *encoded,char *destNXTaddr,unsigned char *payload,int32_t len) { static unsigned char zerokey[crypto_box_PUBLICKEYBYTES]; unsigned char onetime_pubkey[crypto_box_PUBLICKEYBYTES],onetime_privkey[crypto_box_SECRETKEYBYTES]; uint64_t nxt64bits; int32_t createdflag; uint16_t *payload_lenp,slen; struct NXT_acct *np; nxt64bits = calc_nxt64bits(destNXTaddr); np = get_NXTacct(&createdflag,Global_mp,destNXTaddr); if ( memcmp(np->pubkey,zerokey,sizeof(zerokey)) == 0 ) { if ( Global_pNXT->privacyServer_NXTaddr[0] != 0 ) { char cmdstr[4096]; sprintf(cmdstr,"{\"requestType\":\"getpubkey\",\"NXT\":\"%s\",\"addr\":\"%s\",\"time\":%ld}",verifiedNXTaddr,destNXTaddr,time(NULL)); send_tokenized_cmd(Global_mp->Lfactor,verifiedNXTaddr,NXTACCTSECRET,cmdstr,Global_pNXT->privacyServer_NXTaddr); //int n = construct_tokenized_req(_tokbuf,cmdstr,NXTACCTSECRET); //sendmessage(verifiedNXTaddr,NXTACCTSECRET,_tokbuf,(int32_t)n+1,Global_pNXT->privacyServer_NXTaddr,_tokbuf); } return(0); } crypto_box_keypair(onetime_pubkey,onetime_privkey); memcpy(encoded,&nxt64bits,sizeof(nxt64bits)); encoded += sizeof(nxt64bits); memcpy(encoded,onetime_pubkey,sizeof(onetime_pubkey)); encoded += sizeof(onetime_pubkey); payload_lenp = (uint16_t *)encoded; encoded += sizeof(*payload_lenp); //printf("ONIONIZE: np.%p NXT.%s %s pubkey.%llx encode len.%d -> ",np,np->H.NXTaddr,destNXTaddr,*(long long *)np->pubkey,len); len = _encode_str(encoded,(char *)payload,len,np->pubkey,onetime_privkey); slen = len; memcpy(payload_lenp,&slen,sizeof(*payload_lenp)); printf("new len.%d + %ld = %ld\n",len,sizeof(*payload_lenp) + sizeof(onetime_pubkey) + sizeof(nxt64bits),sizeof(*payload_lenp) + sizeof(onetime_pubkey) + sizeof(nxt64bits)+len); return(len + sizeof(*payload_lenp) + sizeof(onetime_pubkey) + sizeof(nxt64bits)); }
int32_t add_random_onionlayers(int32_t numlayers,char *verifiedNXTaddr,char *NXTACCTSECRET,uint8_t *final,uint8_t *src,int32_t len) { char destNXTaddr[64]; uint8_t bufs[2][4096],*dest; struct peerinfo *peer; struct NXT_acct *np; if ( numlayers > 1 ) numlayers = ((rand() >> 8) % numlayers); if ( numlayers > 0 ) { memset(bufs,0,sizeof(bufs)); dest = bufs[numlayers & 1]; memcpy(dest,src,len); while ( numlayers > 0 ) { src = bufs[numlayers & 1]; dest = bufs[(numlayers & 1) ^ 1]; peer = get_random_pserver(); if ( peer == 0 ) { printf("FATAL: cant get random peer!\n"); return(-1); } np = search_addresses(peer->pubBTCD); if ( np == 0 && peer->pubnxtbits != 0 ) { expand_nxt64bits(destNXTaddr,peer->pubnxtbits); np = search_addresses(destNXTaddr); } if ( np == 0 ) np = search_addresses(peer->pubBTC); if ( np == 0 ) { printf("FATAL: %s %s %s is unknown account\n",peer->pubBTCD,destNXTaddr,peer->pubBTC); return(-1); } if ( memcmp(np->pubkey,peer->pubkey,sizeof(np->pubkey)) != 0 ) { printf("Warning: (%s %s %s) pubkey updated %llx -> %llx\n",peer->pubBTCD,destNXTaddr,peer->pubBTC,*(long long *)np->pubkey,*(long long *)peer->pubkey); memcpy(np->pubkey,peer->pubkey,sizeof(np->pubkey)); } printf("add layer %d: NXT.%s\n",numlayers,np->H.NXTaddr); len = onionize(verifiedNXTaddr,NXTACCTSECRET,dest,np->H.NXTaddr,src,len); if ( len > 4096 ) { printf("FATAL: onion layers too big.%d\n",len); return(-1); } numlayers--; } src = dest; } memcpy(final,src,len); return(len); }
int32_t deonionize(unsigned char *pubkey,unsigned char *decoded,unsigned char *encoded,int32_t len,uint64_t mynxtbits) { //void *origencoded = encoded; int32_t err; uint16_t payload_len; if ( mynxtbits == 0 || memcmp(&mynxtbits,encoded,sizeof(mynxtbits)) == 0 ) { encoded += sizeof(mynxtbits); memcpy(pubkey,encoded,crypto_box_PUBLICKEYBYTES); encoded += crypto_box_PUBLICKEYBYTES; memcpy(&payload_len,encoded,sizeof(payload_len)); //printf("deonionize >>>>> pubkey.%llx vs mypubkey.%llx (%ld) -> %d %2x\n",*(long long *)pubkey,*(long long *)Global_mp->session_pubkey,(long)encoded - (long)origencoded,payload_len,payload_len); encoded += sizeof(payload_len); if ( (payload_len + sizeof(payload_len) + sizeof(Global_mp->session_pubkey) + sizeof(mynxtbits)) == len ) { len = payload_len; err = _decode_cipher((char *)decoded,encoded,&len,pubkey,Global_mp->session_privkey); if ( err == 0 ) { // printf("payload_len.%d err.%d new len.%d\n",payload_len,err,len); return(len); } } else printf("mismatched len expected %ld got %d\n",(payload_len + sizeof(payload_len) + sizeof(Global_mp->session_pubkey) + sizeof(mynxtbits)),len); } else { uint64_t destbits; memcpy(&destbits,encoded,sizeof(destbits)); printf("deonionize onion for NXT.%llu not this address.(%llu)\n",(long long)destbits,(long long)mynxtbits); } return(0); }
So there is the guts of the entire SuperNET! As you can see it is not so much actual code. There are many special cases and nonstandard handling I skipped, but for those who are wondering how "real" teleport is, this has been pretty much working for over a month. The SuperNET support is creating a need for some brain surgery and if I am not ready to code it, I cannot force it. it is hard to explain. maybe if you are an artist you can understand force an artist to paint when he is no ready, then it wont be any good. the reason is that I need to have all the things done in my head before I start writing Now, maybe you are in a hurry to have teleport because? cant wait for .02? please let me make the Teleport + SuperNET to my standards. All the discussions with the SuperNET, questions, sometimes even trolls is sharpening in my mind the exact things that are needed. James P.S. for those who understand some coding, you know how hard it is to have small amounts of code do a lot of things, let along doing amazing things and you will not the long distance calling is not there yet. So, this I must do for SuperNET, then we get SuperTeleport! Not just teleporting BTCD to any other BTCD node, but BTCD to ANY node in the SuperNET. Isnt that worth a week or even two delay?
|
|
|
|
jl777
Legendary
Offline
Activity: 1176
Merit: 1134
|
|
September 07, 2014, 11:25:56 PM |
|
James, which dir on your Github site is this code located?
github.com/jl777/libjl777 a bit out of date as current code is work in progress and not stable
|
|
|
|
|