SecretNET.Token Namespace

Snip20Tx..::..CreateViewingKey Method (String, String, Nullable<(Of <(<'String>)>)>, Nullable<(Of <(<'String>)>)>, Nullable<(Of <(<'TxOptions>)>)>)

This function generates a new viewing key for the Cosmos message sender, which is used in ALL account specific queries. This key is used to validate the identity of the caller, since in queries in Cosmos there is no way to cryptographically authenticate the querier's identity. The Viewing Key MUST be stored in such a way that lookup takes a significant amount to time to perform, in order to be resistant to brute-force attacks. The viewing key MUST NOT control any functions which actively affect the balance of the user. The entropy field of the request should be a client supplied string used for entropy for generation of the viewing key.Secure implementation is left to the client, but it is recommended to use base-64 encoded random bytes and not predictable inputs.

Namespace:  SecretNET.Token
Assembly:  SecretNET.Token (in SecretNET.Token.dll)

Syntax


public Task<SingleSecretTx<CreateViewingKeyResponse>> CreateViewingKey(
	string contractAddress,
	string entropy,
	Nullable<string> padding,
	Nullable<string> codeHash,
	Nullable<TxOptions> txOptions
)
Public Function CreateViewingKey ( _
	contractAddress As String, _
	entropy As String, _
	padding As Nullable(Of String), _
	codeHash As Nullable(Of String), _
	txOptions As Nullable(Of TxOptions) _
) As Task(Of SingleSecretTx(Of CreateViewingKeyResponse))
public:
Task<SingleSecretTx<CreateViewingKeyResponse^>^>^ CreateViewingKey(
	String^ contractAddress, 
	String^ entropy, 
	Nullable<String^> padding, 
	Nullable<String^> codeHash, 
	Nullable<TxOptions^> txOptions
)

Parameters

contractAddress
Type: String
The contract address.
entropy
Type: String
String used as part of the entropy supplied to the rng that generates the random viewing key.
padding
Type: Nullable<(Of <(<'String>)>)>
An ignored string that can be used to maintain constant message length.
codeHash
Type: Nullable<(Of <(<'String>)>)>
CodeHash is (not really) optional and makes a call way faster.
txOptions
Type: Nullable<(Of <(<'TxOptions>)>)>
The tx options.

Return Value

SingleSecretTx<CreateViewingKeyResponse>.