-
public interface Derivation
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classDerivation.Companion
-
Method Summary
Modifier and Type Method Description abstract StringderiveUnifiedAddress(String viewingKey, Integer networkId)abstract StringderiveUnifiedAddress(ByteArray seed, Integer networkId, Long accountIndex)abstract ByteArrayderiveUnifiedSpendingKey(ByteArray seed, Integer networkId, Long accountIndex)abstract StringderiveUnifiedFullViewingKey(JniUnifiedSpendingKey usk, Integer networkId)abstract Array<String>deriveUnifiedFullViewingKeys(ByteArray seed, Integer networkId, Integer numberOfAccounts)abstract JniMetadataKeyderiveAccountMetadataKey(ByteArray seed, Integer networkId, Long accountIndex)Derives a ZIP 325 Account Metadata Key from the given seed. abstract Array<ByteArray>derivePrivateUseMetadataKey(JniMetadataKey accountMetadataKey, String ufvk, Integer networkId, ByteArray privateUseSubject)Derives a metadata key for private use from a ZIP 325 Account Metadata Key. abstract ByteArrayderiveArbitraryWalletKey(ByteArray contextString, ByteArray seed)Derives a ZIP 32 Arbitrary Key from the given seed at the "wallet level", i.e. abstract ByteArrayderiveArbitraryAccountKey(ByteArray contextString, ByteArray seed, Integer networkId, Long accountIndex)Derives a ZIP 32 Arbitrary Key from the given seed at the account level. -
-
Method Detail
-
deriveUnifiedAddress
abstract String deriveUnifiedAddress(String viewingKey, Integer networkId)
-
deriveUnifiedAddress
abstract String deriveUnifiedAddress(ByteArray seed, Integer networkId, Long accountIndex)
-
deriveUnifiedSpendingKey
abstract ByteArray deriveUnifiedSpendingKey(ByteArray seed, Integer networkId, Long accountIndex)
-
deriveUnifiedFullViewingKey
abstract String deriveUnifiedFullViewingKey(JniUnifiedSpendingKey usk, Integer networkId)
-
deriveUnifiedFullViewingKeys
abstract Array<String> deriveUnifiedFullViewingKeys(ByteArray seed, Integer networkId, Integer numberOfAccounts)
- Parameters:
numberOfAccounts- Use DEFAULT_NUMBER_OF_ACCOUNTS to derive a single key.
-
deriveAccountMetadataKey
abstract JniMetadataKey deriveAccountMetadataKey(ByteArray seed, Integer networkId, Long accountIndex)
Derives a ZIP 325 Account Metadata Key from the given seed.
-
derivePrivateUseMetadataKey
abstract Array<ByteArray> derivePrivateUseMetadataKey(JniMetadataKey accountMetadataKey, String ufvk, Integer networkId, ByteArray privateUseSubject)
Derives a metadata key for private use from a ZIP 325 Account Metadata Key.
If
ufvkis non-null, this method will return one metadata key for every FVK item contained within the UFVK, in preference order. As UFVKs may in general change over time (due to the inclusion of new higher-preference FVK items, or removal of older deprecated FVK items), private usage of these keys should always follow preference order:For encryption-like private usage, the first key in the array should always be used, and all other keys ignored.
For decryption-like private usage, each key in the array should be tried in turn until metadata can be recovered, and then the metadata should be re-encrypted under the first key.
- Parameters:
ufvk- the external UFVK for which a metadata key is required, ornullif the metadata key is "inherent" (for the same account as the Account Metadata Key).privateUseSubject- a globally unique non-empty sequence of at most 252 bytes that identifies the desired private-use context.
-
deriveArbitraryWalletKey
abstract ByteArray deriveArbitraryWalletKey(ByteArray contextString, ByteArray seed)
Derives a ZIP 32 Arbitrary Key from the given seed at the "wallet level", i.e. directly from the seed with no ZIP 32 path applied.
The resulting key will be the same across all networks (Zcash mainnet, Zcash testnet, OtherCoin mainnet, and so on). You can think of it as a context-specific seed fingerprint that can be used as (static) key material.
- Parameters:
contextString- a globally-unique non-empty sequence of at most 252 bytes that identifies the desired context.
-
deriveArbitraryAccountKey
abstract ByteArray deriveArbitraryAccountKey(ByteArray contextString, ByteArray seed, Integer networkId, Long accountIndex)
Derives a ZIP 32 Arbitrary Key from the given seed at the account level.
- Parameters:
contextString- a globally-unique non-empty sequence of at most 252 bytes that identifies the desired context.
-
-
-
-