@@ -398,6 +398,38 @@ def new_public_key_point(public_key: IPublicKey, zl: bytes, ecc: IEllipticCurveC
398
398
)
399
399
return self
400
400
401
+ def root_xprivate_key (
402
+ self , version : Union [bytes , int ] = Cardano .NETWORKS .MAINNET .XPRIVATE_KEY_VERSIONS .P2PKH , encoded : bool = True
403
+ ) -> Optional [str ]:
404
+ """
405
+ Generates the root extended private key (xprv) in serialized format.
406
+
407
+ :param version: The version bytes for the extended key. Defaults to Bitcoin mainnet P2PKH version.
408
+ :type version: Union[bytes, int]
409
+ :param encoded: Whether to return the key in encoded format. Defaults to True.
410
+ :type encoded: bool
411
+
412
+ :return: The root extended private key (xprv) in serialized format, or None if the chain code is not set.
413
+ :rtype: Optional[str]
414
+ """
415
+ return super (CardanoHD , self ).root_xprivate_key (version = version , encoded = encoded )
416
+
417
+ def xprivate_key (
418
+ self , version : Union [bytes , int ] = Cardano .NETWORKS .MAINNET .XPRIVATE_KEY_VERSIONS .P2PKH , encoded : bool = True
419
+ ) -> Optional [str ]:
420
+ """
421
+ Retrieves the extended private key (xprivate key) as a serialized string.
422
+
423
+ :param version: The version bytes or integer version of the xprivate key.
424
+ :type version: Union[bytes, int]
425
+ :param encoded: Flag indicating whether the key should be encoded.
426
+ :type encoded: bool
427
+
428
+ :return: The serialized xprivate key as a string, or None if the private key or chain code is not set.
429
+ :rtype: Optional[str]
430
+ """
431
+ return super (CardanoHD , self ).xprivate_key (version = version , encoded = encoded )
432
+
401
433
def path_key (self ) -> Optional [str ]:
402
434
"""
403
435
Derives a path key based on the current CardanoHD instance.
0 commit comments