Daily Account limit and Coin-ID locking
The Kujua blockchain allows locking the account to a daily limit and locking coin ID's for a specified amount of time. Once locked the holder of the private key can only transact when the lock expires or renew the lock even before the expiration date. This means that if your private key and passphrase are both compromised, the thief still cannot steal more than the daily allowed limit or more than the portion that is network unlocked. If you choose to develop your app using coin-ID locking then be sure to keep track of which coins are locked and which ones are not and separate them in the balance. Read whitepaper for more details.
Example below shows how to limit your outgoing daily funds to a set amount for 90 days.
data points: daily_account_outgoing_balance, daily_account_limit, network_limit_unlock_date_id
from kujuaOnChain.Client import inputs, functions
fees = functions.calculate_fees(inputs.dummy.amount,
inputs.node.node_url,
inputs.dummy.recipient_address)
broadcast = functions.broadcast(inputs.wallet.wallet_address,
inputs.wallet.private_key_encrypted, # only use a dummy address's private key until we make kujuaOffChainRelay public
inputs.wallet.passphrase,
inputs.dummy.amount,
fees['content']['full_fee'],
inputs.node.node_url,
str(),
inputs.dummy.recipient_address,
str(),
90,
0,
str(),
str(),
(),
{},
True,
inputs.node.gt_node_url,
False)
print(broadcast)
Example below shows how to coin lock a portion of your funds away for 90 days.
data points: transaction_type_balance, network_coinid_unlock_date_id
from kujuaOnChain.Client import inputs, functions
fees = functions.calculate_fees(inputs.dummy.amount,
inputs.node.node_url,
inputs.dummy.recipient_address)
broadcast = functions.broadcast(inputs.wallet.wallet_address,
inputs.wallet.private_key_encrypted, # only use a dummy address's private key until we make kujuaOffChainRelay public
inputs.wallet.passphrase,
inputs.dummy.amount,
fees['content']['full_fee'],
inputs.node.node_url,
str(),
inputs.dummy.recipient_address,
str(),
0,
90,
str(),
str(),
(),
{},
True,
inputs.node.gt_node_url,
False)
print(broadcast)
We use the on chain method by importing kujuaOnChain. Meaning the functions run directly on the node and return results. Off chain will be available with the full Github release. You can find the code for kujuaOnChain on GitHub