Closed Xxxxxx-dot closed 1 month ago
int main() {
secp256k1_context *ctx = secp256k1_context_create(SECP256K1_CONTEXT_SIGN | SECP256K1_CONTEXT_VERIFY); unsigned char privkey[32] = { 0x7d, 0x48, 0x1e, 0x43, 0x55, 0xd5, 0x1c, 0x82, 0x4e, 0x8d, 0x02, 0xe6, 0x17, 0xd0, 0xe1, 0x88, 0xba, 0x97, 0x68, 0x5e, 0x55, 0xf8, 0x65, 0x57, 0xd1, 0xd8, 0x3d, 0x64, 0xd1, 0xc8, 0x95, 0x4b }; if (!secp256k1_ec_seckey_verify(ctx, privkey)) { printf("Invalid private key\n"); secp256k1_context_destroy(ctx); return 1; } secp256k1_pubkey pubkey; if (!secp256k1_ec_pubkey_create(ctx, &pubkey, privkey)) { printf("Failed to create public key\n"); secp256k1_context_destroy(ctx); return 1; } secp256k1_xonly_pubkey xonly_pubkey; if (!secp256k1_xonly_pubkey_from_pubkey(ctx, &xonly_pubkey, NULL, &pubkey)) { printf("Failed to convert to x-only public key\n"); secp256k1_context_destroy(ctx); return 1; } unsigned char output[32]; if (!secp256k1_xonly_pubkey_serialize(ctx, output, &xonly_pubkey)) { printf("Failed to serialize x-only public key\n"); secp256k1_context_destroy(ctx); return 1; } printf("Taproot public key (x-only): "); for (size_t i = 0; i < 32; i++) { printf("%02x", output[i]); } printf("\n"); secp256k1_context_destroy(ctx); return 0;
}
I need t2pr public key
I need an example, can anyone help me?
Such a conversion is wrong taproot public key
include
include
include
include
int main() {
}
I need t2pr public key
I need an example, can anyone help me?