-
Notifications
You must be signed in to change notification settings - Fork 4
Manuals
eloylp edited this page Jun 8, 2023
·
10 revisions
Kotlin code
```kotlin
val proofAuthorizingKey = expandedSpendingKey.proofGenerationKey()
val fullViewingKey = extSpendingKey.toDiversifiableFullViewingKey()
// requires a scope, INTERNAL or EXTERNAL
val incomingViewingKey = fullViewingKey.toIvk(ZcashScope.INTERNAL)
// requires a diversifier
val diversifierBytes = (...)
val diversifier = ZcashDiversifier(diversifierBytes)
// this is the address struct
val shieldedAddress = incomingViewingKey.toPaymentAddress(diversifier)
// to derive the string form, we need the network params: MAIN_NETWORK or TEST_NETWORK
val params = ZcashConsensusParameters.MAIN_NETWORK
val shieldedAddressStringified = shieldedAddress.encode(params)
```