[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/biz/ - Business & Finance


View post   

File: 237 KB, 1280x720, 1589489326275.jpg [View same] [iqdb] [saucenao] [google]
19095496 No.19095496[DELETED]  [Reply] [Original]

Show me a single line of code this man has ever written

Just one

>> No.19095514

>>19095496
>if< (((jewish))) <scam idiots>

>> No.19095839

>>19095496
future(rightA="1 round lot pork bellies",
rightB="$1,500.00",
p = "for delivery in July 2002") =

when withinPeriod(p)
to Holder rightA with to Counterparty rightB
then terminate

>> No.19095898

>>19095839
https://nakamotoinstitute.org/contract-language/

he basically defined a computer parseable language in bnf and wrote code in it. probably wrote code in a bunch of languages one does not usually invent their own programming language without coding in a few.

>> No.19096134

>>19095839

Sorry, psuedocode doesn't count fren

>> No.19096161

>>19095496
grug can't design bitcoin

>> No.19096285

probably_absolute_compress(data,t) {
for all binary programs smaller than data {
run program until it halts or it has run for time t
if (output of program == data AND
length(program) < length(shortest_program)) {
shortest_program = program
}
}
print "the data: ", data
print "the (probably) absolute compression of the data", shortest_program
return shortest_program
}

>> No.19096298

>>19096285
that's pseudocode nigger

>> No.19096344

probably_true_random_test(data,t) {
if length(probably_absolute_compress(data,t)) = length(data)
then print "data is probably random"
else print "pattern found, data is not random"
}

probably_true_random_distill(data,t) {
return probably_absolute_compress(seed,t)
}

>> No.19096356

>>19096285
>>19096344

Great! Now post real code. Just one line will do.

>> No.19096360

>>19096298
that's VM language you retarded nigger
all smart contract platforms are VMs
are you smoking crack?

>> No.19096378

>>19096356
is python a real coding language?
kys

>> No.19096405

also

who was in the digicash team?
zooko and who else?

>> No.19096442

class COutPoint;
class CInPoint;
class CDiskTxPos;
class CCoinBase;
class CTxIn;
class CTxOut;
class CTransaction;
class CBlock;
class CBlockIndex;
class CWalletTx;
class CKeyItem;

static const unsigned int MAX_SIZE = 0x02000000;
static const int64 COIN = 1000000;
static const int64 CENT = 10000;
static const int64 TRANSACTIONFEE = 1 * CENT; /// change this to a user options setting, optional fee can be zero
///static const unsigned int MINPROOFOFWORK = 40; /// need to decide the right difficulty to start with
static const unsigned int MINPROOFOFWORK = 20; /// ridiculously easy for testing

>> No.19096458

extern map<uint256, CBlockIndex*> mapBlockIndex;
extern const uint256 hashGenesisBlock;
extern CBlockIndex* pindexGenesisBlock;
extern int nBestHeight;
extern CBlockIndex* pindexBest;
extern unsigned int nTransactionsUpdated;
extern int fGenerateBitcoins;

>> No.19096461

He looks kinda slow.

>> No.19096478

>>19096378
>>19096405
>>19096442

You seem flustered anon. Just one line is all you need to complete the challenge. You can do it!

>> No.19096481

FILE* OpenBlockFile(unsigned int nFile, unsigned int nBlockPos, const char* pszMode="rb");
FILE* AppendBlockFile(unsigned int& nFileRet);
bool AddKey(const CKey& key);
vector<unsigned char> GenerateNewKey();
bool AddToWallet(const CWalletTx& wtxIn);
void ReacceptWalletTransactions();
void RelayWalletTransactions();
bool LoadBlockIndex(bool fAllowNew=true);
bool BitcoinMiner();
bool ProcessMessages(CNode* pfrom);
bool ProcessMessage(CNode* pfrom, string strCommand, CDataStream& vRecv);
bool SendMessages(CNode* pto);
int64 CountMoney();
bool CreateTransaction(CScript scriptPubKey, int64 nValue, CWalletTx& txNew);
bool SendMoney(CScript scriptPubKey, int64 nValue, CWalletTx& wtxNew);

>> No.19096511

class CDiskTxPos
{
public:
unsigned int nFile;
unsigned int nBlockPos;
unsigned int nTxPos;

CDiskTxPos()
{
SetNull();
}

CDiskTxPos(unsigned int nFileIn, unsigned int nBlockPosIn, unsigned int nTxPosIn)
{
nFile = nFileIn;
nBlockPos = nBlockPosIn;
nTxPos = nTxPosIn;
}

IMPLEMENT_SERIALIZE( READWRITE(FLATDATA(*this)); )
void SetNull() { nFile = -1; nBlockPos = 0; nTxPos = 0; }
bool IsNull() const { return (nFile == -1); }

friend bool operator==(const CDiskTxPos& a, const CDiskTxPos& b)
{
return (a.nFile == b.nFile &&
a.nBlockPos == b.nBlockPos &&
a.nTxPos == b.nTxPos);
}

friend bool operator!=(const CDiskTxPos& a, const CDiskTxPos& b)
{
return !(a == b);
}

void print() const
{
if (IsNull())
printf("null");
else
printf("(nFile=%d, nBlockPos=%d, nTxPos=%d)", nFile, nBlockPos, nTxPos);
}
};

>> No.19096530

class CInPoint
{
public:
CTransaction* ptx;
unsigned int n;

CInPoint() { SetNull(); }
CInPoint(CTransaction* ptxIn, unsigned int nIn) { ptx = ptxIn; n = nIn; }
void SetNull() { ptx = NULL; n = -1; }
bool IsNull() const { return (ptx == NULL && n == -1); }
};
class COutPoint
{
public:
uint256 hash;
unsigned int n;

COutPoint() { SetNull(); }
COutPoint(uint256 hashIn, unsigned int nIn) { hash = hashIn; n = nIn; }
IMPLEMENT_SERIALIZE( READWRITE(FLATDATA(*this)); )
void SetNull() { hash = 0; n = -1; }
bool IsNull() const { return (hash == 0 && n == -1); }

friend bool operator<(const COutPoint& a, const COutPoint& b)
{
return (a.hash < b.hash || (a.hash == b.hash && a.n < b.n));
}

friend bool operator==(const COutPoint& a, const COutPoint& b)
{
return (a.hash == b.hash && a.n == b.n);
}

friend bool operator!=(const COutPoint& a, const COutPoint& b)
{
return !(a == b);
}

void print() const
{
printf("COutPoint(%s, %d)", hash.ToString().substr(0,6).c_str(), n);
}
};

>> No.19096533

>>19096134
check the link out he provably wrote computer parseable code so i guess you are btfo af

>> No.19096548

//
// An input of a transaction. It contains the location of the previous
// transaction's output that it claims and a signature that matches the
// output's public key.
//
class CTxIn
{
public:
COutPoint prevout;
CScript scriptSig;

CTxIn()
{
}

CTxIn(COutPoint prevoutIn, CScript scriptSigIn)
{
prevout = prevoutIn;
scriptSig = scriptSigIn;
}

CTxIn(uint256 hashPrevTx, unsigned int nOut, CScript scriptSigIn)
{
prevout = COutPoint(hashPrevTx, nOut);
scriptSig = scriptSigIn;
}

IMPLEMENT_SERIALIZE
(
READWRITE(prevout);
READWRITE(scriptSig);
)

bool IsPrevInMainChain() const
{
return CTxDB("r").ContainsTx(prevout.hash);
}

friend bool operator==(const CTxIn& a, const CTxIn& b)
{
return (a.prevout == b.prevout && a.scriptSig == b.scriptSig);
}

friend bool operator!=(const CTxIn& a, const CTxIn& b)
{
return !(a == b);
}

void print() const
{
printf("CTxIn(");
prevout.print();
if (prevout.IsNull())
{
printf(", coinbase %s)\n", HexStr(scriptSig.begin(), scriptSig.end(), false).c_str());
}
else
{
if (scriptSig.size() >= 6)
printf(", scriptSig=%02x%02x", scriptSig[4], scriptSig[5]);
printf(")\n");
}
}

bool IsMine() const;
int64 GetDebit() const;
};

>> No.19096565

//
// An output of a transaction. It contains the public key that the next input
// must be able to sign with to claim it.
//
class CTxOut
{
public:
int64 nValue;
unsigned int nSequence;
CScript scriptPubKey;

// disk only
CDiskTxPos posNext; //// so far this is only used as a flag, nothing uses the location

public:
CTxOut()
{
nValue = 0;
nSequence = UINT_MAX;
}

CTxOut(int64 nValueIn, CScript scriptPubKeyIn, int nSequenceIn=UINT_MAX)
{
nValue = nValueIn;
scriptPubKey = scriptPubKeyIn;
nSequence = nSequenceIn;
}

IMPLEMENT_SERIALIZE
(
READWRITE(nValue);
READWRITE(nSequence);
READWRITE(scriptPubKey);
if (nType & SER_DISK)
READWRITE(posNext);
)

uint256 GetHash() const { return SerializeHash(*this); }

bool IsFinal() const
{
return (nSequence == UINT_MAX);
}

bool IsMine() const
{
return ::IsMine(scriptPubKey);
}

int64 GetCredit() const
{
if (IsMine())
return nValue;
return 0;
}

friend bool operator==(const CTxOut& a, const CTxOut& b)
{
return (a.nValue == b.nValue &&
a.nSequence == b.nSequence &&
a.scriptPubKey == b.scriptPubKey);
}

friend bool operator!=(const CTxOut& a, const CTxOut& b)
{
return !(a == b);
}

void print() const
{
if (scriptPubKey.size() >= 6)
printf("CTxOut(nValue=%I64d, nSequence=%u, scriptPubKey=%02x%02x, posNext=", nValue, nSequence, scriptPubKey[4], scriptPubKey[5]);
posNext.print();
printf(")\n");
}
};

>> No.19096582

>>19096356
i guess you are not a dev but a layman. i'm a dev.
pseudo code is also code but if your criteria is machine interpretable then that's fulfilled also.

just accept you lost.

>> No.19096587

//
// The basic transaction that is broadcasted on the network and contained in
// blocks. A transaction can contain multiple inputs and outputs.
//
class CTransaction
{
public:
vector<CTxIn> vin;
vector<CTxOut> vout;
unsigned int nLockTime;


CTransaction()
{
SetNull();
}

IMPLEMENT_SERIALIZE
(
if (!(nType & SER_GETHASH))
READWRITE(nVersion);

// Set version on stream for writing back same version
if (fRead && s.nVersion == -1)
s.nVersion = nVersion;

READWRITE(vin);
READWRITE(vout);
READWRITE(nLockTime);
)

void SetNull()
{
vin.clear();
vout.clear();
nLockTime = 0;
}

bool IsNull() const
{
return (vin.empty() && vout.empty());
}

uint256 GetHash() const
{
return SerializeHash(*this);
}

bool AllPrevInMainChain() const
{
foreach(const CTxIn& txin, vin)
if (!txin.IsPrevInMainChain())
return false;
return true;
}

bool IsFinal() const
{
if (nLockTime == 0)
return true;
if (nLockTime < GetAdjustedTime())
return true;
foreach(const CTxOut& txout, vout)
if (!txout.IsFinal())
return false;
return true;
}

>> No.19096607

bool IsUpdate(const CTransaction& b) const
{
if (vin.size() != b.vin.size() || vout.size() != b.vout.size())
return false;
for (int i = 0; i < vin.size(); i++)
if (vin[i].prevout != b.vin[i].prevout)
return false;

bool fNewer = false;
unsigned int nLowest = UINT_MAX;
for (int i = 0; i < vout.size(); i++)
{
if (vout[i].nSequence != b.vout[i].nSequence)
{
if (vout[i].nSequence <= nLowest)
{
fNewer = false;
nLowest = vout[i].nSequence;
}
if (b.vout[i].nSequence < nLowest)
{
fNewer = true;
nLowest = b.vout[i].nSequence;
}
}
}
return fNewer;
}

bool IsCoinBase() const
{
return (vin.size() == 1 && vin[0].prevout.IsNull());
}

bool CheckTransaction() const
{
// Basic checks that don't depend on any context
if (vin.empty() || vout.empty())
return false;

// Check for negative values
int64 nValueOut = 0;
foreach(const CTxOut& txout, vout)
{
if (txout.nValue < 0)
return false;
nValueOut += txout.nValue;
}

if (IsCoinBase())
{
if (vin[0].scriptSig.size() > 100)
return false;
}
else
{
foreach(const CTxIn& txin, vin)
if (txin.prevout.IsNull())
return false;
}

return true;
}

bool IsMine() const
{
foreach(const CTxOut& txout, vout)
if (txout.IsMine())
return true;
return false;
}

>> No.19096621

int64 GetDebit() const
{
int64 nDebit = 0;
foreach(const CTxIn& txin, vin)
nDebit += txin.GetDebit();
return nDebit;
}

int64 GetCredit() const
{
int64 nCredit = 0;
foreach(const CTxOut& txout, vout)
nCredit += txout.GetCredit();
return nCredit;
}

int64 GetValueOut() const
{
int64 nValueOut = 0;
foreach(const CTxOut& txout, vout)
{
if (txout.nValue < 0)
throw runtime_error("CTransaction::GetValueOut() : negative value");
nValueOut += txout.nValue;
}
return nValueOut;
}

>> No.19096635

bool ReadFromDisk(CDiskTxPos pos, FILE** pfileRet=NULL)
{
CAutoFile filein = OpenBlockFile(pos.nFile, 0, pfileRet ? "rb+" : "rb");
if (!filein)
return false;

// Read transaction
if (fseek(filein, pos.nTxPos, SEEK_SET) != 0)
return false;
filein >> *this;

// Return file pointer
if (pfileRet)
{
if (fseek(filein, pos.nTxPos, SEEK_SET) != 0)
return false;
*pfileRet = filein.release();
}
return true;
}


friend bool operator==(const CTransaction& a, const CTransaction& b)
{
return (a.vin == b.vin &&
a.vout == b.vout &&
a.nLockTime == b.nLockTime);
}

friend bool operator!=(const CTransaction& a, const CTransaction& b)
{
return !(a == b);
}


void print() const
{
printf("CTransaction(vin.size=%d, vout.size=%d, nLockTime=%d)\n",
vin.size(),
vout.size(),
nLockTime);
for (int i = 0; i < vin.size(); i++)
{
printf(" ");
vin[i].print();
}
for (int i = 0; i < vout.size(); i++)
{
printf(" ");
vout[i].print();
}
}

>> No.19096637

Anon you can keep spamming Satoshi code but we all know he would have to sign first to take credit for that. Get it together! Just post one real line of code that can actually be run right now.

>> No.19096654

>>19096637
what satoshi code?
this is on the bit gold repository

>> No.19096668

//
// A transaction with a merkle branch linking it to the timechain
//
class CMerkleTx : public CTransaction
{
public:
uint256 hashBlock;
vector<uint256> vMerkleBranch;
int nIndex;

CMerkleTx()
{
Init();
}

CMerkleTx(const CTransaction& txIn) : CTransaction(txIn)
{
Init();
}

void Init()
{
hashBlock = 0;
nIndex = -1;
}

IMPLEMENT_SERIALIZE
(
nSerSize += SerReadWrite(s, *(CTransaction*)this, nType, nVersion, ser_action);
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
READWRITE(hashBlock);
READWRITE(vMerkleBranch);
READWRITE(nIndex);
)


int SetMerkleBranch();
int IsInMainChain() const;
bool AcceptTransaction(CTxDB& txdb, bool fCheckInputs=true);
bool AcceptTransaction() { CTxDB txdb("r"); return AcceptTransaction(txdb); }
};

>> No.19096683

>>19096637
yeah nick is not satoshi nor is adam back and definitely nope on that imbecile craig.
nobody knows the real identity of satoshi. and by that i mean he is not a known public figure. by choice and took painstaking measures to remain so.

>> No.19096692

//
// A transaction with a bunch of additional info that only the owner cares
// about. It includes any unrecorded transactions needed to link it back
// to the timechain.
//
class CWalletTx : public CMerkleTx
{
public:
vector<CMerkleTx> vtxPrev;
map<string, string> mapValue;
vector<pair<string, string> > vOrderForm;
unsigned int nTime;
char fFromMe;
char fSpent;

//// probably need to sign the order info so know it came from payer

CWalletTx()
{
Init();
}

CWalletTx(const CMerkleTx& txIn) : CMerkleTx(txIn)
{
Init();
}

CWalletTx(const CTransaction& txIn) : CMerkleTx(txIn)
{
Init();
}

void Init()
{
nTime = 0;
fFromMe = false;
fSpent = false;
}

>> No.19096701

>>19096654
can you post the link pls!

>> No.19096711

IMPLEMENT_SERIALIZE
(
/// would be nice for it to return the version number it reads, maybe use a reference
nSerSize += SerReadWrite(s, *(CMerkleTx*)this, nType, nVersion, ser_action);
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
READWRITE(vtxPrev);
READWRITE(mapValue);
READWRITE(vOrderForm);
READWRITE(nTime);
READWRITE(fFromMe);
READWRITE(fSpent);
)

bool WriteToDisk()
{
return CWalletDB().WriteTx(GetHash(), *this);
}


void AddSupportingTransactions(CTxDB& txdb);
void AddSupportingTransactions() { CTxDB txdb("r"); AddSupportingTransactions(txdb); }

bool AcceptWalletTransaction(CTxDB& txdb, bool fCheckInputs=true);
bool AcceptWalletTransaction() { CTxDB txdb("r"); return AcceptWalletTransaction(txdb); }

void RelayWalletTransaction(CTxDB& txdb);
void RelayWalletTransaction() { CTxDB txdb("r"); RelayWalletTransaction(txdb); }
};

>> No.19096715

>>19095496
>Is mark wahlberg smoke crack?

>> No.19096725

//
// Nodes collect new transactions into a block, hash them into a hash tree,
// and scan through nonce values to make the block's hash satisfy proof-of-work
// requirements. When they solve the proof-of-work, they broadcast the block
// to everyone and the block is added to the timechain. The first transaction
// in the block is a special one that creates a new coin owned by the creator
// of the block.
//
// Blocks are appended to blk0001.dat files on disk. Their location on disk
// is indexed by CBlockIndex objects in memory.
//
class CBlock
{
public:
// header
uint256 hashPrevBlock;
uint256 hashMerkleRoot;
unsigned int nTime;
unsigned int nBits;
unsigned int nNonce;

// network and disk
vector<CTransaction> vtx;

// memory only
mutable vector<uint256> vMerkleTree;


CBlock()
{
SetNull();
}

>> No.19096740

IMPLEMENT_SERIALIZE
(
if (!(nType & SER_GETHASH))
READWRITE(nVersion);
READWRITE(hashPrevBlock);
READWRITE(hashMerkleRoot);
READWRITE(nTime);
READWRITE(nBits);
READWRITE(nNonce);

// ConnectBlock depends on vtx being last so it can calculate offset
if (!(nType & (SER_GETHASH|SER_BLOCKHEADERONLY)))
READWRITE(vtx);
else if (fRead)
const_cast<CBlock*>(this)->vtx.clear();
)

void SetNull()
{
hashPrevBlock = 0;
hashMerkleRoot = 0;
nTime = 0;
nBits = 0;
nNonce = 0;
vtx.clear();
vMerkleTree.clear();
}

bool IsNull() const
{
return (nBits == 0);
}

uint256 GetHash() const
{
return Hash(BEGIN(hashPrevBlock), END(nNonce));
}

uint256 BuildMerkleTree() const
{
vMerkleTree.clear();
foreach(const CTransaction& tx, vtx)
vMerkleTree.push_back(tx.GetHash());
int j = 0;
for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
{
for (int i = 0; i < nSize; i += 2)
{
int i2 = min(i+1, nSize-1);
vMerkleTree.push_back(Hash(BEGIN(vMerkleTree[j+i]), END(vMerkleTree[j+i]),
BEGIN(vMerkleTree[j+i2]), END(vMerkleTree[j+i2])));
}
j += nSize;
}
return (vMerkleTree.empty() ? 0 : vMerkleTree.back());
}

>> No.19096750

vector<uint256> GetMerkleBranch(int nIndex) const
{
if (vMerkleTree.empty())
BuildMerkleTree();
vector<uint256> vMerkleBranch;
int j = 0;
for (int nSize = vtx.size(); nSize > 1; nSize = (nSize + 1) / 2)
{
int i = min(nIndex^1, nSize-1);
vMerkleBranch.push_back(vMerkleTree[j+i]);
nIndex >>= 1;
j += nSize;
}
return vMerkleBranch;
}

static uint256 CheckMerkleBranch(uint256 hash, const vector<uint256>& vMerkleBranch, int nIndex)
{
foreach(const uint256& otherside, vMerkleBranch)
{
if (nIndex & 1)
hash = Hash(BEGIN(otherside), END(otherside), BEGIN(hash), END(hash));
else
hash = Hash(BEGIN(hash), END(hash), BEGIN(otherside), END(otherside));
nIndex >>= 1;
}
return hash;
}