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\...
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", "...
user avatar
  • 4,409
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\...
user avatar
  • 4,409
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, ...
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://...
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 ...
user avatar
  • 1,320
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 ...
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 ...
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='foo@bar.com') key.public_key_hash() >>&...
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. ...
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)
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.
user avatar
  • 3,185
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 ...
user avatar
  • 2,501
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 ...
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 👍
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 ...
user avatar
  • 4,409
3 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 ...
user avatar
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 ...
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 ...
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 ...
user avatar
  • 3,364
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 ...
user avatar
2 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.
user avatar
  • 3,185
2 votes
Accepted

How can I make a proof of burn address?

You could use something like tz1burnburnburnburnburnburnburjAYjjX.
user avatar
  • 4,409
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....
user avatar
1 vote

Smartpy restrict entrypoint for originated addresses (KT1)

You can use: https://github.com/RomarQ/tezos-sc-utils Usage: Utils = sp.io.import_script_from_url("https://raw.githubusercontent.com/RomarQ/tezos-sc-utils/main/smartpy/utils.py"); # And ...
user avatar
1 vote
Accepted

How to compare TKeyHash with TAddress? [SmartPy]

You can convert a key_hash to a contract and then a contract to an address. sp.to_address(sp.implicit_account(my_key_hash)) Relevant documentation: https://smartpy.io/docs/types/contracts_addresses#...
user avatar
  • 3,185
1 vote

Is it possible to create a tezos address without paying a fee to do so, or revealing which address paid for the fee?

Any tezos address can receive transactions without revealing. When an address takes any active action on the chain, it must be revealed, and a fee must be paid for revelation. This fee is burnt ...
user avatar
  • 3,364
1 vote

Is address reuse cryptographically secure in Tezos?

I'm not a cryptographic expert but, the issues that you mentioned in Bitcoin involved weak signatures (same K value bug), which when used multiple times enabled the guessing of the private key. This ...
user avatar
  • 311
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 ...
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 ...
user avatar

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