Hot answers tagged

9 votes
Accepted

How to derive the tezos public key from the points on the curve (SECP256K1 or P-256)

Public keys in Tezos are stored in compressed form: <1 byte prefix>|X Prefix is b'\x02' if Y is even, b'\x03' otherwise, now you have a compressed key of 33 bytes long; Add tezos prefix b'\x03\...
Michael Zaikin's user avatar
6 votes
Accepted

Genesis Balances

1) Here they are $ ./tezos-client rpc get /chains/main/blocks/1/context/contracts | grep KT1 "KT1WPEis2WhAc2FciM2tZVn8qe6pCBe9HkDp", "KT1W148mcjmfvr9J2RvWcGHxsAFApq9mcfgT", "...
Arthur B's user avatar
  • 4,599
6 votes
Accepted

Address prefixes

Look at this file https://gitlab.com/tezos/tezos/blob/master/src/lib_crypto/base58.ml The relevant section is the Prefix module at the end module Prefix = struct (* 32 *) let block_hash = "\001\...
Arthur B's user avatar
  • 4,599
5 votes

Any way to get the public key of an address?

In the contract, you cannot obtain the public key from an address but if you are given both the public key and the address you can check that the public key corresponds to the address. In Michelson, ...
Raphaël Cauderlier's user avatar
5 votes
Accepted

Any way to get the public key of an address?

It is not possible to do from inside a contract. But you can use the following RPC: https://tezos.gitlab.io/alpha/rpc.html#get-block-id-context-contracts-contract-id-manager-key Example: https://...
Rodrigo Quelhas's user avatar
5 votes
Accepted

Can I use BIP32 HD key pairs to derive ed25519 addresses

You can not derive Ed25519 keys in a way that is compatible with bip32 or bip44. Bip32 only defines a derivation scheme for secp256k1, and bip44 depends on bip32. To get around this problem there's a ...
Klassare's user avatar
  • 1,345
5 votes

What are the differences between key, key_hash, address, contract and signature in Michelson?

Why can I convert between address and contract. But not between address and key_hash? There is the (IMPLICIT_ACCOUNT) instruction to go from key_hash to address. For the other direction, there was (a ...
Raphaël Cauderlier's user avatar
5 votes
Accepted

What are the differences between key, key_hash, address, contract and signature in Michelson?

key_hash is blake2b hash of a public key, in the base58 encoded form it can start only with tz, but address is more general, it can also hold KT accounts; There are no instructions for that, probably ...
Michael Zaikin's user avatar
5 votes

Creating public key hash

Try https://github.com/murbard/pytezos/blob/master/pytezos/crypto.py from pytezos.crypto import Key key = Key(key='mnemonic', passphrase='******', email='[email protected]') key.public_key_hash() >>&...
Michael Zaikin's user avatar
4 votes

Contract's address format specification

When your originate a contract, you send an "operation" to the network. This operation is then serialized into byte format and a hash is derived - this is the operation hash for the given operation. ...
Stephen Andrews's user avatar
4 votes
Accepted

How can I manually generate a tz3 wallet address?

With tezos-client? tezos-client gen keys tzthree --sig p256 (then tezos-client show address tzthree -S)
Seb Mondet's user avatar
4 votes

What are the recommended regular expressions for tezos wallet and contract addresses?

Transaction rollups coming with the Jakarta protocol will introduce new addresses with prefixes (txr1, tz4, and txi). And the K protocol will also introduce a new ones scr1, etc. You can find all the ...
Rodrigo Quelhas's user avatar
3 votes

Which hash function is used when converting an address from raw bytes?

It’s not hashed. You simply need to compute the base58 translation with the right prefix. Proof that it’s not hashed: this process is reversible.
FFF's user avatar
  • 3,250
3 votes
Accepted

Unable to get consistent tz2 (secp256pk1) signature

The immediate problem seems to be that you are not getting signatures in "lower S" form. This seems better: sk.sign_digest(digest, sigencode=ecdsa.util.sigencode_string_canonize) I cannot vouch for ...
Tom's user avatar
  • 2,506
3 votes
Accepted

How can I make a proof of burn address?

You could use something like tz1burnburnburnburnburnburnburjAYjjX.
Arthur B's user avatar
  • 4,599
3 votes
Accepted

Convert address to string in LIGO

You cannot convert an address to a string in Michelson. You could cheat by going through pack and inspecting the binary representation but it is unlikely something you would want to do.
FFF's user avatar
  • 3,250
3 votes
Accepted

Terminology of Address Types

As said in the glossary, tz accounts are called "implicit accounts" and KT1 accounts are called "originated accounts" or "smart contracts" (these two expressions are ...
Raphaël Cauderlier's user avatar
3 votes

Can I send transactions from tz1 to KT1 and viceversa?

Yes, you can send transactions from TZ1 to KT1 addresses and back 👍
asbjornenge's user avatar
  • 1,973
3 votes
Accepted

How are KT1 accounts originated?

The only role of the KT1 hash is to be a unique handle. It's computed from the parameters of the origination operation so that no two operations can yield the same handle. See origination_nonce in ...
Arthur B's user avatar
  • 4,599
3 votes

Manually calculate tz1 address from privatte key/mnemonic

You need to apply blake2b hash on the public key; Add the perfix respective to the elliptic curve you are using; Encode the bytes with base58. Code example from: https://github.com/murbard/pytezos/...
Rodrigo Quelhas's user avatar
3 votes
Accepted

Verifiable Burn/Zero Address

This address is literally the zero address; it's hexadecimal representation is 0x00000000000000000000000000000000000000000000. You can check this by running octez-client normalize data ...
Raphaël Cauderlier's user avatar
3 votes

Is there a valid address that can never be assigned?

Do you mean tz1Ke2h7sDdakHJQh8WX4Z372du1KChsksyU? It's called the null address because it's internally a list of zeros (that yields tz1Ke2... when encoded as a base-58 public key hash). And with ...
iguerNL's user avatar
  • 1,141
2 votes
Accepted

Why are the tz and KT addresses using different letter cases?

You can see in the commit 1c7d7ce7 that the prefix was previously "TZ1". The case was used to distinguish between the two types of adresses. This commit changed the letters to "limit confusion with ...
Clement J.'s user avatar
2 votes

Unable to get consistent tz2 (secp256pk1) signature

Not a direct answer, but workaround python-ecdsa lib generates non-deterministic signatures by default (see more at https://www.rfc-editor.org/rfc/rfc6979#section-3.2). Each time you run your code you ...
Michael Zaikin's user avatar
2 votes

Tezbox sent my wallet balance (240 tezos) to wrong address when transferring balance to my Atomic wallet. Can I get them back?

There is a high chance you got scammed by a fake TezBox site. Go back and carefully check the URL. TezBox has been "dead" and unsupported for almost a year and half. There have been several ...
utdrmac's user avatar
  • 3,422
2 votes

How to get tezos KT address from the public key?

KT addresses are the addresses of smart contract (aka. "originated accounts"). Contrary to tz addresses (aka. "implicit accounts"), smart contracts are not associated with a pair ...
Raphaël Cauderlier's user avatar
2 votes
Accepted

tz4 curve implementation

It's the curve the rest of the crypto world has somewhat standardized on, and there is an open Ethereum EIP to support it. See the motivation and rationale section. https://eips.ethereum.org/EIPS/eip-...
Arthur B's user avatar
  • 4,599
1 vote
Accepted

Smart contracts - get tz address from signature like ecrecover ethereum

For implicit accounts, the address is nothing more than the hash of the public key so this means that you can compute the address from the public key but not the other way around. In Michelson, you ...
Raphaël Cauderlier's user avatar
1 vote
Accepted

How are addresses ordered in Tezos?

The address data type is ordered lexicographically, so that tz2... comes before tz3... and tz2a... comes before tz2b... etc. But originated accounts, addresses that start with KT1, come after any ...
Thorkil Værge's user avatar
1 vote
Accepted

Smartpy restrict entrypoint for originated addresses (KT1)

If you are specifically interested in the address of your caller there a simpler solution than the one proposed by @rodrigo-quelhas: sp.sender is an implicit account if and only if it is exactly sp....
Raphaël Cauderlier's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible