Hot answers tagged

4

This is valid, and there are even smaller types as well. Be aware that Bitcoin no longer really uses ASN.1 DER, but a even more restrictive subset of it. ASN.1 itself as it turns out is not deterministic or platform independent in many implementations, which is a source of consensus failure. For reference, here is how to encode signatures correctly in ...


3

Ardor time is measured in seconds since the Genesis block, represented as Java int. Currently there is no API which performs conversion to Unix time so you have to code it yourself. If you are coding a server side contract in Java use the following code: long EPOCH_BEGINNING = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z").parse(isTestnet ? "2017-12-26 14:...


1

Your signatures don't verify because in JCE you are using algorithm SHA256withECDSA which hashes the supplied data (re-hashes, since you are supplying a hash) before doing the kG.x,kinv(h+rd) computation, or the similar verification computation, whereas the spongy/bouncy ECDSASigner used in bitcoinj only does the latter, assuming the input is already the ...


1

With java? Sign it with the program that created the raw transaction, bitcoin-cli. If the wallet is synced using signrawtransactionwithwallet If want to input the private key or the wallet is not synced and knowing the private key: Using signrawtransactionwithkey (0.17.0 RPC) signrawtransactionwithkey "hexstring" ["privatekey1",...] ( [{"txid":"id","vout":...


1

A couple comments from inspecting the Transaction data you posted. 1) I checked the UTXO you are spending from, which is UTXO 9e7562d19165077d566af47bfbc18283629ed6799da8862660dfb037c353de11 Index 0 However, your transaction input is currently referencing the following UTXO: c33858b433ef445db35a84daa4da772895df7f03af4b31f21cfa199ea1c017d9 Index 0 Which ...


1

In case some one want to implements compression in their code: private static final String EVEN = "02"; private static final String ODD = "03"; public String compressPublicKey(String toCompress) { if (Integer.parseInt(toCompress.substring(128, 130), 16) % 2 == 0) return EVEN + toCompress.substring(2, 66); return ODD + toCompress.substring(...


Only top voted, non community-wiki answers of a minimum length are eligible