19 votes
Accepted

What elliptic curves are used by Tezos?

Yes, Tezos supports three types of keys associated with 3 kinds of elliptic curves tz1 for Ed25519 keys, tz2 for Secp256k1 keys (same as Bitcoin/Ethereum) tz3 for NIST P256 keys which may have led ...
Ezy's user avatar
  • 6,064
8 votes

Encryption within smart contract

It's not clear what decrypting data from within a smart contract would achieve since all operations are public.
Arthur B's user avatar
  • 4,599
8 votes
Accepted

Encryption within smart contract

There are currently no encrypt/decrypt instructions for Michelson. You can view the full list of instructions here: http://tezos.gitlab.io/mainnet/whitedoc/michelson.html
Stephen Andrews's user avatar
7 votes
Accepted

How to calculate a random seed?

We will need these operations: blake2b: size 32 concat: concatenation of byte arrays Also, let zero_bytes be 32 zero bytes. My answer is based on seed_storage.ml and seed_repr.ml, with some ...
Tom's user avatar
  • 2,506
7 votes
Accepted

Why a reveal operation?

Ethereum way of retrieving the public key only works with some signing algorithms, ECDSA with secp256k1 in its case. It is also used by Tezos for tz2 (and P-256 for tz3), but not for tz1 which uses ...
lefessan's user avatar
  • 3,308
4 votes

HD Derivation Path with P-256 signature

TezBox currenty only supports the ed25519 curve, this is because the underlying library (eztz.js) only supports this curve. We are about to release support for the other two curves in eztz.js in the ...
Stephen Andrews's user avatar
4 votes
Accepted

Secp256k1 with Non-Deterministic Signatures

It shouldn't make a difference how you pick k, deterministically or not. It's random and is supposed to be kept secret by the signer, so there's no way to tell what k was used by just looking at the ...
Arthur B's user avatar
  • 4,599
3 votes

Implementing signing logic for TZ4 (BLS12-381) Addresses using TypeScript

Regarding BLS signatures, Octez follows the CFRG specification v4 about BLS signatures. The OCaml library used is ocaml-bls12-381-signature. The current protocol (i.e. up to M while writing these ...
Danny Willems's user avatar
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

Get unencrypted secret key from the encrpyted one in a programmatic way

If using pytezos that would be: >>> from pytezos import Key ... Key.from_encoded_key('edskReYTc3xorfemyNAcrYb6Sz8Wgj6e1PfevpZ6uysf4KXWBNxXcoLA4KBtZp7hmUCy6V3bhtWZRMSuya5DgXA1TU2JXYeDmG')....
Michael Zaikin'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
Accepted

How to generate a tz4 (BLS-MinPk key pair) address

You can use octez-client: $ octez-client gen keys <account alias> --sig bls
Raphaël Cauderlier's user avatar
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
1 vote
Accepted

How to use the pytezos.crypto.encoding.base58_encode function?

Try the following: from pytezos.crypto.key import Key pk = Key.from_encoded_key('edpkvFujbm3Xiamfxceg4GbsUBHzvqLZQmZvddg7xcFFvFQBEjeHTp')
Rodrigo Quelhas's user avatar
1 vote
Accepted

Chest keys generated by @smartpy/timelock are not functional

The javascript primitives seem to be weak for creating the chest. You can use the CLI: ./timelock.exe create-chest-and-chest-key --payload "05010000000b48454c4c4f20574f524c44" --time 3456 ...
Rodrigo Quelhas's user avatar
1 vote
Accepted

Is it possible to create secure guessing game on chain?

You can use commit/reveal pattern, for turn based game it works well. Here a template in CameLIGO you would be able to adapt to your use case: https://github.com/ligolang/randomness-cameligo
Thomas's user avatar
  • 380
1 vote
Accepted

How to sign transaction from tz2 address?

You must sign transactions from tz2 addresses with secp256k1. Eztz's sign function uses Ed25519, so that wont work. Easiest would probably be to just replace libsodium in eztz with something like ...
Klassare's user avatar
  • 1,345

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