Skip to content

Commit

Permalink
Close #132 Add support for Celestia
Browse files Browse the repository at this point in the history
  • Loading branch information
ebellocchia committed Jun 5, 2024
1 parent de04cde commit cd44936
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Supported BIP coins:
- Bitcoin Cash Simple Ledger Protocol (and related test net)
- BitcoinSV (and related test net)
- Cardano (Byron-Legacy, Byron-Icarus and Shelley)
- Celestia
- Celo
- Certik
- Cosmos
Expand Down
1 change: 1 addition & 0 deletions bip_utils/bip/conf/bip44/bip44_coins.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ class Bip44Coins(BipCoins):
BITCOIN_SV = auto()
CARDANO_BYRON_ICARUS = auto()
CARDANO_BYRON_LEDGER = auto()
CELESTIA = auto()
CELO = auto()
CERTIK = auto()
CHIHUAHUA = auto()
Expand Down
15 changes: 15 additions & 0 deletions bip_utils/bip/conf/bip44/bip44_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,21 @@ class Bip44Conf:
},
)

# Configuration for Celestia
Celestia: BipCoinConf = BipCoinConf(
coin_names=CoinsConf.Celestia.CoinNames(),
coin_idx=Slip44.ATOM,
is_testnet=False,
def_path=DER_PATH_NON_HARDENED_FULL,
key_net_ver=_BIP44_BTC_KEY_NET_VER_MAIN,
wif_net_ver=None,
bip32_cls=Bip32Slip10Secp256k1,
addr_cls=AtomAddrEncoder,
addr_params={
"hrp": CoinsConf.Celestia.ParamByKey("addr_hrp"),
},
)

# Configuration for Celo
Celo: BipCoinConf = BipCoinConf(
coin_names=CoinsConf.Celo.CoinNames(),
Expand Down
1 change: 1 addition & 0 deletions bip_utils/bip/conf/bip44/bip44_conf_getter.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class Bip44ConfGetterConst:
Bip44Coins.BITCOIN_SV_TESTNET: Bip44Conf.BitcoinSvTestNet,
Bip44Coins.CARDANO_BYRON_ICARUS: Bip44Conf.CardanoByronIcarus,
Bip44Coins.CARDANO_BYRON_LEDGER: Bip44Conf.CardanoByronLedger,
Bip44Coins.CELESTIA: Bip44Conf.Celestia,
Bip44Coins.CELO: Bip44Conf.Celo,
Bip44Coins.CERTIK: Bip44Conf.Certik,
Bip44Coins.CHIHUAHUA: Bip44Conf.Chihuahua,
Expand Down
8 changes: 8 additions & 0 deletions bip_utils/coin_conf/coins_conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,14 @@ class CoinsConf:
},
)

# Configuration for Celestia
Celestia: CoinConf = CoinConf(
coin_name=CoinNames("Celestia", "TIA"),
params={
"addr_hrp": Slip173.CELESTIA,
},
)

# Configuration for Celo
Celo: CoinConf = CoinConf(
coin_name=CoinNames("Celo", "CELO"),
Expand Down
1 change: 1 addition & 0 deletions bip_utils/slip/slip173/slip173.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ class Slip173:
BITCOIN_TESTNET: str = "tb"
CERTIK: str = "certik"
CHIHUAHUA: str = "chihuahua"
CELESTIA: str = "celestia"
COSMOS: str = "cosmos"
ELROND: str = "erd"
FETCH_AI: str = "fetch"
Expand Down
1 change: 1 addition & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ bnb
cardano
cardano-byron
cardano-shelley
celestia
celo
certik
cosmos
Expand Down
1 change: 1 addition & 0 deletions readme/bip44.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ Supported coins enumerative for BIP-0044:
|BitcoinSV|`Bip44Coins.BITCOIN_SV`|`Bip44Coins.BITCOIN_SV_TESTNET`|
|Cardano Byron (Icarus)|`Bip44Coins.CARDANO_BYRON_ICARUS`, see [Cardano](https://github.com/ebellocchia/bip_utils/tree/master/readme/cardano.md)|-|
|Cardano Byron (Ledger)|`Bip44Coins.CARDANO_BYRON_LEDGER`, see [Cardano](https://github.com/ebellocchia/bip_utils/tree/master/readme/cardano.md)|-|
|Celestia|`Bip44Coins.CELESTIA`|-|
|Celo|`Bip44Coins.CELO`|-|
|Certik|`Bip44Coins.CERTIK`|-|
|Chihuahua|`Bip44Coins.CHIHUAHUA`|-|
Expand Down
30 changes: 30 additions & 0 deletions tests/bip/bip44/test_bip44.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,30 @@
"Ae2tdPwUPEYyH3w9G87544iteBxm7iqjMdkEav9K3t5G8GkZJga9nrYL2HX",
],
},
# Celestia
{
"coin": Bip44Coins.CELESTIA,
"names": ("Celestia", "TIA"),
"is_testnet": False,
"seed": b"5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4",
"ex_master": "xprv9s21ZrQH143K3GJpoapnV8SFfukcVBSfeCficPSGfubmSFDxo1kuHnLisriDvSnRRuL2Qrg5ggqHKNVpxR86QEC8w35uxmGoggxtQTPvfUu",
"wif_master": "",
"account": {
"ex_pub": "xpub6DGzViq8bmgMLYdVZ3xnLVEdKwzBnGdzzJZ4suG8kVb9TTLAbrwv8YdKBb8FWKdBNinaHKmBv7JpQvqBYx4rxch7WnHzNFzSVrMf8hQepTP",
"ex_priv": "xprv9zHe6DJEmQ8484Z2T2RmyMHtmv9hNov9d5dU5WrXCA4Aaf124KdfakJqLGnVYwvBvMP4ttqm7QL5vuPTepiJiEJREiJnhswKmj6zLttwCMu",
},
"chain_ext": {
"ex_pub": "xpub6EbeQ8h8S7mEGxYTn34gKedwvsmytMW61v51RAc8e6VzgMMLFkkNMN6sYtqvtZQ8TjBKswbxUTzxzj3nZfwr4pzFB7rySMaBUUCJnCuxu33",
"ex_priv": "xprvA1cHzdAEbkCw4UTzg1XfxWhDNqwVUtnEeh9QcnCX5ky1oZ2BiDS7oZnPhdgFNqWwGtB3BNebior1tS26wAtbQzCTe5Pty1BhkcwT8QfWQSP",
},
"addresses": [
"celestia19rl4cm2hmr8afy4kldpxz3fka4jguq0ad2ud9c",
"celestia1jrkmdcwgq94uaamx6zax2luewlhf7u4kdjhpv0",
"celestia1kng7tv83qesgvv2ze7hxlw4urfrjk8vq3esshx",
"celestia1zuvk68xw4y9swp06796rx8zarjvvkrt67szk3j",
"celestia12ecyuddg4wlnhztusgju5zxxjgznkz7fpr9wvd",
],
},
# Celo
{
"coin": Bip44Coins.CELO,
Expand Down Expand Up @@ -2345,6 +2369,12 @@
"seed": b"5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4",
"default_address": "Ae2tdPwUPEZF4a8fNdkUt8HSyyWgsq2DqP2AKGFKiF3SLsXNDuu6wYp15Dp",
},
# Celestia
{
"coin": Bip44Coins.CELESTIA,
"seed": b"5eb00bbddcf069084889a8ab9155568165f5c453ccb85e70811aaed6f6da5fc19a5ac40b389cd370d086206dec8aa6c43daea6690f20ad3d8d48b2d2ce9e38e4",
"default_address": "celestia19rl4cm2hmr8afy4kldpxz3fka4jguq0ad2ud9c",
},
# Celo
{
"coin": Bip44Coins.CELO,
Expand Down

0 comments on commit cd44936

Please sign in to comment.