Skip to content

Manuals

eloylp edited this page Jun 8, 2023 · 10 revisions

Python

Ruby

Kotlin

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)
```

Swift

Clone this wiki locally