Skip to content

Commit

Permalink
New Cryptocurrency: Ripple XRP wallet protocol added.
Browse files Browse the repository at this point in the history
  • Loading branch information
meherett committed Mar 12, 2023
1 parent 5d21692 commit b5b4fc0
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 40 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ This library simplifies the process of creating a new hierarchical deterministic
| Rapids | `RPD` | Yes | No | No | 320 | `m/44'/320'/0'/0/0` |
| Ravencoin | `RVN` | Yes | No | No | 175 | `m/44'/175'/0'/0/0` |
| Reddcoin | `RDD` | Yes | No | No | 4 | `m/44'/4'/0'/0/0` |
| Ripple | `XRP` | Yes | No | No | 144 | `m/44'/144'/0'/0/0` |
| Rubycoin | `RBY` | Yes | No | No | 16 | `m/44'/16'/0'/0/0` |
| Safecoin | `SAFE` | Yes | No | No | 19165 | `m/44'/19165'/0'/0/0` |
| Saluscoin | `SLS` | Yes | No | No | 572 | `m/44'/572'/0'/0/0` |
Expand Down
80 changes: 40 additions & 40 deletions hdwallet/cryptocurrencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -4911,6 +4911,46 @@ class ReddcoinMainnet(Cryptocurrency):
WIF_SECRET_KEY = 0xbd


class RippleMainnet(Cryptocurrency):

NAME = "Ripple"
SYMBOL = "XRP"
NETWORK = "mainnet"
SOURCE_CODE = None
COIN_TYPE = CoinType({
"INDEX": 144,
"HARDENED": True
})

SCRIPT_ADDRESS = 0x00
PUBLIC_KEY_ADDRESS = 0x00
SEGWIT_ADDRESS = SegwitAddress({
"HRP": None,
"VERSION": 0x00
})

EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({
"P2PKH": 0x488ade4,
"P2SH": 0x488ade4,
"P2WPKH": None,
"P2WPKH_IN_P2SH": None,
"P2WSH": None,
"P2WSH_IN_P2SH": None
})
EXTENDED_PUBLIC_KEY = ExtendedPublicKey({
"P2PKH": 0x488b21e,
"P2SH": 0x488b21e,
"P2WPKH": None,
"P2WPKH_IN_P2SH": None,
"P2WSH": None,
"P2WSH_IN_P2SH": None
})

MASSAGE_PREFIX = None
DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0"
WIF_SECRET_KEY = 0x80


class RubycoinMainnet(Cryptocurrency):

NAME = "Rubycoin"
Expand Down Expand Up @@ -6193,46 +6233,6 @@ class WincoinMainnet(Cryptocurrency):
WIF_SECRET_KEY = 0xc9


class RippleMainnet(Cryptocurrency):

NAME = "Ripple"
SYMBOL = "XRP"
NETWORK = "mainnet"
SOURCE_CODE = None
COIN_TYPE = CoinType({
"INDEX": 144,
"HARDENED": True
})

SCRIPT_ADDRESS = 0x00
PUBLIC_KEY_ADDRESS = 0x00
SEGWIT_ADDRESS = SegwitAddress({
"HRP": None,
"VERSION": 0x00
})

EXTENDED_PRIVATE_KEY = ExtendedPrivateKey({
"P2PKH": 0x488ade4,
"P2SH": 0x488ade4,
"P2WPKH": None,
"P2WPKH_IN_P2SH": None,
"P2WSH": None,
"P2WSH_IN_P2SH": None
})
EXTENDED_PUBLIC_KEY = ExtendedPublicKey({
"P2PKH": 0x488b21e,
"P2SH": 0x488b21e,
"P2WPKH": None,
"P2WPKH_IN_P2SH": None,
"P2WSH": None,
"P2WSH_IN_P2SH": None
})

MASSAGE_PREFIX = None
DEFAULT_PATH = f"m/44'/{str(COIN_TYPE)}/0'/0/0"
WIF_SECRET_KEY = 0x80


class XUEZMainnet(Cryptocurrency):

NAME = "XUEZ"
Expand Down
3 changes: 3 additions & 0 deletions hdwallet/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@
XUEZ = "XUEZ"
# XinFin
XDC = "XDC"
# Ripple
XRP = "XRP"
#Ycash
YEC = "YEC"
# ZClassic
Expand Down Expand Up @@ -425,6 +427,7 @@
"WC",
"XUEZ",
"XDC",
"XRP",
"YEC",
"ZCL",
"ZEC", "ZECTEST",
Expand Down
1 change: 1 addition & 0 deletions tests/test_symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def test_symbols():
assert WC == "WC"
assert XUEZ == "XUEZ"
assert XDC == "XDC"
assert XRP == "XRP"
assert YEC == "YEC"
assert ZCL == "ZCL"
assert ZEC == "ZEC"
Expand Down

0 comments on commit b5b4fc0

Please sign in to comment.