Author

Topic: [ANN][KMD][dPoW] Komodo - An Open, Composable Smart Chain Platform, Secured by B - page 838. (Read 1191989 times)

newbie
Activity: 13
Merit: 0
Taking a short break from debugging. multithreaded networking code is always tricky. I did find and fix some deadlocks, but primarily drastically simplified the control flow. Simple is a lot simpler and much less can go wrong as compared to complex logic.

What is working now are several different types of nodes that are all coexisting in the same (super) network.

Each coin of course has its normal p2p network using the bitcoin protocol. Overlaid on top of that are the supernet nodes which use the same ports, but only do supernet comms to other supernet nodes as identified during the version handshake.

For a coin, a node is either a full relay node or a basilisk lite node that queries the full nodes for the blockchain/blockexplorer data. All wallet, tx construction, signing, is done locally as it is the same codebase with some toggles for basilisk mode where it does a basilisk request instead of scanning local ramchain files.

There is a special coin with no blockchain, called NOTARY and the notary nodes would be the full relay nodes and all the others basilisk nodes for this special coin. The NOTARY p2p is now working as a pubkey messaging server and also a way to find all the active notary nodes. I am adding a layer on top of the low level pubkey messaging so a node wont keep retransmitting if the data is already there. That will make the bandwidth usage much more efficient and allow a lot of DEX trading at the same time.

I also got LP nodes to work even as a basilisk node, though it is of course faster if it is a full iguana node. Still, not having to have a full bitcoin node locally is quite handy. And with the NOTARY pubkey messaging in between, there is no direct IP level interaction between the two parties doing the atomic swap.

In order to minimize the changes needed to be made to the zcash baseline and support dPoW, having a min-diff exception for notary node blocks but still using the same PoW seems the path of least resistance. This will make the seamless transition to fully decentralized block creation in the even all the notary nodes go away, or there is some problems in getting a majority of notaries to agree, much much simpler.

With notary nodes having the min-difficulty exception, it would not be feasible for some high hash rate attacker to do 51% attacks. And even if they can anybody that just waits for the bitcoin confirmation would be protected. That is the power of dPoW as even very weak chains become quite secure.

With this plan, the biggest remaining issue is how to get the election results propagated securely. Using komodo chain to record election results has the issue that if all blocks are created by notaries, then the existing majority could block the activation of the new slate. A natural idea is to use the BTC blockchain to record the election results, but again the issue of who writes that data arises.

My idea is to ratify election results via the majority of existing notaries OR a one third majority + special signature. The special signature would be held by the devteam. With this approach, even if there is a majority of notary nodes unwilling to give up their position, it can be overridden by one third minority and the devteam.

This ties into using the zcash PoW as the method for block generation. Even with a min-diff exception, with enough hash rate a block will be able to be mined by non-notary nodes and so the (one third + special sig) transaction will be able to get onto the blockchain in spite of a hostile notary majority.

I realize this is a bit of a change from using a NXT-style PoS, but the current testnet is working smoothly and I dont see the need to add a lot of complicated balance tracking that using a NXT-style PoS would require. Also, using a peercoin uxto based PoS has the problem that only one utxo per block is able to collect the staking revenues.

The other requirement is for people to be able to get 5% per year, without having to run their own node. at first I was going to rely on the notary nodes to do the staking, but I think an even more efficient way is to award all accrued interest whenever a utxo is spent. This approach might even allow interests to be earned by the protected funds, though in order to prevent abuse, the lower spectrum of the average age would need to be used. Still investigating this, but I am hopeful that something like this will work and it wont consume any measurable resources as it would only require to boost the satoshi total from the inputs based on a deterministic algo. I guess that could be one approach for the protected funds interest rates, the notaries can vote for the current applicable rate.

So you can see that while some details are changing from the original conception, the overall requirements and goals are held intact. By minimizing the changes, reliability is increased.

Words...

Selling 10,000 BTCD at market price: please PM me
legendary
Activity: 1176
Merit: 1134
pushed changes for the notary mindiff exception

also a command line parameter -notary to be used by notary nodes, but unless it is on a valid notary node the blocks wont be valid

Only the hooks into the C++ code is in place, the actual code to implement what is needed is still in stub form:

Code:
int32_t IS_KOMODO_NOTARY;

int32_t komodo_is_notaryblock(void *block)
{
    return(0);
}

int32_t komodo_checkmsg(void *bitcoinpeer,uint8_t *data,int32_t datalen)
{
    fprintf(stderr,"KOMODO.[%d] message from peer.%p\n",datalen,bitcoinpeer);
    return(0);
}

int32_t komodo_blockcheck(void *block,uint32_t *nBitsp)
{
    //fprintf(stderr,"check block %p\n",block);
    // 1 -> valid notary block, change nBits to KOMODO_MINDIFF_NBITS
    // -1 -> invalid, ie, prior to notarized block
    return(0); // normal PoW block
}

So far, only three functions are needed to support the dPoW. Granted it is assumed that all the required functionality will be done by the above functions, so to fully implement it will take quite a few internal functions.

By collecting all the functionality needed into a single place and in the C form I am most comfortable with also has the side effect that lets other coins add dPoW using a very similar method.

Other coins wont have to have notary nodes or submit to the bitcoin blockchain, but I wanted to share as much code for dPoW between komodo and third party coins
legendary
Activity: 1176
Merit: 1134
Taking a short break from debugging. multithreaded networking code is always tricky. I did find and fix some deadlocks, but primarily drastically simplified the control flow. Simple is a lot simpler and much less can go wrong as compared to complex logic.

What is working now are several different types of nodes that are all coexisting in the same (super) network.

Each coin of course has its normal p2p network using the bitcoin protocol. Overlaid on top of that are the supernet nodes which use the same ports, but only do supernet comms to other supernet nodes as identified during the version handshake.

For a coin, a node is either a full relay node or a basilisk lite node that queries the full nodes for the blockchain/blockexplorer data. All wallet, tx construction, signing, is done locally as it is the same codebase with some toggles for basilisk mode where it does a basilisk request instead of scanning local ramchain files.

There is a special coin with no blockchain, called NOTARY and the notary nodes would be the full relay nodes and all the others basilisk nodes for this special coin. The NOTARY p2p is now working as a pubkey messaging server and also a way to find all the active notary nodes. I am adding a layer on top of the low level pubkey messaging so a node wont keep retransmitting if the data is already there. That will make the bandwidth usage much more efficient and allow a lot of DEX trading at the same time.

I also got LP nodes to work even as a basilisk node, though it is of course faster if it is a full iguana node. Still, not having to have a full bitcoin node locally is quite handy. And with the NOTARY pubkey messaging in between, there is no direct IP level interaction between the two parties doing the atomic swap.

In order to minimize the changes needed to be made to the zcash baseline and support dPoW, having a min-diff exception for notary node blocks but still using the same PoW seems the path of least resistance. This will make the seamless transition to fully decentralized block creation in the even all the notary nodes go away, or there is some problems in getting a majority of notaries to agree, much much simpler.

With notary nodes having the min-difficulty exception, it would not be feasible for some high hash rate attacker to do 51% attacks. And even if they can anybody that just waits for the bitcoin confirmation would be protected. That is the power of dPoW as even very weak chains become quite secure.

With this plan, the biggest remaining issue is how to get the election results propagated securely. Using komodo chain to record election results has the issue that if all blocks are created by notaries, then the existing majority could block the activation of the new slate. A natural idea is to use the BTC blockchain to record the election results, but again the issue of who writes that data arises.

My idea is to ratify election results via the majority of existing notaries OR a one third majority + special signature. The special signature would be held by the devteam. With this approach, even if there is a majority of notary nodes unwilling to give up their position, it can be overridden by one third minority and the devteam.

This ties into using the zcash PoW as the method for block generation. Even with a min-diff exception, with enough hash rate a block will be able to be mined by non-notary nodes and so the (one third + special sig) transaction will be able to get onto the blockchain in spite of a hostile notary majority.

I realize this is a bit of a change from using a NXT-style PoS, but the current testnet is working smoothly and I dont see the need to add a lot of complicated balance tracking that using a NXT-style PoS would require. Also, using a peercoin uxto based PoS has the problem that only one utxo per block is able to collect the staking revenues.

The other requirement is for people to be able to get 5% per year, without having to run their own node. at first I was going to rely on the notary nodes to do the staking, but I think an even more efficient way is to award all accrued interest whenever a utxo is spent. This approach might even allow interests to be earned by the protected funds, though in order to prevent abuse, the lower spectrum of the average age would need to be used. Still investigating this, but I am hopeful that something like this will work and it wont consume any measurable resources as it would only require to boost the satoshi total from the inputs based on a deterministic algo. I guess that could be one approach for the protected funds interest rates, the notaries can vote for the current applicable rate.

So you can see that while some details are changing from the original conception, the overall requirements and goals are held intact. By minimizing the changes, reliability is increased.
sr. member
Activity: 784
Merit: 253
Set Your Ideas Free
legendary
Activity: 1540
Merit: 1000
legendary
Activity: 1428
Merit: 1000
Also just to add if you want to invest such a small amount you could also take up the sig bounty and get KMD instead of the BTC.
legendary
Activity: 1428
Merit: 1000
Minimum investment is 0.0777 which is just under $50.

People can choose to pool their funds together to reach the min or they can just buy BTCD which wont have any minimums to get around this restriction.
hero member
Activity: 686
Merit: 502
please give me the signature bounty link,I want do this

https://bitcointalksearch.org/topic/komodo-signature-and-avatar-campaign-campaign-has-ended-1619450

IMHO there should not be any minimum limit to invest in ICO and even if there were, it should have been much lower like 0.001 btc etc to give more people chance to invest

I imagine smaller investments become spammy. I think its a good idea to have  a limit, otherwise people will be investing dust to recieve 0.000001 KMD
legendary
Activity: 2688
Merit: 1026
Hire me for Bounty Management
IMHO there should not be any minimum limit to invest in ICO and even if there were, it should have been much lower like 0.001 btc etc to give more people chance to invest
full member
Activity: 160
Merit: 100
please give me the signature bounty link,I want do this
legendary
Activity: 2688
Merit: 1026
Hire me for Bounty Management
If you need translation in Hindi for India,I can do it
sr. member
Activity: 784
Merit: 253
Set Your Ideas Free
Hi Komodo!
Why there is still no translation into Russian?


Sorry! We will start publishing the translations very soon.
hero member
Activity: 1134
Merit: 523
Hi Komodo!
Why there is still no translation into Russian?
legendary
Activity: 1176
Merit: 1134
without wanting to spread FUD and I know this comment will generate heat but I was just curious to see on github some of the iguana code:

Code:
if ( myinfo->IAMNOTARY != 0 && (lastheight % myinfo->NOTARY.NUMRELAYS) == myinfo->NOTARY.RELAYID )
    {
        // if designated relay, submit checkpoint -> add ip/relayid to opreturn
        //
        if ( strcmp(coin->symbol,"BTCD") == 0 )
        {
            if ( btc != 0 )
            {
               
            }
        }
        else
        {
        }
    }
    return(timestamp);


that is code in datachain.c, which is mostly for smartchains next year and it is not completed yet, though that function really wont have much more to do. Another possible use is for enabling dPoW for third party chains, but again, that is not completed yet.

oh, and it might be more useful to see the entire (not completed yet) datachain.c file:

Code:
/******************************************************************************
 * Copyright © 2014-2016 The SuperNET Developers.                             *
 *                                                                            *
 * See the AUTHORS, DEVELOPER-AGREEMENT and LICENSE files at                  *
 * the top-level directory of this distribution for the individual copyright  *
 * holder information and the developer policies on copyright and licensing.  *
 *                                                                            *
 * Unless otherwise agreed in a custom licensing agreement, no part of the    *
 * SuperNET software, including this file may be copied, modified, propagated *
 * or distributed except according to the terms contained in the LICENSE file *
 *                                                                            *
 * Removal or modification of this copyright notice is prohibited.            *
 *                                                                            *
 ******************************************************************************/

#include "../iguana/iguana777.h"
#include "datachain_events.c"

uint32_t datachain_checkpoint(struct supernet_info *myinfo,struct iguana_info *coin,uint32_t lastcheckpoint,uint32_t timestamp,bits256 merkle,int32_t lastheight,bits256 lasthash2)
{
    char str[65],str2[65]; struct iguana_info *btc = iguana_coinfind("BTC");
    printf("datachain_checkpoint.%s for %s.%u to %u lastheight.%d %s\n",bits256_str(str,merkle),coin->symbol,lastcheckpoint,timestamp,lastheight,bits256_str(str2,lasthash2));
    if ( myinfo->IAMNOTARY != 0 && (lastheight % myinfo->NOTARY.NUMRELAYS) == myinfo->NOTARY.RELAYID )
    {
        // if designated relay, submit checkpoint -> add ip/relayid to opreturn
        //
        if ( strcmp(coin->symbol,"BTCD") == 0 )
        {
            if ( btc != 0 )
            {
               
            }
        }
        else
        {
        }
    }
    return(timestamp);
}

int32_t datachain_events_rewind(struct supernet_info *myinfo,int32_t ordered,struct datachain_info *dPoW,int32_t height,uint32_t hdrsi,uint32_t unspentind)
{
    uint64_t hdrsi_unspentind; int32_t i;
    printf("datachain_events_rewind\n");
    if ( dPoW->numevents > 0 )
    {
        datachain_events_sort(dPoW);
        hdrsi_unspentind = ((uint64_t)hdrsi << 32) | unspentind;
        for (i=dPoW->numevents-1; i>=0; i--)
            if ( hdrsi_unspentind > dPoW->events[i]->hdrsi_unspentind )
                break;
        printf("dPoW rewind %d to %d\n",dPoW->numevents,i+1);
        dPoW->numevents = i+1;
    }
    return(dPoW->numevents);
}

int32_t datachain_checkpoint_update(struct supernet_info *myinfo,struct iguana_info *coin,uint32_t timestamp)
{
    int32_t i,num,n,lastheight; bits256 *tree,hash2,lasthash2,merkle; struct iguana_block *block;
    //printf("datachain_checkpoint_update\n");
    if ( coin->lastcheckpoint <= coin->blocks.hwmchain.height )
    {
        num = (coin->blocks.hwmchain.height - coin->lastcheckpoint) + 1;
        tree = (bits256 *)coin->blockspace;
        if ( num <= IGUANA_MAXPACKETSIZE/(sizeof(bits256) * 2) )
        {
            lastheight = -1;
            memset(lasthash2.bytes,0,sizeof(lasthash2));
            for (i=n=0; i            {
                hash2 = iguana_blockhash(coin,coin->lastcheckpoint + i);
                if ( bits256_nonz(hash2) != 0 )
                {
                    if ( (block= iguana_blockfind("datachain",coin,hash2)) != 0 && block->height == coin->lastcheckpoint + i && block->mainchain != 0 && block->RO.timestamp < timestamp )
                    {
                        tree[n++] = hash2;
                        lastheight = block->height;
                        lasthash2 = hash2;
                    }
                    else break;
                }
                else
                {
                    printf("got zero blockhash for %s.[%d]\n",coin->symbol,coin->lastcheckpoint + i);
                    break;
                }
            }
            if ( n > 0 && lastheight >= 0 && bits256_nonz(lasthash2) != 0 )
            {
                merkle = iguana_merkle(tree,num);
                coin->lastcheckpoint = datachain_checkpoint(myinfo,coin,coin->lastcheckpoint,timestamp,merkle,lastheight,lasthash2);
            }
        }
    }
    return(coin->lastcheckpoint);
}

void datachain_BTC_clock(struct supernet_info *myinfo,int32_t ordered,struct iguana_info *btc,int32_t height,uint32_t hdrsi,uint32_t unspentind,uint32_t timestamp)
{
    int32_t retval; struct iguana_info *btcd = iguana_coinfind("BTCD");
    //printf("datachain_BTC_clock\n");
    if ( (retval= datachain_eventadd(myinfo,ordered,&myinfo->dPoW.BTC,DATACHAIN_ISBTC,0)) < 0 )
    {
        myinfo->dPoW.BTC.numevents = datachain_events_rewind(myinfo,ordered,&myinfo->dPoW.BTC,height,hdrsi,unspentind);
    }
    else if ( retval > 0 )
    {
        if ( ordered != 0 && btcd != 0 && btcd->started != 0 && btcd->active != 0 )
        {
            // new BTC block actions, ie gather BTCD hashes for checkpoint
            btcd->lastcheckpoint = datachain_checkpoint_update(myinfo,btcd,timestamp);
            printf("NEWBLOCK.%s ht.%d\n",btc->symbol,height);
        }
    }
}

void datachain_KOMODO_newblock(struct supernet_info *myinfo,int32_t ordered,struct iguana_info *btcd,int32_t height,uint32_t hdrsi,uint32_t unspentind,uint32_t timestamp)
{
    int32_t retval; struct iguana_info *virt,*tmp;
    //printf("datachain_KOMODO_newblock\n");
    if ( (retval= datachain_eventadd(myinfo,ordered,&myinfo->dPoW.BTCD,DATACHAIN_ISKOMODO,0)) < 0 )
    {
        myinfo->dPoW.BTCD.numevents = datachain_events_rewind(myinfo,ordered,&myinfo->dPoW.BTCD,height,hdrsi,unspentind);
    }
    else if ( retval > 0 )
    {
        // new BTCD block actions, ie gather all virtual hashes for checkpoint
        if ( ordered != 0 )
        {
            HASH_ITER(hh,myinfo->allcoins,virt,tmp)
            {
                if ( virt->started != 0 && virt->active != 0 && virt->virtualchain != 0 )
                    virt->lastcheckpoint = datachain_checkpoint_update(myinfo,virt,timestamp);
            }
            //printf("NEWBLOCK.%s ht.%d\n",btcd->symbol,height);
        }
    }
}

void datachain_virt_newblock(struct supernet_info *myinfo,int32_t ordered,struct iguana_info *virt,int32_t height,uint32_t hdrsi,uint32_t unspentind,uint32_t timestamp)
{
    int32_t retval;
    printf("datachain_virt_newblock\n");
    if ( (retval= datachain_eventadd(myinfo,ordered,&virt->dPoW,0,0)) < 0 )
    {
        virt->dPoW.numevents = datachain_events_rewind(myinfo,ordered,&virt->dPoW,height,hdrsi,unspentind);
    }
    else if ( retval > 0 )
    {
        // new virt block actions, maybe nothing to do?
        if ( ordered != 0 )
            printf("NEWBLOCK.%s ht.%d\n",virt->symbol,height);
    }
}

int32_t datachain_datascript(struct iguana_info *coin,uint8_t *script,uint8_t *data,int32_t datalen)
{
    int32_t i,pkey0,plen,len = 0; uint8_t p2sh_rmd160[20]; struct vin_info V;
    memset(&V,0,sizeof(V));
    if ( len < 32*3 )
        pkey0 = 2, plen = 32;
    else pkey0 = 4, plen = 64;
    V.M = V.N = (datalen / plen) + ((datalen % plen) != 0);
    for (i=0; i    {
        V.signers[i].pubkey[0] = pkey0;
        memcpy(V.signers[i].pubkey+1,&data[len],plen), len += plen;
    }
    return(bitcoin_MofNspendscript(p2sh_rmd160,script,0,&V));
}

int32_t datachain_datascript_decode(uint8_t *opreturn,uint8_t *script,int32_t scriptlen,struct vin_info *vp,int32_t type)
{
    int32_t plen,i,oplen=0;
    //for (i=0; i    //    printf("%02x",script[i]);
    //printf(" <- MofNscript\n");
    for (i=0; iN; i++)
    {
        if ( (plen= bitcoin_pubkeylen(vp->signers[i].pubkey)) > 32 )
            memcpy(&opreturn[oplen],vp->signers[i].pubkey+1,plen-1), oplen += (plen - 1);
    }
    return(oplen);
}

int32_t datachain_opreturnscript(struct iguana_info *coin,uint8_t *script,char *datastr,int32_t datalen)
{
    int32_t offset = 0;
    script[offset++] = 0x6a;
    if ( datalen >= 0x4c )
    {
        if ( datalen > 0xff )
        {
            script[offset++] = 0x4d;
            script[offset++] = datalen & 0xff;
            script[offset++] = (datalen >> 8) & 0xff;
        }
        else
        {
            script[offset++] = 0x4c;
            script[offset++] = datalen;
        }
    } else script[offset++] = datalen;
    decode_hex(&script[offset],datalen,datastr);
    return(datalen + offset);
}

int32_t datachain_opreturn_decode(uint8_t *opreturn,uint8_t *script,int32_t scriptlen)
{
    int32_t datalen,len = 1;
    if ( (datalen= script[len++]) >= 76 )
    {
        if ( datalen == 0x4c )
            datalen = script[len++];
        else if ( datalen == 0x4d )
        {
            datalen = script[len++];
            datalen = (datalen << 8) | script[len++];
        }
    }
    memcpy(opreturn,&script[len],datalen);
    if ( len+datalen == scriptlen )
        return(datalen);
    else return(-1);
}

void datachain_opreturn(struct supernet_info *myinfo,int32_t ordered,struct iguana_info *coin,uint32_t timestamp,int32_t btc_or_btcd,int64_t crypto777_payment,int64_t burned,int32_t height,uint64_t hdrsi_unspentind,uint8_t *opreturn,int32_t oplen)
{
    uint32_t hdrsi,unspentind; struct datachain_event *event;
    hdrsi = (uint32_t)(hdrsi_unspentind >> 32);
    unspentind = (uint32_t)hdrsi_unspentind;
    //printf("datachain_opreturn\n");
    if ( btc_or_btcd == DATACHAIN_ISBTC ) // BTC
    {
        if ( opreturn == 0 )
            datachain_BTC_clock(myinfo,ordered,coin,height,hdrsi,unspentind,timestamp);
        else
        {
            if ( (event= datachain_event_create(coin,crypto777_payment,burned,height,hdrsi,unspentind,opreturn,oplen)) != 0 )
                datachain_eventadd(myinfo,ordered,&myinfo->dPoW.BTC,btc_or_btcd,event);
        }
    }
    else if ( btc_or_btcd == DATACHAIN_ISKOMODO ) // BTCD
    {
        if ( opreturn == 0 )
            datachain_KOMODO_newblock(myinfo,ordered,coin,height,hdrsi,unspentind,timestamp);
        else
        {
            if ( (event= datachain_event_create(coin,crypto777_payment,burned,height,hdrsi,unspentind,opreturn,oplen)) != 0 )
                datachain_eventadd(myinfo,ordered,&myinfo->dPoW.BTCD,btc_or_btcd,event);
        }
    }
    else
    {
        if ( opreturn == 0 )
            datachain_virt_newblock(myinfo,ordered,coin,height,hdrsi,unspentind,timestamp);
        else
        {
            if ( (event= datachain_event_create(coin,crypto777_payment,burned,height,hdrsi,unspentind,opreturn,oplen)) != 0 )
                datachain_eventadd(myinfo,ordered,&coin->dPoW,btc_or_btcd,event);
        }
    }
    if ( opreturn != 0 )
    {
        int32_t i;
        for (i=0; i            printf("%02x",opreturn[i]);
        printf(" <- opreturn.%s len.%d ht.%d [%d] u.%u 777 %.8f burn %.8f\n",coin->symbol,oplen,height,hdrsi,unspentind,dstr(crypto777_payment),dstr(burned));
    }
}

int32_t iguana_opreturn(struct supernet_info *myinfo,int32_t ordered,struct iguana_info *coin,uint32_t timestamp,struct iguana_bundle *bp,int64_t crypto777_payment,int32_t height,uint64_t hdrsi_unspentind,int64_t burned,uint32_t fileid,uint64_t scriptpos,uint32_t scriptlen)
{
    uint8_t type,scriptspace[IGUANA_MAXSCRIPTSIZE],opreturn[8192]; char fname[1024]; uint32_t oplen=0; int32_t btc_or_btcd=0,len = -1; struct vin_info V;
    //printf("iguana_opreturn\n");
    if ( strcmp("BTC",coin->symbol) == 0 )
        btc_or_btcd = DATACHAIN_ISBTC;
    else if ( strcmp("BTCD",coin->symbol) == 0 )
        btc_or_btcd = DATACHAIN_ISKOMODO;
    else if ( coin->virtualchain == 0 )
        return(-1);
    if ( height < bp->bundleheight || height >= bp->bundleheight+coin->chain->bundlesize )
    {
        printf("iguana_opreturn illegal height %d for [%d] %d\n",height,bp->hdrsi,bp->bundleheight);
        return(-1);
    }
    if ( crypto777_payment == 0 && burned == 0 && scriptlen == 0 && fileid == 0 && scriptpos == 0 )
    {
        datachain_opreturn(myinfo,ordered,coin,timestamp,btc_or_btcd,crypto777_payment,burned,height,hdrsi_unspentind,0,0);
        return(0);
    }
    if ( scriptpos > 0 && scriptlen > 0 )
    {
        iguana_voutsfname(coin,bp->ramchain.from_ro,fname,fileid);
        if ( (len= iguana_scriptdata(coin,scriptspace,coin->voutptrs[fileid],fname,scriptpos,scriptlen)) == scriptlen )
        {
            memset(&V,0,sizeof(V));
            V.spendlen = scriptlen;
            memcpy(V.spendscript,scriptspace,scriptlen);
            type = _iguana_calcrmd160(coin,&V);
            if ( type == IGUANA_SCRIPT_OPRETURN )
                oplen = datachain_opreturn_decode(opreturn,scriptspace,scriptlen);
            else oplen = datachain_datascript_decode(opreturn,scriptspace,scriptlen,&V,type);
            datachain_opreturn(myinfo,ordered,coin,timestamp,btc_or_btcd,crypto777_payment,burned,height,hdrsi_unspentind,opreturn,oplen);
            return(oplen);
        } else printf("iguana_opreturn error: %d bytes from fileid.%d[%d] %s for scriptlen.%d\n",len,fileid,(uint32_t)scriptpos,fname,scriptlen);
    }
    return(-1);
}

void datachain_update_spend(struct supernet_info *myinfo,int32_t ordered,struct iguana_info *coin,uint32_t timestamp,struct iguana_bundle *bp,int32_t height,bits256 txid,int32_t vout,uint8_t rmd160[20],int64_t value)
{
    if ( strcmp("BTC",coin->symbol) == 0 )
        datachain_update_txidvout(myinfo,ordered,coin,&myinfo->dPoW.BTC,DATACHAIN_ISBTC,height,txid,vout,rmd160,value);
    else if ( strcmp("BTCD",coin->symbol) == 0 )
        datachain_update_txidvout(myinfo,ordered,coin,&myinfo->dPoW.BTCD,DATACHAIN_ISKOMODO,height,txid,vout,rmd160,value);
    else datachain_update_txidvout(myinfo,ordered,coin,&coin->dPoW,0,height,txid,vout,rmd160,value);
}

int64_t datachain_update(struct supernet_info *myinfo,int32_t ordered,struct iguana_info *coin,uint32_t timestamp,struct iguana_bundle *bp,uint8_t rmd160[20],int64_t crypto777_payment,uint8_t type,int32_t height,uint64_t hdrsi_unspentind,int64_t value,uint32_t fileid,uint64_t scriptpos,int32_t scriptlen,bits256 txid,int32_t vout)
{
    if ( memcmp(rmd160,CRYPTO777_RMD160,20) == 0 )
    {
        crypto777_payment += value;
        printf("datachain_update crypto777 %.8f += %.8f\n",dstr(crypto777_payment),dstr(value));
    }
    else if ( crypto777_payment != 0 && (type == IGUANA_SCRIPT_OPRETURN || type == IGUANA_SCRIPT_3of3 || type == IGUANA_SCRIPT_2of2 || type == IGUANA_SCRIPT_1of1) )
    {
        printf("datachain_update opreturn\n");
        iguana_opreturn(myinfo,ordered,coin,timestamp,bp,crypto777_payment,height,hdrsi_unspentind,value,fileid,scriptpos,scriptlen);
    } else datachain_update_spend(myinfo,ordered,coin,timestamp,bp,height,txid,vout,rmd160,value);
    return(crypto777_payment);
}

Was it your attempt to FUD by finding the one function in a future module that wasnt 100% complete?

 
hero member
Activity: 586
Merit: 501
without wanting to spread FUD and I know this comment will generate heat but I was just curious to see on github some of the iguana code:

Code:
if ( myinfo->IAMNOTARY != 0 && (lastheight % myinfo->NOTARY.NUMRELAYS) == myinfo->NOTARY.RELAYID )
    {
        // if designated relay, submit checkpoint -> add ip/relayid to opreturn
        //
        if ( strcmp(coin->symbol,"BTCD") == 0 )
        {
            if ( btc != 0 )
            {
               
            }
        }
        else
        {
        }
    }
    return(timestamp);

sr. member
Activity: 784
Merit: 253
Set Your Ideas Free
i'm ready to be korean translation

Sorry all the translation bounties are taken. We only translated a handful of languages.
sr. member
Activity: 784
Merit: 253
Set Your Ideas Free
Why there is no real photo of dev team on your website? are you guys afraid to come in public? If you use your real pictures,it will boost your project's credibility further

Yes we are aware of that. However part of the team is anonymous - including our lead developer - so we all decided to not use full names & photos.

Knowing the identity of the developers doesn't guarantee success. What we believe to be important is the track record behind a name (real or pseudonym). In our case jl777 has over the years demonstrated his capability and determination to carry on with his projects and plans. The roadmap might have changed, but the overall long term goal has been the same. He has not abandoned his projects and has stayed responsible to his past investors.

SuperNET developed a multiwallet on top of the NXT platform. Anyone is able to deposit the supported coins through a service called 'MultiGateway', and then the coins will appear in your wallet as a Nxt token. Those tokens are backed by the real coin that is secured by a distributed solution. The NXT and SuperNET communities have already used this service for 1-2 year and trust in its authenticity. Projects and cases like this should convince people about jl777's credibility more than an official passport picture ever could.

On top of these the SuperNET has a lot of open source code behind it, that anyone can inspect. jl777 has already began the Komodo development process, and we encourage everyone to follow it and ask any questions that comes to mind!

Open Source code in GitHub:
Iguana - https://github.com/jl777/SuperNET
Komodo - https://github.com/jl777/komodo

Komodo development updates by jl777:
Komodo testnet launch    https://bitcointalksearch.org/topic/m.16245305
basilisk mode in testing   https://bitcointalksearch.org/topic/m.16245472
Iguana syncs with Zcash testnet and Komodo testnet   https://bitcointalksearch.org/topic/m.16250499
Bitcoin backstop protection on Komodo    https://bitcointalksearch.org/topic/m.16250635
Iguana's relationship with Komodo    https://bitcointalksearch.org/topic/m.16298855
NOTARY network and basilisk   https://bitcointalksearch.org/topic/m.16318305
Notary nodes and notarization protection https://bitcointalksearch.org/topic/m.16319733
Progress through bugfixing https://bitcointalksearch.org/topic/m.16326805

newbie
Activity: 27
Merit: 0
i'm ready to be korean translation
legendary
Activity: 854
Merit: 1000
Why there is no real photo of dev team on your website? are you guys afraid to come in public? If you use your real pictures,it will boost your project's credibility further
Jump to: