Tangem Wallet Pack of 2 - Secure Crypto Wallet - Trusted Cold Storage for Bitcoin, Ethereum, NFT's &

Tangem Wallet Pack of 2 - Secure Crypto Wallet - Trusted Cold Storage for Bitcoin, Ethereum, NFT's &
Key item features Ultimate Security: Generates a private key that remains on the card, safeguarding crypto and NFTs from hackers with EAL6+ certification and audited firmware. Versatile Compatibility: Manages over 13,000 tokens across 70+ blockchains, supporting DeFi, NFTs, and DeEx without wires, Bluetooth, or USB. Effortless Operation: Utilizes NFC for secure transactions via a mobile device and the Tangem app, enabling buying and selling crypto with various payment methods. Smart Backup: Features a second Tangem Wallet as a backup, eliminating the need for paper, pictures, or seed phrases for recovery. Durable Design: Boasts IP68 protection against environmental conditions, ensuring longevity and robust physical security. Comprehensive Support: Compatible with Bitcoin, Ethereum, Solana, XRP, USDT, and over 6,000 cryptocurrencies, integrating with dApps and WalletConnect.

LBANK

Musig Key Generation - Taproot Workshop - 1.2 Musig: 1.2.1 Programming Exercise: Compute 3-of-3 MuSig public key

I am finding it difficult to figure out how to properly multiply the key-pairs with the challenges.

privkey1, pubkey1 = generate_key_pair(sha256(b'key0'))
privkey2, pubkey2 = generate_key_pair(sha256(b'key1'))
privkey3, pubkey3 = generate_key_pair(sha256(b'key2'))
pubkeys = [pubkey1, pubkey2, pubkey3]

# Compute key challenges
# Method: use generate_musig_key() on the list of pubkeys.
# generate_musig_key() returns a challenge map and the aggregate public key.
c_map, pubkey_agg =  generate_musig_key(pubkeys)# TODO: implement
print("Aggregated Public Key is {}\n".format(pubkey_agg.get_bytes().hex()))

# Multiply key pairs by challenge factor

The diagram shows that tweaked private key di' = ci * di

musig keygen

This made me think to do something like:

privkey1_c = int.from_bytes(c_map[pubkey1], "big") * int.from_bytes(privkey1.get_bytes(), "big")

(cant multiply bytes directly) But this results in a number far too large and since SECP256K1_ORDER was not imported (for modulo operations) I figured that is a mistake on my part. I also tried to just set it like this:

privkey1_c = ECKey().set(c_map[pubkey1])

Which results in a valid key but is not the expected values that are checked at the assertions at the bottom of the code:

assert privkey1_c.secret == 104717570570407299858230629579807834166658508605015363884161538594382975780625
assert privkey2_c.secret == 65554880484297966965546994775376394861215085064604177497808278620612854069980
assert privkey3_c.secret == 106998690642216524894360365246223287721822845133760006050846956016514597569168

I feel like I'm misunderstanding how the challenge map relates to the challenge factor in the diagram. I assume it outputs ci for each pubkey but if that's the case, multiplying that number by the original privkey will result in a value too large for SECP256K1_ORDER.

There is also this part:

# Determine if the private and public keys need to be negated. 
# Hint: The aggregate public key is the one that needs to be valid.
if pubkey_agg.get_y() % 2 != 0:
    pubkey_agg.negate()
    # TODO: implement

Since the key generation is not random this has the same result every time which is that the if statement returns false (even value) and will not get used, so unless I am misunderstanding that this part seems to be a red herring (irrelevant to the issue).



from Recent Questions - Bitcoin Stack Exchange https://ift.tt/ynKJTNI
via IFTTT

Popular posts from this blog

Crypto Exec Warns Tokenization Is Moving Faster Than Expected

Bitcoin Mining Could Be Strengthening The Ruble, Russian Central Bank Says

Nigerian SEC Partners With Police To Tackle Crypto Ponzi Schemes – Details