Address data structure formats multiple cryptographic public key types.
Address public key types start out as uncompressed ECDSA secp256k1_ 64 byte binary arrays.
Address is generated by hashing the raw bytes of the public key and appending a 4 byte checksum.
The checksum comes from the hash of the first 4 bytes of the
The result is
You can generate test addresses with the the
etch, you can instantiate an
Address like this:
function main() var account = Address("2ifr5dSFRAnXexBMC3HYEVp3JHSuz7KBPXWDRBV4xdFrqGy6R9"); endfunction
etch currently supports the SHA256 encryption algorithm. Find out more here.
Address type has a function
signedTx() which allows you to verify the signature. It returns a boolean. This is only valid in an
@action function, else it will return false.
function main() var account = Address("2ifr5dSFRAnXexBMC3HYEVp3JHSuz7KBPXWDRBV4xdFrqGy6R9"); var verified : Bool; verified = account.signedTx(); printLn(toString(verified)); endfunction
The above code always prints
false when it is not contained within an
Address type will eventually support all asymmetric cryptographic types and, more importantly, will be quantum computing ready.
toString() to print
function main() var account = Address("2ifr5dSFRAnXexBMC3HYEVp3JHSuz7KBPXWDRBV4xdFrqGy6R9"); printLn(toString(account)); endfunction