Skip to content

Commit

Permalink
Merge pull request #116 from Chia-Network/develop
Browse files Browse the repository at this point in the history
release: 1.0.30 - fix derivation paths
  • Loading branch information
MichaelTaylor3D authored Oct 11, 2023
2 parents 1a7b8e7 + db8067b commit b9ca2b7
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion app/core/climate_wallet/wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ async def create(
mode_to_secret_key: Dict[GatewayMode, PrivateKey] = {}
mode_to_message_and_signature: Dict[GatewayMode, Tuple[bytes, G2Element]] = {}
for mode in GatewayMode:
secret_key: PrivateKey = root_sk_to_gateway_sk(root_secret_key, mode=mode)
secret_key: PrivateKey = root_sk_to_gateway_sk(root_secret_key)
public_key: G1Element = secret_key.get_g1()

gateway_puzzle: Program = create_gateway_puzzle()
Expand Down
9 changes: 3 additions & 6 deletions app/core/derive_keys.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
from blspy import PrivateKey
from chia.wallet.derive_keys import _derive_path_unhardened

from app.core.types import CLIMATE_WALLET_INDEX, GatewayMode


def master_sk_to_root_sk(master: PrivateKey) -> PrivateKey:
return _derive_path_unhardened(master, [12381, 8444, CLIMATE_WALLET_INDEX])
return _derive_path_unhardened(master, [12381, 8444, 2050])


def root_sk_to_gateway_sk(root: PrivateKey, mode: GatewayMode) -> PrivateKey:
return _derive_path_unhardened(root, [mode.to_int()])
def root_sk_to_gateway_sk(root: PrivateKey) -> PrivateKey:
return _derive_path_unhardened(root, [0])
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "Chia Climate Token Driver"
version = "1.0.29"
version = "1.0.30"
description = "https://github.com/Chia-Network/climate-token-driver"
authors = ["Harry Hsu <[email protected]>",
"Chia Network Inc <[email protected]>"]
Expand Down

0 comments on commit b9ca2b7

Please sign in to comment.