ECKey - plan99.net

Sweeping/Importing BIP38-encrypted key with blank password

Dear Verters,
a while ago, I created a paper wallet using the website https://paperwallet.vertcoin.org/ which does not exist any more. I am quite sure I did not use the optional encryption of my private key. The private key starts with 6P... and as I learned is a BIP38-encrypted key (in my case without being encrypted). Using https://walletgenerator.net/?currency=Vertcoin# I tried to decrypt the key but as I can't pass an empty password this does not work.
I found this old post, https://www.reddit.com/vertcoin/comments/2aohw3/paper_wallets_code_5_question_help/ where someone had the same problem. The solution was to use the walletgenerator and the developer console (Browser, F12) with the following command to bypass the password detection: ninja.privateKey.BIP38EncryptedKeyToByteArrayAsync("6Pf...", "", function(x) { console.log(new Bitcoin.ECKey(x).getBitcoinWalletImportFormat()); })
This did not work any more. Does anyone have an idea how I can recover the private key in a format so that I can use it for sweeping or import in electrum?
Thanks!
submitted by VeryTrendyCash to vertcoin [link] [comments]

Creating a private/public key with 64 characters that are already known using bitcoinjs

So I'm trying to create a private/public key from 64 characters that I already know using bitcoinjs with the code below:
key = Bitcoin.ECKey.makeRandom(); // Print your private key (in WIF format) document.write(key.toWIF()); // => Kxr9tQED9H44gCmp6HAdmemAzU3n84H3dGkuWTKvE23JgHMW8gct // Print your public key (toString defaults to a Bitcoin address) document.write(key.pub.getAddress().toString()); // => 14bZ7YWde4KdRb5YN7GYkToz3EHVCvRxkF 
If I try to set "key" to my 64 characters instead of "Bitcoin.ECKey.makeRandom();" it fails. Is there a method or library that I overlooked that would allow me to use the known 64 characters in order to generate the private key in wif format and the public address?
Thanks in advance to anyone that may be able to offer some help.
submitted by coreyp57 to BitcoinBeginners [link] [comments]

How to verify a signed message in bitcoinj?

Link to bitcoin stack exchange: https://bitcoin.stackexchange.com/questions/92406/how-to-verify-a-signed-message-in-bitcoinj

I want to verify, in Java, a signature produced with bitcoin core's signmessagewithprivkey (equivalent to the verifymessage). I noticed a bitcoinj method similar to the bitcoin core's verifymessage - org.bitcoinj.core.ECKey.verify. What follows is my implementation attempt and its test.
For testing I will generate a signature and check it in bitcoin core:
>bitcoin-cli signmessagewithprivkey $(bitcoin-cli dumpprivkey 1CwKH9PQPkFPjQagEv483FUM5ngk57L3Pp) "" H2wp/+5N2+OQwP6a5GFRbt8S+EfML1Szx4uhWPfiO0e/QcY2rZQOkLOR+unknNl4NgDWBacRRXOLjr+m53V0xic= > bitcoin-cli verifymessage "1CwKH9PQPkFPjQagEv483FUM5ngk57L3Pp" "H2wp/+5N2+OQwP6a5GFRbt8S+EfML1Szx4uhWPfiO0e/QcY2rZQOkLOR+unknNl4NgDWBacRRXOLjr+m53V0xic=" "" true 
So, signing an empty message with the RPC using the address 1CwKH9PQPkFPjQagEv483FUM5ngk57L3Pp (public key: 021c3be5fb7820c56d881ea2d02a906d87540ec8888bbe819b7abd2e39f6f6e512), produces the signature H2wp/+5N2+OQwP6a5GFRbt8S+EfML1Szx4uhWPfiO0e/QcY2rZQOkLOR+unknNl4NgDWBacRRXOLjr+m53V0xic=.
My Java implementation attempt:
import org.apache.commons.codec.binary.Hex; import org.bitcoinj.core.ECKey; import org.bitcoinj.core.Sha256Hash; import java.math.BigInteger; import java.util.Base64; public class Notebook { public static BigInteger[] ParseSig(byte[] sigBytes, int sigOff) { BigInteger r = new BigInteger( 1 ,sigBytes, sigOff, 32); BigInteger s = new BigInteger( 1, sigBytes, sigOff + 32, 32); return new BigInteger[] { r, s }; } public static void main(String[] args) throws Exception{ // Signature String signatureString = "H2wp/+5N2+OQwP6a5GFRbt8S+EfML1Szx4uhWPfiO0e/QcY2rZQOkLOR+unknNl4NgDWBacRRXOLjr+m53V0xic="; byte[] signatureBytes = Base64.getDecoder().decode(signatureString); BigInteger[] signatureRandS = ParseSig(signatureBytes, 1); ECKey.ECDSASignature signature = new ECKey.ECDSASignature(signatureRandS[0], signatureRandS[1]); // Public key String pubKeyString = "021c3be5fb7820c56d881ea2d02a906d87540ec8888bbe819b7abd2e39f6f6e512"; byte[] decodedPubKeyString = Hex.decodeHex(pubKeyString.toCharArray()); ECKey publicKey = ECKey.fromPublicOnly(decodedPubKeyString); // Message String message = "Bitcoin Signed Message:\n"; Sha256Hash messageHash = Sha256Hash.of(message.getBytes()); Sha256Hash messageDoubleHash = Sha256Hash.of(messageHash.getBytes()); // Test boolean result = publicKey.verify(messageDoubleHash, signature); System.out.println("Result: " + result); } } 
Notice that I used the salt Bitcoin Signed Message:\n before hashing the message - this is done by signmessagewithprivkey as shown here and here. The problem is the above implementation doesn't pass my test and I don't know why...
submitted by johnturtle to BitcoinBeginners [link] [comments]

Going mad with bitcoinj...

I know I am doing something silly somewhere, It has been driving me mad for a while now... I am still looking through the code but in case someone can immediately see where the problem is, I d be very grateful. Issue is I am not getting what I expect from the bitcoinj function publicPointFromPrivate. Here is the sample code explaining:
import org.bitcoinj.core.ECKey; import java.math.BigInteger; import org.spongycastle.math.ec.ECPoint; public class Test { public static void main(String[] args){ // some private key example of 'Mastering Bitcoin' String s = "1E99423A4ED27608A15A2616A2B0E9E52CED330AC530EDCC32C8FFC6A526AEDD"; BigInteger secret = new BigInteger(s,16); ECPoint point = ECKey.publicPointFromPrivate(secret); BigInteger x = point.getXCoord().toBigInteger(); BigInteger y = point.getYCoord().toBigInteger(); // 3ddfa27b1a7e6944d36c02c35ade5c1d4977829e4415c5e023e1063344bfd3be System.out.println(x.toString(16)); // a24d02cf6cf43609b1c00c9accd3d26478d8a14205d086ab4332347e8a5b825e System.out.println(y.toString(16)); /* These two numbers are not what we expect, the correct numbers are below: $ ku -j 1E99423A4ED27608A15A2616A2B0E9E52CED330AC530EDCC32C8FFC6A526AEDD { ... "public_pair_x_hex": "f028892bad7ed57d2fb57bf33081d5cfcf6f9ed3d3d7f159c2e2fff579dc341a", ... "public_pair_y_hex": "7cf33da18bd734c600b96a72bbc4749d5141c90ec8ac328ae52ddfe2e505bdb", ... "secret_exponent_hex": "1e99423a4ed27608a15a2616a2b0e9e52ced330ac530edcc32c8ffc6a526aedd", ... } */ } } 
submitted by altovecchia to Bitcoin [link] [comments]

Ethereum Devcon 5 - Grantee Exposé Lightning Talk 2 State Channels Summit PERUN: Virtual Payment Hubs over Cryptographic Currencies Walter Reiterer - YouTube PERUN: Virtual Payment Hubs over Cryptographic Currencies

ECKey also provides access to Bitcoin Core compatible text message signing, as accessible via the UI or JSON-RPC. This is slightly different to signing raw bytes - if you want to sign your own data and it won't be exposed as text to people, you don't want to use this. If in doubt, ask on the mailing list. The ECDSA algorithm supports key recovery in which a signature plus a couple of ... In bitcoin-s, we support native binaries for libsecp256k1. linux 32 bit; linux 64 bit; mac osx 64 bit; windows 64 bit; Bitcoin-s uses a zero dependency library called native-lib-loader. That does the appropriate loading of the library onto your classpath to be accessed. Using libsecp256k1. To tell if you have access to libsecp256k1 you can do the following. val isEnabled = org.bitcoin ... Bitcoin is a distributed, worldwide, decentralized digital money. Bitcoins are issued and managed without any central authority whatsoever: there is no government, company, or bank in charge of Bitcoin. You might be interested in Bitcoin if you like cryptography, distributed peer-to-peer systems, or economics. A large percentage of Bitcoin enthusiasts are libertarians, though people of all ... ECKey also provides access to Bitcoin-Qt compatible text message signing, as accessible via the UI or JSON-RPC. This is slightly different to signing raw bytes - if you want to sign your own data and it won't be exposed as text to people, you don't want to use this. If in doubt, ask on the mailing list. The ECDSA algorithm supports key recovery in which a signature plus a couple of ... Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up. Sign up to join this community . Anybody can ask a question Anybody can answer The best answers are voted up and rise to the top Bitcoin . Home ; Questions ; Tags ; Users ; Jobs; Unanswered ; ECKey.ECDSASignature creation. Ask Question Asked 4 years, 8 months ago ...

[index] [13353] [50404] [1596] [12289] [41396] [18399] [36877] [5096] [8956] [23032]

Ethereum Devcon 5 - Grantee Exposé Lightning Talk 2

Lisa Eckey, Applied Cryptography Researcher at TU Darmstadt, speaking on the 1st July at Master workshop: off the chain. If you enjoyed this presentation, come down to our next workshop focused on ... 00:00 - Fabrizio Romano Genovese (Statebox) - “Mapping finite state machines to zk-SNARKs using category theory” 10:26 -Lisa Eckey (Perun Off-chain labs) - “Perun’s research on off-chain ... PERUN: Virtual Payment Hubs over Cryptographic Currencies Stefan Dziembowski (University of Warsaw), Lisa Eckey (TU Darmstadt), Sebastian Faust (TU Darmstadt), Daniel Malinowski (University of Warsaw) Presenters: Sebastian Faust, Stefan Dziembowski, Lisa Eckey, Kristina Hostakova. American Football Videos according to Football-Austria.com About Football-Austria: 2005 als Blog gegründet, berichtet Football-Austria seither regelmäßig übe...

#