Vorsichtig bei der Installation von firmware, die von unbekannten Quellen, es kann haben wurden geändert, um die Umleitung von der hashing-Leistung an jemand anderen, oder andere schändliche Dinge. Nein, das versenden von Münzen bedeutet die Angabe einer bestimmten Ausgabe eingelöst werden. Eine Ausgabe rückführbar auf den ursprünglichen token bleibt deutlich, auch wenn die Adresse bekommt mehr Münzen in einen anderen Ausgang. Der einzige Punkt, wo Münzen vermischt werden, ist innerhalb einer Transaktion, wenn Sie nicht über eine Konvention zu erkennen, die definierten Eingänge. Diese Antwort könnte verbessert werden, indem Sie erklärte, dass Münzen nur ausgegeben werden, sobald und wie die double-spend-Angriff könnte sich nachteilig auf den Empfänger. Also prinzipiell ist die Idee zu "importieren" die Daten (wahrscheinlich mehr, als Sie eigentlich brauchen), und dann eine Verknüpfung zu den entsprechenden Daten importiert, richtig?

Ich muss signieren Bitcoin-Transaktionen mit JCE-primitive(keine bitcoinj), aber meine Signaturen sind nicht als gültig betrachtet werden von bitcoinj.

Ich habe versucht zu simulieren diesen Prozess. Ich erstellte eine zufällige hash und unterzeichnet es mit beiden JCE und bitcoinj. Signaturen sind nicht gleich.

Hier ist der code

import org.bitcoinj.core.ECKey;
import org.bitcoinj.core.Sha256Hash;
import org.spongycastle.crypto.digests.SHA256Digest;
import org.spongycastle.crypto.params.ECPrivateKeyParameters;
import org.spongycastle.crypto.Unterzeichner.ECDSASigner;
import org.spongycastle.crypto.Unterzeichner.HMacDSAKCalculator;
import sun.Sicherheit.EG.ECPrivateKeyImpl;
import sun.Sicherheit.EG.ECPublicKeyImpl;

import java.math.BigInteger;
import java.security.*;
import java.Sicherheit.spec.ECGenParameterSpec;

public class ECDSABitcoin {

 private static final String SIGN_ALGORITHM = "SHA256withECDSA";

 public static void main(String[] args) throws Exception {

 KeyPairGenerator keyPairGenerator = createGenerator();
 Letzte Schlüsselpaar Schlüsselpaar = keyPairGenerator.generateKeyPair();
 ECPrivateKeyImpl privateKey = (ECPrivateKeyImpl) Schlüsselpaar.getPrivate();
 ECPublicKeyImpl publicKey = (ECPublicKeyImpl) Schlüsselpaar.getPublic();
 try {
 Sha256Hash hashOut = Sha256Hash.wrap(toSha256("abc".getBytes()));
 byte[] signatureBytes = sign(hashOut.getBytes(), Schlüsselpaar);

 ECKey.ECDSASignature mySignature = ECKey.ECDSASignature.decodeFromDER(signatureBytes).toCanonicalised();
 ECKey.ECDSASignature bitcoinSignature = sign(privateKey.getS(), hashOut.getBytes()).toCanonicalised();
 System.aus.println("Meine Unterschrift s" + mySignature.s + " r " + mySignature.r + "canonical" + mySignature.isCanonical());
 System.aus.println("Verify my" + verify(Schlüsselpaar, hashOut.getBytes(), signatureBytes));
 System.aus.println("Bitcoinj Unterschrift s" + bitcoinSignature.s + " r " + bitcoinSignature.r + "canonical" + bitcoinSignature.isCanonical());
 System.aus.println("Überprüfen Bitcoinj" + verify(Schlüsselpaar, hashOut.getBytes(), bitcoinSignature.encodeToDER()));
 } catch (Exception e) {
e.printStackTrace();
}
}

 private static boolean verify(Schlüsselpaar Schlüsselpaar, byte[] message, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException, SignatureException {
 die endgültige Unterschrift verifySignature = Unterschrift.getInstance(SIGN_ALGORITHM);
verifySignature.initVerify(Schlüsselpaar.getPublic());
verifySignature.update(Nachricht);
 zurück verifySignature.überprüfen Sie(signatureBytes);
}

 private static byte[] sign(byte[] message, ein Schlüsselpaar Schlüsselpaar) wirft InvalidKeyException, NoSuchAlgorithmException, SignatureException {
 final Signature signature = Signature.getInstance(SIGN_ALGORITHM);
Unterschrift.initSign(Schlüsselpaar.getPrivate());
Unterschrift.update(Nachricht);
 Rückkehr Unterschrift.Zeichen();
}

 private static KeyPairGenerator createGenerator() throws NoSuchAlgorithmException, InvalidAlgorithmParameterException {
 Letzte KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance("EC");
 ECGenParameterSpec ecParam = new ECGenParameterSpec("secp256k1");
keyPairGenerator.initialize(ecParam);
 zurück keyPairGenerator;
}

 private static ECKey.ECDSASignature Zeichen(BigInteger privateKeyForSigning, byte[] Daten) {
 ECDSASigner signer = new ECDSASigner(neue HMacDSAKCalculator(neue SHA256Digest()));
 ECPrivateKeyParameters privKey = new ECPrivateKeyParameters(privateKeyForSigning, ECKey.KURVE);
 signer.init(true, privKey);
 BigInteger[] Komponenten = Unterzeichner.generateSignature(Daten);
 return new ECKey.ECDSASignature(components[0], components[1]).toCanonicalised();
}

 private static byte[] toSha256(byte[] message) throws NoSuchAlgorithmException {
 MessageDigest crypt = MessageDigest.getInstance("SHA-256");
crypt.reset();
crypt.update(Nachricht);
 zurück Krypta.digest();
}
}

Das Ergebnis ist:

Meine Signatur s 45669553786690215047884329722902825758089042579493437816717142987836102849876 r 14778973653615637448416336446742229796258878351047437829727432860950944374049 kanonischen wahr
Überprüfen Sie meine wahre
Bitcoinj Signatur s 24278043061766196831119988370534304503511938256487950554838614741011144316017 r 26413727078831382349368962255251267289169651926313668837949728205557969096319 kanonischen wahr
Überprüfen Sie Bitcoinj false

Wie Sie sehen, Signaturen sind völlig Verschieden, auch wenn ich die gleichen privaten Schlüssel. Was ist falsch an meinem code? Ich verstehe es einfach nicht.

$200 cialis coupon 10 mg tadalafil generic 5 mg cialis over the counter at walmart best price for tadalafil 20 mg buy cialis buy cialis generic tadalafil buy cialis online buy cialis online without script buy tadalafil buy tadalafil online canadian cialis online pharmacy canadian pharmacy cialis cheap cialis cheap cialis generic cialis cialis 20 mg best price cialis 20mg cialis 30 day sample cialis 30 day trial coupon cialis and alcohol cialis before and after cialis canada cialis canada pharmacy online cialis cost cialis coupon cialis coupons cialis coupons printable cialis dosage cialis dosage information cialis for daily use cialis for sale cialis free trial cialis free trial voucher for cialis cialis generic cialis generic release date cialis generic tadalafil cialis lowest price cialis online cialis online pharmacy cialis over the counter cialis over the counter at walmart cialis patent expiration date extended cialis picture testimonials cialis pills cialis price cialis prices cialis reviews cialis side effects cialis tadalafil cialis tadalafil 20 mg cialis vs viagra cialis vs viagra which is better cialis without a doctor's prescription cialis without doctor prescription cost of cialis cost of tadalafil generic at walgreens coupon for cialis by manufacturer does cialis lower blood pressure generic cialis generic cialis at walmart generic cialis canada generic cialis canada pharmacy generic cialis from india generic cialis tadalafil generic tadalafil generic tadalafil 20 mg is there a generic for cialis online cialis purchasing cialis on the internet side effects for cialis side effects for tadalafil side effects of cialis tadalafil tadalafil 20 mg tadalafil 20 mg canadian drug stores tadalafil 20mg tadalafil 20mg lowest price tadalafil 5 mg tadalafil 5mg tadalafil cost at walmart tadalafil dosage tadalafil generic tadalafil generic at walgreens tadalafil generic best prices tadalafil online tadalafil price tadalafil side effects tadalafil tablets tadalafil without a doctor's prescription viagra vs cialis viagra vs cialis vs levitra warnings for tadalafil $200 cialis coupon 10 mg tadalafil generic 5 mg cialis over the counter at walmart best price for tadalafil 20 mg buy cialis buy cialis generic tadalafil buy cialis online buy cialis online without script buy tadalafil buy tadalafil online canadian cialis online pharmacy canadian pharmacy cialis cheap cialis cheap cialis generic cialis cialis 20 mg best price cialis 20mg cialis 30 day sample cialis 30 day trial coupon cialis and alcohol cialis before and after cialis canada cialis canada pharmacy online cialis cost cialis coupon cialis coupons cialis coupons printable cialis dosage cialis dosage information cialis for daily use cialis for sale cialis free trial cialis free trial voucher for cialis cialis generic cialis generic release date cialis generic tadalafil cialis lowest price cialis online cialis online pharmacy cialis over the counter cialis over the counter at walmart cialis patent expiration date extended cialis picture testimonials cialis pills cialis price cialis prices cialis reviews cialis side effects cialis tadalafil cialis tadalafil 20 mg cialis vs viagra cialis vs viagra which is better cialis without a doctor's prescription cialis without doctor prescription cost of cialis cost of tadalafil generic at walgreens coupon for cialis by manufacturer does cialis lower blood pressure generic cialis generic cialis at walmart generic cialis canada generic cialis canada pharmacy generic cialis from india generic cialis tadalafil generic tadalafil generic tadalafil 20 mg is there a generic for cialis online cialis purchasing cialis on the internet side effects for cialis side effects for tadalafil side effects of cialis tadalafil tadalafil 20 mg tadalafil 20 mg canadian drug stores tadalafil 20mg tadalafil 20mg lowest price tadalafil 5 mg tadalafil 5mg tadalafil cost at walmart tadalafil dosage tadalafil generic tadalafil generic at walgreens tadalafil generic best prices tadalafil online tadalafil price tadalafil side effects tadalafil tablets tadalafil without a doctor's prescription viagra vs cialis viagra vs cialis vs levitra warnings for tadalafil blue chew viagra scam buy viagra buy viagra online buy viagra online canada pharmacy buy viagra online without script canada pharmacy viagra generic canadian pharcharmy online viagra canadian viagra canadian viagra without a doctor prescription cheap viagra cialis vs viagra cost of viagra female viagra female viagra pills free viagra free viagra samples generic viagra generic viagra 100mg generic viagra available generic viagra canada price generic viagra online pharmacy generic viagra sildenafil citrate generic viagra without a doctor prescription herbal viagra how does viagra work how long does viagra last how much does viagra cost how to take viagra for maximum effect i took viagra mom levitra vs viagra mom gives son viagra natural viagra natural viagra alternatives that work natural viagra substitute nizagara 100 mg vs viagra online viagra online viagra without subscription over the counter viagra real life viagra demonstration revatio vs viagra side effects of viagra sildenafil sildenafil 100mg sildenafil 20 mg sildenafil 20 mg tablet sildenafil 20 mg tablet vs viagra sildenafil citrate sildenafil citrate 100mg sildenafil citrate 20 mg sildenafil coupons sildenafil dosage sildenafil dosage recommendations sildenafil generic sildenafil side effects sophia viagra sophia viagra bikini sophia viagra hot stendra vs viagra stepmom gives son viagra viagra viagra 100mg viagra before after photo actual viagra boner viagra canada online pharmacy viagra coupon viagra coupons viagra coupons from pfizer viagra dosage viagra dosage recommendations viagra erection viagra erection after ejaculation viagra for men viagra for sale viagra for sale on amazon viagra for women viagra generic viagra generic availability viagra generic release date viagra in action viagra on line viagra online viagra online canada pharmacy viagra online pharmacy viagra patent expiration viagra pill viagra pills viagra porn viagra prank viagra prices viagra samples viagra sex viagra side effects viagra substitute viagra vs cialis viagra without a doctor prescription viagra without doctor prescription what is viagra when will generic viagra be available blue chew viagra scam buy viagra buy viagra online buy viagra online canada pharmacy buy viagra online without script canada pharmacy viagra generic canadian pharcharmy online viagra canadian viagra canadian viagra without a doctor prescription cheap viagra cialis vs viagra cost of viagra female viagra female viagra pills free viagra free viagra samples generic viagra generic viagra 100mg generic viagra available generic viagra canada price generic viagra online pharmacy generic viagra sildenafil citrate generic viagra without a doctor prescription herbal viagra how does viagra work how long does viagra last how much does viagra cost how to take viagra for maximum effect i took viagra mom levitra vs viagra mom gives son viagra natural viagra natural viagra alternatives that work natural viagra substitute nizagara 100 mg vs viagra online viagra online viagra without subscription over the counter viagra real life viagra demonstration revatio vs viagra side effects of viagra sildenafil sildenafil 100mg sildenafil 20 mg sildenafil 20 mg tablet sildenafil 20 mg tablet vs viagra sildenafil citrate sildenafil citrate 100mg sildenafil citrate 20 mg sildenafil coupons sildenafil dosage sildenafil dosage recommendations sildenafil generic sildenafil side effects sophia viagra sophia viagra bikini sophia viagra hot stendra vs viagra stepmom gives son viagra viagra viagra 100mg viagra before after photo actual viagra boner viagra canada online pharmacy viagra coupon viagra coupons viagra coupons from pfizer viagra dosage viagra dosage recommendations viagra erection viagra erection after ejaculation viagra for men viagra for sale viagra for sale on amazon viagra for women viagra generic viagra generic availability viagra generic release date viagra in action viagra on line viagra online viagra online canada pharmacy viagra online pharmacy viagra patent expiration viagra pill viagra pills viagra porn viagra prank viagra prices viagra samples viagra sex viagra side effects viagra substitute viagra vs cialis viagra without a doctor prescription viagra without doctor prescription what is viagra when will generic viagra be available $200 cialis coupon 10 mg tadalafil generic 5 mg cialis over the counter at walmart best price for tadalafil 20 mg buy cialis buy cialis generic tadalafil buy cialis online buy cialis online without script buy tadalafil buy tadalafil online canadian cialis online pharmacy canadian pharmacy cialis cheap cialis cheap cialis generic cialis cialis 20 mg best price cialis 20mg cialis 30 day sample cialis 30 day trial coupon cialis and alcohol cialis before and after cialis canada cialis canada pharmacy online cialis cost cialis coupon cialis coupons cialis coupons printable cialis dosage cialis dosage information cialis for daily use cialis for sale cialis free trial cialis free trial voucher for cialis cialis generic cialis generic release date cialis generic tadalafil cialis lowest price cialis online cialis online pharmacy cialis over the counter cialis over the counter at walmart cialis patent expiration date extended cialis picture testimonials cialis pills cialis price cialis prices cialis reviews cialis side effects cialis tadalafil cialis tadalafil 20 mg cialis vs viagra cialis vs viagra which is better cialis without a doctor's prescription cialis without doctor prescription cost of cialis cost of tadalafil generic at walgreens coupon for cialis by manufacturer does cialis lower blood pressure generic cialis generic cialis at walmart generic cialis canada generic cialis canada pharmacy generic cialis from india generic cialis tadalafil generic tadalafil generic tadalafil 20 mg is there a generic for cialis online cialis purchasing cialis on the internet side effects for cialis side effects for tadalafil side effects of cialis tadalafil tadalafil 20 mg tadalafil 20 mg canadian drug stores tadalafil 20mg tadalafil 20mg lowest price tadalafil 5 mg tadalafil 5mg tadalafil cost at walmart tadalafil dosage tadalafil generic tadalafil generic at walgreens tadalafil generic best prices tadalafil online tadalafil price tadalafil side effects tadalafil tablets tadalafil without a doctor's prescription viagra vs cialis viagra vs cialis vs levitra warnings for tadalafil