You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
kripto 75df19e4ec Update '' 2 months ago Update '' 2 months ago
sentinel.rb sample concept 3 months ago
sentinel.sample.yml sample concept 3 months ago
zcash.rb sample concept 3 months ago

Zcash Sentinel Concept

(this name is gonna chance since we wanna avoid military terminologies and killing-machines names) <3

Sentinel is a microframework that observes the encrypted MEMO field received on zaddr transfers, listening for predefined actions to take.

It extends a Node into what we call a 'Smart Node', adapting existing applications into a message-oriented architecture using Zcash as a distributed privacy layer.

This Smart Node reads the encoded MEMO fields as JSON data of max 512 bytes, sent using zmsg-ish logic.

    # memo
    # sample: {action: "ping", to_zaddr: "$to_zaddr"}
    # sample: {action: "reply", to: "$txid", msg: "$msg"}
    # sample: {action: "email", body: "das ist deine passwort"}


    zaddr: z[...]
    viewing_key: zxview[...]
      run: --reply --id $txid --msg $message
      validate: $amount >= 0.01
      run: --like --id $txid
      run: $to_zaddr $amount
      run: echo $body | mail -s "it arrived!" ""


# hex2ascii
def decode_memo(hex_msg)  
  hex_msg.scan(/\\x(..)/).map{|a| a.first.to_i(16).chr}.join.to_json

nodes = YAML.load("sentinel.sample.yml"))
board = nodes['BoardNode']

Zcash.z_importviewingkey board['viewing_key']
loop true
  transfers = Zcash.z_listreceivedbyaddress(board['zaddr'])
  # todo: just act for new transfers, caching last execution datetime.
  transfers.each |transfer|
    memo = decode_memo transfer["memo"]
    if memo.key?(:action) && action = memo[:action]
      # execute related action
      cmd = board["actions"][action]["run"]
      puts "Executing: #{cmd}"
  sleep 30

And now it is easier to create a ZEC-based twitter bot with real anonimity, for example :O

Recently discussion points out that this projects is gonna follow as Zincretic;

"Syncretism /ˈsɪŋkrətɪzəm/ is the combining of different beliefs, while blending practices of various 
schools of thought. Syncretism involves the merging or assimilation of several originally discrete 
traditions, especially in the theology and mythology of religion, thus asserting an underlying unity and 
allowing for an inclusive approach to other faiths."