createSharedSecret method

void createSharedSecret(
  1. Uint8List remotePubKey
)

Created a shared secret between Phantom Wallet and our DApp using our _dAppSecretKey and phantom_encryption_public_key.

  • phantom_encryption_public_key is the public key of Phantom Wallet.

Implementation

void createSharedSecret(Uint8List remotePubKey) async {
  _sharedSecret = Box(
    myPrivateKey: _dAppSecretKey,
    theirPublicKey: PublicKey(remotePubKey),
  );
}