Skip to content

Commit

Permalink
Committing bip39 and bip44 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
SDCDev committed Sep 9, 2015
1 parent 579b231 commit a19444f
Show file tree
Hide file tree
Showing 55 changed files with 22,862 additions and 316 deletions.
2,048 changes: 2,048 additions & 0 deletions contrib/bip39/chinese_simplified.txt

Large diffs are not rendered by default.

2,048 changes: 2,048 additions & 0 deletions contrib/bip39/chinese_traditional.txt

Large diffs are not rendered by default.

2,048 changes: 2,048 additions & 0 deletions contrib/bip39/english.txt

Large diffs are not rendered by default.

2,048 changes: 2,048 additions & 0 deletions contrib/bip39/french.txt

Large diffs are not rendered by default.

2,048 changes: 2,048 additions & 0 deletions contrib/bip39/japanese.txt

Large diffs are not rendered by default.

2,048 changes: 2,048 additions & 0 deletions contrib/bip39/spanish.txt

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions contrib/gitian-descriptors/README
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ Name: gitianbuild
Type: Linux (64bit)
Version: Debian

Memory: 1024Mb+ ( less than 1024 could cause major performance issues when compiling )
Memory: 1400MB or more
Hard Drive: Create a virtual hard drive now
Hard drive file type: VDI ( Virtualbox disk image )
Storage on physical hard drive : Dynamically allocated
File location and size: 40Gb
File location and size: 40GB (20GB should work)

<CREATE>

Expand Down
6 changes: 6 additions & 0 deletions release-notes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ Shadowcoin Release Notes

Version 1.3.3.0

- Added BIP44 support

- Added BIP39 support

- Added smaller ring signatures
https://bitcointalk.org/index.php?topic=972541.msg10619684

- The goal for this release is to implement a framework for BIP32
on which to build, the more interesting features possible with bip32 keys can
Expand Down
3 changes: 2 additions & 1 deletion shadow.pro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
TEMPLATE = app
TARGET = shadow
VERSION = 1.3.3.0
VERSION = 1.3.3.1
INCLUDEPATH += src src/json src/qt
DEFINES += BOOST_THREAD_USE_LIB BOOST_SPIRIT_THREADSAFE
CONFIG += no_include_pwd
Expand Down Expand Up @@ -337,6 +337,7 @@ SOURCES += \
src/rpcrawtransaction.cpp \
src/rpcsmessage.cpp \
src/rpcextkey.cpp \
src/rpcmnemonic.cpp \
src/qt/transactiontablemodel.cpp \
src/qt/coincontroldialog.cpp \
src/qt/coincontroltreewidget.cpp \
Expand Down
10 changes: 9 additions & 1 deletion shadow.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,18 @@
<file alias="history">src/qt/res/icons/history.png</file>
<file alias="syncing">src/qt/res/icons/syncing.gif</file>
<file alias="syncing_static">src/qt/res/icons/syncing_static.gif</file>
<file alias="backbtn">src/qt/res/icons/backbtn.png</file>
<file alias="fwdbtn">src/qt/res/icons/fwdbtn.png</file>
</qresource>
<qresource prefix="/images">
<file alias="about">src/qt/res/images/about.png</file>
<file alias="splash">src/qt/res/images/splash.png</file>
<file alias="sdc-vertical">src/qt/res/images/sdc-vertical.png</file>
<file alias="graph">src/qt/res/images/graph.png</file>
<file alias="default">src/qt/res/images/avatars/default.png</file>
<file alias="extkey_new">src/qt/res/images/extkey_new.png</file>
<file alias="extkey_open">src/qt/res/images/extkey_open.png</file>
<file alias="extkey_recover">src/qt/res/images/extkey_recover.png</file>
</qresource>
<qresource prefix="/translations">
<file alias="ar">src/qt/locale/bitcoin_ar.qm</file>
Expand Down Expand Up @@ -112,10 +117,13 @@
<file alias="OpenSans-BoldItalic.ttf">src/qt/res/css/fonts/OpenSans-BoldItalic.ttf</file>
<file alias="OpenSans-Italic.ttf">src/qt/res/css/fonts/OpenSans-Italic.ttf</file>
<file alias="OpenSans-LightItalic.ttf">src/qt/res/css/fonts/OpenSans-LightItalic.ttf</file>
<file alias="chinese_s.otf">src/qt/res/css/fonts/chinese_s.otf</file>
<file alias="chinese_t.otf">src/qt/res/css/fonts/chinese_t.otf</file>
<file alias="japanese.otf">src/qt/res/css/fonts/japanese.otf</file>
</qresource>
<qresource prefix="/js">
<file alias="footable.js">src/qt/res/js/footable.js</file>
<file alias="contextMenu.min.js">src/qt/res/js/contextMenu.min.js</file>
<file alias="footable.js">src/qt/res/js/footable.js</file>
<file alias="footable.filter.js">src/qt/res/js/footable.filter.js</file>
<file alias="footable.paginate.js">src/qt/res/js/footable.paginate.js</file>
<file alias="footable.sort.js">src/qt/res/js/footable.sort.js</file>
Expand Down
2 changes: 1 addition & 1 deletion src/alert.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// file COPYING or http://www.opensource.org/licenses/mit-license.php.

#ifndef _BITCOINALERT_H_
#define _BITCOINALERT_H_ 1
#define _BITCOINALERT_H_

#include <set>
#include <string>
Expand Down
33 changes: 28 additions & 5 deletions src/base58.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,17 +573,28 @@ class CExtKey58 : public CBase58Data
void SetKey(const CExtKeyPair &key, CChainParams::Base58Type type)
{
uint8_t vch[74];
if (type == CChainParams::EXT_SECRET_KEY)
key.EncodeV(vch);
else
key.EncodeP(vch);

switch (type)
{
case CChainParams::EXT_SECRET_KEY:
case CChainParams::EXT_SECRET_KEY_BTC:
key.EncodeV(vch);
break;
//case CChainParams::EXT_PUBLIC_KEY:
//case CChainParams::EXT_PUBLIC_KEY_BTC:
default:
key.EncodeP(vch);
break;
};

SetData(Params().Base58Prefix(type), vch, vch+74);
};

CExtKeyPair GetKey()
{
CExtKeyPair ret;
if (vchVersion == Params().Base58Prefix(CChainParams::EXT_SECRET_KEY))
if (vchVersion == Params().Base58Prefix(CChainParams::EXT_SECRET_KEY)
|| vchVersion == Params().Base58Prefix(CChainParams::EXT_SECRET_KEY_BTC))
{
ret.DecodeV(&vchData[0]);
return ret;
Expand All @@ -610,12 +621,24 @@ class CExtKey58 : public CBase58Data
else
if (0 == memcmp(&vchBytes[0], &Params().Base58Prefix(CChainParams::EXT_PUBLIC_KEY)[0], 4))
type = CChainParams::EXT_PUBLIC_KEY;
else
if (0 == memcmp(&vchBytes[0], &Params().Base58Prefix(CChainParams::EXT_SECRET_KEY_BTC)[0], 4))
type = CChainParams::EXT_SECRET_KEY_BTC;
else
if (0 == memcmp(&vchBytes[0], &Params().Base58Prefix(CChainParams::EXT_PUBLIC_KEY_BTC)[0], 4))
type = CChainParams::EXT_PUBLIC_KEY_BTC;
else
return 4;

SetData(Params().Base58Prefix(type), &vchBytes[4], &vchBytes[4]+74);
return 0;
};

bool IsValid(CChainParams::Base58Type prefix) const
{
return vchVersion == Params().Base58Prefix(prefix)
&& vchData.size() == BIP32_KEY_N_BYTES;
}
};

#endif // BITCOIN_BASE58_H
42 changes: 24 additions & 18 deletions src/chainparams.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ class CMainParams : public CBaseChainParams {

nDefaultPort = 51737;
nRPCPort = 51736;
nBIP44ID = 0x80000016;

nFirstPosv2Block = 453000;

bnProofOfWorkLimit = CBigNum(~uint256(0) >> 20); // "standard" scrypt target limit for proof of work, results with 0,000244140625 proof-of-work difficulty
Expand All @@ -159,15 +161,16 @@ class CMainParams : public CBaseChainParams {
assert(hashGenesisBlock == uint256("0x00000eca234f07edc98aaf3f2a7b7478dc58992a9cd439323d099c6a590ca2bb"));
assert(genesis.hashMerkleRoot == uint256("0x26a3ff5d3dc46b091e7b58b6022982e6d27dff1bab3bd1da6beb4790983c87c4"));

base58Prefixes[PUBKEY_ADDRESS] = list_of(63).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[SCRIPT_ADDRESS] = list_of(125).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[SECRET_KEY] = list_of(191).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[STEALTH_ADDRESS] = list_of(40).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0xEE)(0x80)(0x28)(0x6A).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = list_of(0xEE)(0x80)(0x31)(0xE8).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_KEY_HASH] = list_of(137).convert_to_container<std::vector<unsigned char> >(); // x
base58Prefixes[EXT_ACC_HASH] = list_of(83).convert_to_container<std::vector<unsigned char> >(); // a

base58Prefixes[PUBKEY_ADDRESS] = list_of(63).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[SCRIPT_ADDRESS] = list_of(125).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[SECRET_KEY] = list_of(191).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[STEALTH_ADDRESS] = list_of(40).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0xEE)(0x80)(0x28)(0x6A).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = list_of(0xEE)(0x80)(0x31)(0xE8).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_KEY_HASH] = list_of(137).convert_to_container<std::vector<unsigned char> >(); // x
base58Prefixes[EXT_ACC_HASH] = list_of(83).convert_to_container<std::vector<unsigned char> >(); // a
base58Prefixes[EXT_PUBLIC_KEY_BTC] = list_of(0x04)(0x88)(0xB2)(0x1E).convert_to_container<std::vector<unsigned char> >(); // xprv
base58Prefixes[EXT_SECRET_KEY_BTC] = list_of(0x04)(0x88)(0xAD)(0xE4).convert_to_container<std::vector<unsigned char> >(); // xpub

vSeeds.push_back(CDNSSeedData("shadow.cash", "seed.shadow.cash"));
vSeeds.push_back(CDNSSeedData("shadow.cash", "seed2.shadow.cash"));
Expand Down Expand Up @@ -204,6 +207,8 @@ class CTestNetParams : public CBaseChainParams {

nDefaultPort = 51997;
nRPCPort = 51996;
nBIP44ID = 0x80000016;

nFirstPosv2Block = 91400;

bnProofOfWorkLimit = CBigNum(~uint256(0) >> 16);
Expand All @@ -215,15 +220,16 @@ class CTestNetParams : public CBaseChainParams {
hashGenesisBlock = genesis.GetHash();
assert(hashGenesisBlock == uint256("0x0000910a87c1385247edc82808ec498a2d738fea5f0d3f8801512d6b84ad6f72"));

base58Prefixes[PUBKEY_ADDRESS] = list_of(127).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[SCRIPT_ADDRESS] = list_of(196).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[SECRET_KEY] = list_of(255).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[STEALTH_ADDRESS] = list_of(40).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x76)(0xC0)(0xFD)(0xFB).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = list_of(0x76)(0xC1)(0x07)(0x7A).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_KEY_HASH] = list_of(75).convert_to_container<std::vector<unsigned char> >(); // X
base58Prefixes[EXT_ACC_HASH] = list_of(23).convert_to_container<std::vector<unsigned char> >(); // A

base58Prefixes[PUBKEY_ADDRESS] = list_of(127).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[SCRIPT_ADDRESS] = list_of(196).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[SECRET_KEY] = list_of(255).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[STEALTH_ADDRESS] = list_of(40).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x76)(0xC0)(0xFD)(0xFB).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_SECRET_KEY] = list_of(0x76)(0xC1)(0x07)(0x7A).convert_to_container<std::vector<unsigned char> >();
base58Prefixes[EXT_KEY_HASH] = list_of(75).convert_to_container<std::vector<unsigned char> >(); // X
base58Prefixes[EXT_ACC_HASH] = list_of(23).convert_to_container<std::vector<unsigned char> >(); // A
base58Prefixes[EXT_PUBLIC_KEY_BTC] = list_of(0x04)(0x35)(0x87)(0xCF).convert_to_container<std::vector<unsigned char> >(); // tprv
base58Prefixes[EXT_SECRET_KEY_BTC] = list_of(0x04)(0x35)(0x83)(0x94).convert_to_container<std::vector<unsigned char> >(); // tpub

//convertSeed6(vFixedSeeds, pnSeed6_test, ARRAYLEN(pnSeed6_test));
convertSeeds(vFixedSeeds, pnTestnetSeed, ARRAYLEN(pnTestnetSeed), nDefaultPort);
Expand Down
5 changes: 5 additions & 0 deletions src/chainparams.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ class CChainParams
EXT_SECRET_KEY,
EXT_KEY_HASH,
EXT_ACC_HASH,
EXT_PUBLIC_KEY_BTC,
EXT_SECRET_KEY_BTC,

MAX_BASE58_TYPES
};
Expand All @@ -78,6 +80,8 @@ class CChainParams

int RPCPort() const { return nRPCPort; }

int BIP44ID() const { return nBIP44ID; }


int LastPOWBlock() const { return nLastPOWBlock; }
int LastFairLaunchBlock() const { return nLastFairLaunchBlock; }
Expand All @@ -95,6 +99,7 @@ class CChainParams
std::string strNetworkID;
int nDefaultPort;
int nRPCPort;
int nBIP44ID;

int nFirstPosv2Block;
CBigNum bnProofOfWorkLimit;
Expand Down
4 changes: 2 additions & 2 deletions src/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,10 @@ class CTxIn
{
return (nSequence == std::numeric_limits<unsigned int>::max());
}

bool IsAnonInput() const
{
return (scriptSig.size() >= 2 + (33 + 32 + 32) // 2byte marker (cpubkey + sigc + sigr)
return (scriptSig.size() >= MIN_ANON_IN_SIZE
&& scriptSig[0] == OP_RETURN
&& scriptSig[1] == OP_ANON_MARKER);
}
Expand Down

0 comments on commit a19444f

Please sign in to comment.