Bitcoin Forum
April 28, 2024, 07:39:47 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Javascript Taproot Address Generator for Browser  (Read 325 times)
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
July 28, 2023, 06:26:44 AM
Last edit: July 28, 2023, 07:37:06 PM by cfbtcman
Merited by NotATether (2)
 #1

Hi,

I'd like to know if there is ppl that would like to help to develop a Javascript Taproot Address Generator for Browser.

I have been working on that since some time and the idea is to make the simplest address generator possible in a standalone file, without using complicated libraries full of code that makes any guy just want to trust and not verify.

I'm trying to find ppl that have full knowledge of the process since the X-only coordinate until the final bech32m encoding to generate the BC1P... address.

As I said the idea is not just use some public libraries and make it work, that I already have, the idea is to isolate all the code and explain it step by step for any newbie that understands or pretend to learn coding could understand fully what is being done.

Someone would like to help?
1714289987
Hero Member
*
Offline Offline

Posts: 1714289987

View Profile Personal Message (Offline)

Ignore
1714289987
Reply with quote  #2

1714289987
Report to moderator
1714289987
Hero Member
*
Offline Offline

Posts: 1714289987

View Profile Personal Message (Offline)

Ignore
1714289987
Reply with quote  #2

1714289987
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714289987
Hero Member
*
Offline Offline

Posts: 1714289987

View Profile Personal Message (Offline)

Ignore
1714289987
Reply with quote  #2

1714289987
Report to moderator
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
July 28, 2023, 06:37:29 AM
 #2

I will lunch first doubt to see if someone could help.

From this x-only form coordinate point:

X= 60376045308133502588319041039213905409191423390227563583774073057371619898448 (decimal)
X= 857BA1721C71D8F80F9C208B513BEEAC46816A4123FB7DB11A3CF6833D58B450 (hexadecimal)

What is the next step to get this final taproot address:

BC1PY5VKU7TV8A39WPE6LQF3P6W5JMC3CMHTWCQ3WHYTW59MCH7542JSFYEMK9

?
FatFork
Legendary
*
Offline Offline

Activity: 1582
Merit: 2584


Top Crypto Casino


View Profile WWW
July 28, 2023, 12:10:39 PM
Merited by bitmover (3)
 #3

Taproot support was added in the v6.1.0-rc.0 version of BitcoinJS-lib, so I don't see what your problem is. To clarify, I'm not advocating for bloatware or using libraries for tasks that can be done manually. However, considering the complexity of the problem you're trying to solve and the potential pitfalls, especially if you're not an experienced coder, this is a perfect example of where using a professionally made and thoroughly tested library makes sense and is justified.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
July 28, 2023, 07:34:37 PM
Last edit: July 29, 2023, 12:35:57 AM by cfbtcman
 #4

I'm trying to make bitcoin not only for nerds.

One example of a bitcoin JS library terms and conditions of use, that is already used by many that don't understand it:

"Be aware: this library is Apache licensed. By using it, you agree with the terms of that license.
In particular pay attention to section 7 and 8, which assert there is NO WARRANTY that this library is safe to use or bug free, and in fact that by using this code you accept that none of the contributors shall be liable for any damages or monetary loss that results from your use of their code, even if due to bugs in that code. In short, according to the license the library is distributed under, there are no situations in which you could sue any of the developers (it's as if you wrote the entire library yourself). If you can't handle that, don't use this library."


The bitcoin slogan is: "Don't trust, verify!"

First step is to make a step by step manual as easier as possible, with only the code to generate addresses and forget everything else.

Generating secure addresses is the heart/core of bitcoin and nobody is doing it, a beginner can forget everything else as how to mine, how to run a node, can't forget how to generate safe addresses and many, many are mining and running nodes that don't know how to generate safe addresses, even the code of bitcoin core is questionable about the security of generating addresses safely.

The news about robberies come to the internet every single day, so, we need to have simple manual step by step for the ones that would like to learn.

I'm here ready to learn and teach what I already know, if somebody could help many will appreciate.

FatFork
Legendary
*
Offline Offline

Activity: 1582
Merit: 2584


Top Crypto Casino


View Profile WWW
July 28, 2023, 07:53:20 PM
 #5

I'm trying to made bitcoin not only for nerds.

One example of a bitcoin JS library terms and conditions of use, that is already used by many that don't understand it:

Sorry to say, but that's a stupid argument. Find me a single piece of open source software or license that doesn't include a "NO WARRANTY" clause. Even if you choose not to use the open source BitcoinJS-lib, you'll still be using a web browser and its underlying JS engine. Have you bothered checking what their licenses say?

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
bitmover
Legendary
*
Offline Offline

Activity: 2282
Merit: 5902


bitcoindata.science


View Profile WWW
July 28, 2023, 08:51:13 PM
 #6

Hi,

I'd like to know if there is ppl that would like to help to develop a Javascript Taproot Address Generator for Browser.

I have been working on that since some time and the idea is to make the simplest address generator possible in a standalone file, without using complicated libraries full of code that makes any guy just want to trust and not verify.

The lines of code contained in popular libraries are complex and very extensive. But there is a reason for that.

They aren't complex to make you confused when verifying.  They are complex because they are tested,  secure, efficient and accurate.

You shouldn't spend your time reinventing the wheel. This is not how new techs evolve.

By doing what those professional libraries do in your own way, you will probably create an insecure and inefficient software.

For learning purposes you are making a nice initiative.  But only for that.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
July 29, 2023, 12:56:29 AM
 #7

Even the wheel continues to evolve in practice.

Almost all base code of all OS's etc will be rewritten by IA and will be more efficient.

For now I'm just concentrated in libraries that don't belong to JS engine and have much more code than what I need.

Maybe in future I'll make a movie step by step how to generate a taproot address only with pen and paper for Guiness records !

To understand all the process I need to isolate the less code possible to start studying it.

All the code have bugs or can be improved, If there is nobody reading, it can't evolve.

For some reason we are using Taproot now and we don't became forever on Legacy.

There is not only one library for same features, the idea is to select the best approach of each one.

When I started learning to code I was taught that the most important was algorithm.

That was a universal language that could be converted in any code language.

Any big work need to have a project, so, one algorithm is the best project for bitcoin, where is that algorithm for next generations could learn about bitcoin and maybe improve it?

With this type of approach I think we should change the slogan to: "Don't verify, just trust!"
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10505



View Profile
July 30, 2023, 05:19:28 AM
Merited by hosseinimr93 (4), o_e_l_e_o (4), bitmover (2)
 #8

If you don't have an advanced understanding of the Bitcoin protocol you should not attempt implementing any part of it, specially security critical parts like address generation. Not to mention that using it in browser and using Javascript is already a terrible idea.

Case in point:
From this x-only form coordinate point:

X= 60376045308133502588319041039213905409191423390227563583774073057371619898448 (decimal)
X= 857BA1721C71D8F80F9C208B513BEEAC46816A4123FB7DB11A3CF6833D58B450 (hexadecimal)

What is the next step to get this final taproot address:

BC1PY5VKU7TV8A39WPE6LQF3P6W5JMC3CMHTWCQ3WHYTW59MCH7542JSFYEMK9
Creating Taproot addresses is slightly different from other addresses. It is not a simple matter of pubkey to address since a Taproot address can be both a "pay to key" and a "pay to script" at the same time (imagine a combination of both P2PKH and P2SH but with only one address format). So there are also two ways of creating the address.
One is the simple and quick way of "pay to key" where the address encodes the pubkey you have:
Code:
bc1ps4a6zusuw8v0sruuyz94zwlw43rgz6jpy0ahmvg68nmgx02ck3gq7xmyug

The other is creating a "dummy" script with the single key to use that for spending. This requires computing the tweak hash
Code:
t = SHA256(SHA256("TapTweak") || SHA256("TapTweak") || pub_bytes)
and tweak key
Code:
pub_tweak = pub + (t * G).
and computing the address using the tweaked pubkey
Code:
bc1py5vku7tv8a39wpe6lqf3p6w5jmc3cmhtwcq3whytw59mch7542jsfyemk9

This means depending on how you created the address, the way you spend the coins sent to the address is going to be different.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
bitmover
Legendary
*
Offline Offline

Activity: 2282
Merit: 5902


bitcoindata.science


View Profile WWW
July 30, 2023, 09:36:33 PM
Merited by cfbtcman (5)
 #9

Even the wheel continues to evolve in practice.

But you should evolve from where people left, not from zero.

When I started to learn how to code I was also resistant to use libraries.  Later on I understood that a programmer who ignores them is making a worse software.

Libraries are code written by specialists. You cannot be a specialist in everything,  so you use code other people wrote.your softwares will be better when you understand the importance of libraries

Sometime you can ignore libraries because you are in a hurry or because you have a limited environment... but when you can you should use them.


Maybe in your project you may not use them. But you should be aware of the limitations you are imposing to your project (specially in security and efficiency)

Quote
Almost all base code of all OS's etc will be rewritten by IA and will be more efficient.

This not happening. And probably will never be done from scratch by ai.  Thks is not how ai works.

even AI look at current libraries before trying to write a better code. AI might improve code.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
July 31, 2023, 02:43:39 AM
 #10

If you don't have an advanced understanding of the Bitcoin protocol you should not attempt implementing any part of it, specially security critical parts like address generation. Not to mention that using it in browser and using Javascript is already a terrible idea.

Case in point:
From this x-only form coordinate point:

X= 60376045308133502588319041039213905409191423390227563583774073057371619898448 (decimal)
X= 857BA1721C71D8F80F9C208B513BEEAC46816A4123FB7DB11A3CF6833D58B450 (hexadecimal)

What is the next step to get this final taproot address:

BC1PY5VKU7TV8A39WPE6LQF3P6W5JMC3CMHTWCQ3WHYTW59MCH7542JSFYEMK9
Creating Taproot addresses is slightly different from other addresses. It is not a simple matter of pubkey to address since a Taproot address can be both a "pay to key" and a "pay to script" at the same time (imagine a combination of both P2PKH and P2SH but with only one address format). So there are also two ways of creating the address.
One is the simple and quick way of "pay to key" where the address encodes the pubkey you have:
Code:
bc1ps4a6zusuw8v0sruuyz94zwlw43rgz6jpy0ahmvg68nmgx02ck3gq7xmyug

The other is creating a "dummy" script with the single key to use that for spending. This requires computing the tweak hash
Code:
t = SHA256(SHA256("TapTweak") || SHA256("TapTweak") || pub_bytes)
and tweak key
Code:
pub_tweak = pub + (t * G).
and computing the address using the tweaked pubkey
Code:
bc1py5vku7tv8a39wpe6lqf3p6w5jmc3cmhtwcq3whytw59mch7542jsfyemk9

This means depending on how you created the address, the way you spend the coins sent to the address is going to be different.

Thanks for the answer, that helped me a lot.

I had already got the first address with some node.js scripts that I thought they were wrong, because so many different scripts was giving different results and because when tested some of them with some satoshis I just lost the access to them.

About doing it on browser or nodejs is probably one of the best ways to teach how the things work, because the facility, fame and for does not need to be compiled fits perfectly.


About security everything can be put on check, even a node or hardware wallet.

Bitcoin will be attacked by all sides, there is a hacker/scam community growing everyday pointing to bitcoin/crypto, they will use methods that today we don't even imagine.

Each wallet generated should have a security level matching the quantity of money it have, if I was CZ from Binance, for sure I would have generated it with pen and paper.

To do something like that we need to know the algorithm and test it before in some environment, so Javascript Engine, because the facility, fame and for does not need to be compiled fits perfectly.

I'll focus on the code for the first example and try to understand it, thanks again for the help.
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
July 31, 2023, 02:59:52 AM
 #11

Even the wheel continues to evolve in practice.

But you should evolve from where people left, not from zero.

When I started to learn how to code I was also resistant to use libraries.  Later on I understood that a programmer who ignores them is making a worse software.

Libraries are code written by specialists. You cannot be a specialist in everything,  so you use code other people wrote.your softwares will be better when you understand the importance of libraries

Sometime you can ignore libraries because you are in a hurry or because you have a limited environment... but when you can you should use them.


Maybe in your project you may not use them. But you should be aware of the limitations you are imposing to your project (specially in security and efficiency)

Quote
Almost all base code of all OS's etc will be rewritten by IA and will be more efficient.

This not happening. And probably will never be done from scratch by ai.  Thks is not how ai works.

even AI look at current libraries before trying to write a better code. AI might improve code.

Sometimes the best way of evolve something is start from scratch, one example is quantic computing.

If you go to the bases you can read that almost all ppl is using CSPRNG's to generate the "random" numbers for bitcoin addresses, every CSPRNG is like a casino roulette, there is none perfect and maybe can be exploited someday, nobody need to use a CSPRNG to generate his own addresses.
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
July 31, 2023, 08:54:33 PM
 #12

If you don't have an advanced understanding of the Bitcoin protocol you should not attempt implementing any part of it, specially security critical parts like address generation. Not to mention that using it in browser and using Javascript is already a terrible idea.

Case in point:
From this x-only form coordinate point:

X= 60376045308133502588319041039213905409191423390227563583774073057371619898448 (decimal)
X= 857BA1721C71D8F80F9C208B513BEEAC46816A4123FB7DB11A3CF6833D58B450 (hexadecimal)

What is the next step to get this final taproot address:

BC1PY5VKU7TV8A39WPE6LQF3P6W5JMC3CMHTWCQ3WHYTW59MCH7542JSFYEMK9
Creating Taproot addresses is slightly different from other addresses. It is not a simple matter of pubkey to address since a Taproot address can be both a "pay to key" and a "pay to script" at the same time (imagine a combination of both P2PKH and P2SH but with only one address format). So there are also two ways of creating the address.
One is the simple and quick way of "pay to key" where the address encodes the pubkey you have:
Code:
bc1ps4a6zusuw8v0sruuyz94zwlw43rgz6jpy0ahmvg68nmgx02ck3gq7xmyug

The other is creating a "dummy" script with the single key to use that for spending. This requires computing the tweak hash
Code:
t = SHA256(SHA256("TapTweak") || SHA256("TapTweak") || pub_bytes)
and tweak key
Code:
pub_tweak = pub + (t * G).
and computing the address using the tweaked pubkey
Code:
bc1py5vku7tv8a39wpe6lqf3p6w5jmc3cmhtwcq3whytw59mch7542jsfyemk9

This means depending on how you created the address, the way you spend the coins sent to the address is going to be different.

Hi,

I found this on internet:

To create a P2TR (Pay-to-Taproot) address for a single public key, you need to:

1º Check that the y-coordinate of your public key is even, if not, negate the public key. Taproot requires that the y coordinate of the public key is even.


What is the meaning of this?
In this example I gave you, Y was odd and it worked perfectly!

Can you help ? !
pooya87
Legendary
*
Offline Offline

Activity: 3430
Merit: 10505



View Profile
August 01, 2023, 05:32:52 AM
Merited by NotATether (1)
 #13

~
Hi,

I found this on internet:

To create a P2TR (Pay-to-Taproot) address for a single public key, you need to:

1º Check that the y-coordinate of your public key is even, if not, negate the public key. Taproot requires that the y coordinate of the public key is even.


What is the meaning of this?
In this example I gave you, Y was odd and it worked perfectly!

Can you help ? !
That does not matter for address generation because your x value does not change when negating a public key meaning P(x,y) = -P(x,y) = P(x,-y) and we only use the x coordinate in the address.
Even y coordinate is something you should check and take some extra steps when signing and verifying ECSDSA signatures.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
August 01, 2023, 06:27:01 AM
 #14

Understood !

Thanks again for the help, I'll keep my job.

Sorry, I have 0 merit points to give you, we need to ask admins to change merit points for LN Satoshis and anyone could send it as much as he wants.

Forum could win a fee too, it would be awesome.

cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
August 11, 2023, 02:41:39 AM
 #15

Hi,

I'd like to know if there is ppl that would like to help to develop a Javascript Taproot Address Generator for Browser.

I have been working on that since some time and the idea is to make the simplest address generator possible in a standalone file, without using complicated libraries full of code that makes any guy just want to trust and not verify.

The lines of code contained in popular libraries are complex and very extensive. But there is a reason for that.

They aren't complex to make you confused when verifying.  They are complex because they are tested,  secure, efficient and accurate.

You shouldn't spend your time reinventing the wheel. This is not how new techs evolve.

By doing what those professional libraries do in your own way, you will probably create an insecure and inefficient software.

For learning purposes you are making a nice initiative.  But only for that.

Look how they are tested, secure, efficient and accurate:

https://cointelegraph.com/news/newly-discovered-bitcoin-wallet-loophole-let-hackers-steal-funds-slow-mist

That is what I have being trying to explain, we can always do it better if we study it enough, we need one simple, auditable official core APP just to generate addresses, not a core with gigas and gigas and using CSPNG's.
NotATether
Legendary
*
Offline Offline

Activity: 1582
Merit: 6696


bitcoincleanup.com / bitmixlist.org


View Profile WWW
August 11, 2023, 04:40:19 AM
 #16

I'm trying to make bitcoin not only for nerds.

One example of a bitcoin JS library terms and conditions of use, that is already used by many that don't understand it:

"Be aware: this library is Apache licensed. By using it, you agree with the terms of that license.
In particular pay attention to section 7 and 8, which assert there is NO WARRANTY that this library is safe to use or bug free, and in fact that by using this code you accept that none of the contributors shall be liable for any damages or monetary loss that results from your use of their code, even if due to bugs in that code. In short, according to the license the library is distributed under, there are no situations in which you could sue any of the developers (it's as if you wrote the entire library yourself). If you can't handle that, don't use this library."


The bitcoin slogan is: "Don't trust, verify!"

All that license text is saying is:

- This library is licensed under the Apache License https://www.apache.org/licenses/LICENSE-2.0
- and that you cant sue developers for bugs (your standard "no liability" and "no warranty" sections).

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
August 24, 2023, 02:12:45 PM
 #17

~
Hi,

I found this on internet:

To create a P2TR (Pay-to-Taproot) address for a single public key, you need to:

1º Check that the y-coordinate of your public key is even, if not, negate the public key. Taproot requires that the y coordinate of the public key is even.


What is the meaning of this?
In this example I gave you, Y was odd and it worked perfectly!

Can you help ? !
That does not matter for address generation because your x value does not change when negating a public key meaning P(x,y) = -P(x,y) = P(x,-y) and we only use the x coordinate in the address.
Even y coordinate is something you should check and take some extra steps when signing and verifying ECSDSA signatures.

I have another doubt in the hands, after google and ChatGPt the doubt subsist, is there any hashed Taproot address that protects the public key identity until 1st transaction be done as in Legacy and Segwit addresses or every Taproot address simple or with tweak never protect the public key identity ?
albert0bsd
Hero Member
*****
Offline Offline

Activity: 849
Merit: 660



View Profile WWW
August 25, 2023, 03:03:24 PM
 #18

....  because when tested some of them with some satoshis I just lost the access to them.

There is something called Testnet where you can learn and practice, if there are some error you will not lose anything because Testnet coins are worthless.

cfbtcman (OP)
Member
**
Offline Offline

Activity: 264
Merit: 16


View Profile
August 25, 2023, 05:01:07 PM
 #19

....  because when tested some of them with some satoshis I just lost the access to them.

There is something called Testnet where you can learn and practice, if there are some error you will not lose anything because Testnet coins are worthless.

I know, but testnet for itself dont teach us how to generate Taproot addresses with our own code.

albert0bsd
Hero Member
*****
Offline Offline

Activity: 849
Merit: 660



View Profile WWW
August 25, 2023, 06:04:11 PM
Last edit: August 25, 2023, 08:40:24 PM by albert0bsd
 #20

I know, but testnet for itself dont teach us how to generate Taproot addresses with our own code.

I don't buy it, the main difference between mainnet and testnet is that Testnet addresses have different byte prefix. So if you manage to do a code to generate a taproot address in testnet you only need to change the prefix to generate it on mainnet.

Testnet can indeed be a valuable tool for learning how to generate Taproot addresses with your own code. Testnet is valuable for us as developers to experiment and test our code without using real funds.

Please don't burn satoshis on mainnet.

By the way I support you to learn to do it by yourself, that kind as self learning is good.

Regards.

Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!