RE: RE: Hive checks all the boxes
You are viewing a single comment's thread from:

RE: Hive checks all the boxes

Words
525
Reading
3 min
Listen
Play
4d

Oh, a lot of script usefulness comes with custom authorities, but it is not necessarily directly connected to various signature schemes - Hive state is vastly wider than UTxO set. I see three types of scripts:

  • type 1, the cheapest, executed in parallel in precompute phase - it only refers to content of transaction
  • type 2, more expensive, executed during authorization or evaluation - can refer to various elements of state
  • type 3, most expensive, like type 2, but can also form and trigger execution of additional operations

Scripts are limited mini smart contracts. They could be called directly in new test_operation, triggered by use of specific custom authority or tied to extensions in operation evaluators.

Examples of first type:

  • custom_json schema check
  • open authority that allows anyone to use RC of certain account as long as that account receives small fee in the same transaction and the transaction only contains operations of approved types
  • authorize to do other things for a fee, f.e. account creation (that way a free floating balance could be used to create an account - we could even tie such custom authority to some of the built-in accounts)

Example of second type:

  • payment order - transaction is authorized when executed within specific time window and contains single execution recurrent transfer (these are not allowed at the moment, but start to make sense after certain changes are made first) with specific pair_id and to/from for amount below authorized threshold (while all looks like it should be treated as first type, time window requirement ties it to state); with that you can subscribe to some service, and that service can modify the amount slightly based on the market conditions and execute transfer themselves (just like when I subscribed to Claude, they charge me in EURO every month without my involvement, but I pay in PLN), but you retain the ability to dispute the charge (by cancelling pending transfer) and you can cancel future payments by removing the authority
  • dead man's trigger - give owner authority to some other account when your governance vote expires
  • custom check on posts to specific community - enables permissioned communities, including private ones, that would require the check (Hivemind would not put post into community of that type if there was no check extension on the post)
  • failsafe for custom authority for claiming account tokens with RC - only execute if the final RC price is below set threshold

Exemple of third type:

  • automatic HIVE-HBD market swap - someone transfers you tokens pointing to your specific custom authority and that transaction executes transfer in opposite direction, forms it from incoming amount (after subtracting fee) and feed price (yes, it could be done with second type transaction, but it would be bigger and script would be more complicated)
  • conditional automatic reward claim or account creation token purchase with RC when you execute any transaction signed with custom authority with such embedded trigger - the script would check amount of rewards to claim or how much unused RC you have and execute extra operation based on that