Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zk-address spec #38

Open
ggs134 opened this issue Aug 21, 2019 · 0 comments
Open

zk-address spec #38

ggs134 opened this issue Aug 21, 2019 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@ggs134
Copy link
Member

ggs134 commented Aug 21, 2019

abstract

A zk-address is an identifier of 42 or 64 characters long that represents a possible destination for a zk-note asset payment.

derivation

  • zk Address(zk external account address) = "zk"+sha256(hex(pubkey.x) + hex(pubkey.y))[12:]
  • Note Address(Note Hash) = sha256( circuit-input-format + value + type + viewKey + salt)

+ means appending string
ex) "1abd" + "bda" = "1abdbda"

other format

  • pubkey(point x, y) : {x : field value, y: field value}
  • pubkey hexstring : hex(x) + hex(y)
  • digested pubkey : sha256(pubkey hexstring)
  • zk address : sha256(digested pubkey)[12:](20 byte)
  • base58 encoded zk address : base58encode(zk address)

public key cryptography algorithm (sk -> pk)

examples

  • sk(Integer) : "137215550892293264522532280805192033568"
  • pubkey(point x, y) :
{
  x : "3221685307190689865347586017200458153912689357176235248982582720407412477386", 
  y : "5146970447429328755369555831351493575582722874440366554208606834938898586669"
}
  • pubkey hexstring :
"71f68c591f2badb615a1e28bcc8e8afc04cad56989be57b4e0ec30ad6c90dcab61150068fd22e9fd7934e1aecc490c53c945a116967ae411d42d929fd89c2d"
  • zk address : "70f1d6ef6a6db055aa4aaad57f0a46e692c58935"
  • base58encoded zk address : "2aGHYonwumtLAG7SNKjharksCP3r"
  • zk address format : "zk2aGHYonwumtLAG7SNKjharksCP3r"

library

zkdex-utils : https://github.com/Onther-Tech/zkdex-utils

@ggs134 ggs134 added enhancement New feature or request documentation Improvements or additions to documentation labels Aug 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant