Function compilerOperationHelperDeriveHdPrivateNode

  • Parameters

    • __namedParameters: {
          addressIndex: number;
          configuration: {
              ripemd160: {
                  hash: ((input: Uint8Array) => Uint8Array);
              };
              secp256k1: {
                  addTweakPrivateKey: ((privateKey: Uint8Array, tweakValue: Uint8Array) => string | Uint8Array);
                  addTweakPublicKeyCompressed: ((publicKey: Uint8Array, tweakValue: Uint8Array) => string | Uint8Array);
                  derivePublicKeyCompressed: ((privateKey: Uint8Array) => string | Uint8Array);
                  signMessageHashDER: ((privateKey: Uint8Array, messageHash: Uint8Array) => string | Uint8Array);
                  signMessageHashSchnorr: ((privateKey: Uint8Array, messageHash: Uint8Array) => string | Uint8Array);
              };
              sha256: {
                  hash: ((input: Uint8Array) => Uint8Array);
              };
              sha512: {
                  hash: ((input: Uint8Array) => Uint8Array);
              };
          };
          entityHdPrivateKey: string;
          entityId: string;
          hdKey: AuthenticationTemplateHdKey;
          identifier: string;
      }
      • addressIndex: number
      • configuration: {
            ripemd160: {
                hash: ((input: Uint8Array) => Uint8Array);
            };
            secp256k1: {
                addTweakPrivateKey: ((privateKey: Uint8Array, tweakValue: Uint8Array) => string | Uint8Array);
                addTweakPublicKeyCompressed: ((publicKey: Uint8Array, tweakValue: Uint8Array) => string | Uint8Array);
                derivePublicKeyCompressed: ((privateKey: Uint8Array) => string | Uint8Array);
                signMessageHashDER: ((privateKey: Uint8Array, messageHash: Uint8Array) => string | Uint8Array);
                signMessageHashSchnorr: ((privateKey: Uint8Array, messageHash: Uint8Array) => string | Uint8Array);
            };
            sha256: {
                hash: ((input: Uint8Array) => Uint8Array);
            };
            sha512: {
                hash: ((input: Uint8Array) => Uint8Array);
            };
        }
        • ripemd160: {
              hash: ((input: Uint8Array) => Uint8Array);
          }
          • hash: ((input: Uint8Array) => Uint8Array)
              • (input: Uint8Array): Uint8Array
              • Returns the ripemd160 hash of the provided input.

                To incrementally construct a ripemd160 hash (e.g. for streaming), use init, update, and final.

                Parameters

                • input: Uint8Array

                  a Uint8Array to be hashed using ripemd160

                Returns Uint8Array

        • secp256k1: {
              addTweakPrivateKey: ((privateKey: Uint8Array, tweakValue: Uint8Array) => string | Uint8Array);
              addTweakPublicKeyCompressed: ((publicKey: Uint8Array, tweakValue: Uint8Array) => string | Uint8Array);
              derivePublicKeyCompressed: ((privateKey: Uint8Array) => string | Uint8Array);
              signMessageHashDER: ((privateKey: Uint8Array, messageHash: Uint8Array) => string | Uint8Array);
              signMessageHashSchnorr: ((privateKey: Uint8Array, messageHash: Uint8Array) => string | Uint8Array);
          }
          • addTweakPrivateKey: ((privateKey: Uint8Array, tweakValue: Uint8Array) => string | Uint8Array)
              • (privateKey: Uint8Array, tweakValue: Uint8Array): string | Uint8Array
              • Tweak a privateKey by adding tweakValue to it.

                Returns an error message if the private key is invalid or if the addition fails.

                Parameters

                • privateKey: Uint8Array

                  a valid secp256k1 private key

                • tweakValue: Uint8Array

                  256 bit value to tweak by (BE)

                Returns string | Uint8Array

          • addTweakPublicKeyCompressed: ((publicKey: Uint8Array, tweakValue: Uint8Array) => string | Uint8Array)
              • (publicKey: Uint8Array, tweakValue: Uint8Array): string | Uint8Array
              • Tweak a publicKey by adding tweakValue times the generator to it.

                Returns an error message if the provided public key could not be parsed or is not valid, or if the addition failed.

                The returned public key will be in compressed format.

                Parameters

                • publicKey: Uint8Array

                  a public key.

                • tweakValue: Uint8Array

                  256 bit value to tweak by (BE)

                Returns string | Uint8Array

          • derivePublicKeyCompressed: ((privateKey: Uint8Array) => string | Uint8Array)
              • (privateKey: Uint8Array): string | Uint8Array
              • Derive a compressed public key from a valid secp256k1 private key.

                Returns an error message if the provided private key is too large (see validatePrivateKey).

                Parameters

                • privateKey: Uint8Array

                  a valid secp256k1, 32-byte private key

                Returns string | Uint8Array

          • signMessageHashDER: ((privateKey: Uint8Array, messageHash: Uint8Array) => string | Uint8Array)
              • (privateKey: Uint8Array, messageHash: Uint8Array): string | Uint8Array
              • Create an ECDSA signature in DER format. The created signature is always in lower-S form and follows RFC 6979.

                Returns an error message if the provided private key is too large (see validatePrivateKey).

                Parameters

                • privateKey: Uint8Array

                  a valid secp256k1, 32-byte private key

                • messageHash: Uint8Array

                  the 32-byte message hash to be signed

                Returns string | Uint8Array

          • signMessageHashSchnorr: ((privateKey: Uint8Array, messageHash: Uint8Array) => string | Uint8Array)
              • (privateKey: Uint8Array, messageHash: Uint8Array): string | Uint8Array
              • Create a Secp256k1 EC-Schnorr-SHA256 signature (Bitcoin Cash construction).

                Signatures are 64-bytes, non-malleable, and support both batch validation and multiparty signing. Nonces are generated using RFC6979, where the Section 3.6, 16-byte ASCII "additional data" is set to Schnorr+SHA256 . This avoids leaking a private key by inadvertently creating both an ECDSA signature and a Schnorr signature using the same nonce.

                Returns an error message if the provided private key is too large (see validatePrivateKey).

                Parameters

                • privateKey: Uint8Array

                  a valid secp256k1, 32-byte private key

                • messageHash: Uint8Array

                  the 32-byte message hash to be signed

                Returns string | Uint8Array

        • sha256: {
              hash: ((input: Uint8Array) => Uint8Array);
          }
          • hash: ((input: Uint8Array) => Uint8Array)
              • (input: Uint8Array): Uint8Array
              • Returns the sha256 hash of the provided input.

                To incrementally construct a sha256 hash (e.g. for streaming), use init, update, and final.

                Parameters

                • input: Uint8Array

                  a Uint8Array to be hashed using sha256

                Returns Uint8Array

        • sha512: {
              hash: ((input: Uint8Array) => Uint8Array);
          }
          • hash: ((input: Uint8Array) => Uint8Array)
              • (input: Uint8Array): Uint8Array
              • Returns the sha512 hash of the provided input.

                To incrementally construct a sha512 hash (e.g. for streaming), use init, update, and final.

                Parameters

                • input: Uint8Array

                  a Uint8Array to be hashed using sha512

                Returns Uint8Array

      • entityHdPrivateKey: string
      • entityId: string
      • hdKey: AuthenticationTemplateHdKey
      • identifier: string

    Returns CompilerOperationError | CompilerOperationSuccess

Generated using TypeDoc