Initializer
init(dataRepresentation:keyParity:cache:)
Creates an x-only public key from a 32-byte X-coordinate, parity bit, and optional pre-computed full-pubkey cache.
- iOS 13.0+
- macCatalyst 13.0+
- macOS 10.15+
- tvOS 13.0+
- visionOS 1.0+
- watchOS 6.0+
init<D>(dataRepresentation data: D, keyParity: Int32 = 0, cache: [UInt8] = []) where D : ContiguousBytes
Parameters
-
data
-
The 32-byte X coordinate of the x-only public key.
-
keyParity
-
The Y-coordinate parity as an Int32: 0 = even, 1 = odd.
-
cache
-
Optional pre-computed secp256k1_pubkey bytes associated with the x-only key; pass an empty array to have the backing implementation recompute the full pubkey on demand.
Discussion
Useful when reconstructing from persisted state (e.g. a Taproot output-key identifier and its parity stored in a wallet database).