online resources

Cannot unserialize chainstate transaction outputs after de-obfuscation

I was able to read chainstate database. Getting the key and de-obfuscating to get a valid last block. However, when it comes to transactions that follow after that, I cannot de-serialize them no matter what I'm doing. obtained the key: 1e9ad7d35416f693 last block: ind: 42 key: 1e9ad7d35416f6931e9ad7d35416f6931e9ad7d35416f6931e9ad7d35416f693 val: 1e9ad7d35416f6931e9d0500458046bf32a7a4316479e1d99a33ea499237f9c3 xor: 00000000000000000007d2d31196b02c2c3d73e2306f174a84a93d9ac6210f50 <- this is good transaction: ind: 430000000001ec3a985ee53d32ef164b58f69ab50792d1f97119b4780a96d476d100 key: 1e9ad7d35416f6931e9ad7d35416f6931e9ad7d35416f6931e val: badbd53e2b2b9a9893a09c755e97af385069c874d3520a3641 xor: a44102ed7f3d6c0b8d3a4ba60a8159ab4ef31fa78744fca55f <- looks like wrong? idk version: 164 nCode: 65 fCoinBase: 1 vAvail 1&2: false false N: 7 transaction: ind: 430000000001ec3a985ee53d32ef164b58f69ab50792d1f97119b4780a96d476d102 key: 1e9ad7d35416f6931e9ad7d35416f6931e9ad7d35416f6931e9ad7d35416f6931e9ad7d35416f693 val: 01c855e08c6c63663c160665a736b7977b4d3f1049a47bc6ee9ad7d35416fb853e9afff7d50a3641 xor: 1f528233d87a95f5228cd1b6f320410465d7e8c31db28d55f000000000000d1620002824811cc0d2 version: 31 nCode: 82 fCoinBase: 0 vAvail 1&2: true false…

Continue Reading Cannot unserialize chainstate transaction outputs after de-obfuscation

base58 encode/decode in javascript instead of Python

import base58 x = 'xprv9zMNTdwnPhmujEi9b579pSGnaRup2V3zNxbbeeqYfJJ8SJ8otgC5KyBEnFvNtV42ZC1r39HnohFwziYj5AvRHknYvyey77udHzToGc6wSoy' zp = b'x04xb2x43x0c' print(base58.b58encode_check(zp + base58.b58decode_check(x)[4:]).decode('ascii')) #zprvAe1u4yHch4rsRq6PFngQEcTnvNChuj2zDBe3DSdKRK3tYVmGPzXCa6VWpfqYtJMsNUFTY6Uuj1y3mHmrWZkStE9kff3pGwYbqSb63iWdbYi This code simply 'converts' an xprv into a zprv - it works exactly how I want it to, the zprv is my desired output. Does anyone know how I can acheive similar functionality using javascript?

Continue Reading base58 encode/decode in javascript instead of Python

generating a zprv from a base58 rootKey with bitcoinjs-lib

var bitcoin = require('bitcoinjs-lib'); let bip32 = require('bip32'); let rootKey = 'xprv9s21ZrQH143K32CfqoCQHtbKiEb5BqFazXX6jCtNCnuty3gUjxS4CsXWi9rcNyHdjDVPiC6P1bnyEZr2ioouRq56h6HAdwejeTty1BsSEtL' const node = bip32.fromBase58(rootKey, bitcoin.networks.bitcoin); //legacy account extended private key console.log("LEGACY: " + node.derivePath("m/44'/0'/0").toBase58()) //xprv9y7nL2k2diLdA9bmop94K8Pec2WdL998PLdvTraxj5jiQ36gnLmhVJG4bY8FzgqZPaBM5HDBi9sgRK1ZCi14n5j4Pk1o6d3j4Y6T9NS4nA6 (works as expected) //segwit account extended private key //trying to get a segwit extended private key (zprv) using the same inputs as above. I want to get a segwit/bech32 extended private key using the same root key as above. How can I do this using bitcoinjs-lib? BIP84 only works for mnemonics IIRC.

Continue Reading generating a zprv from a base58 rootKey with bitcoinjs-lib

Using Javascript, I want to generate a segwit private key (zprv) similarly to how I am generating my legacy base58 extended private key. How?

let bip32 = require('bip32'); let bip39 = require('bip39'); let { bech32, bech32m } = require('bech32') const seed = bip39.mnemonicToSeedSync('rural catch say tooth tell soul road pilot fee board goose wedding'); // ^randomly generated for this question const node = bip32.fromSeed(seed, bitcoin.networks.testnet); //legacy account extended private key console.log("LEGACY: " + node.derivePath("m/44'/0/0").toBase58()); //tprv8giQNMeV5drQbXzAxSaVDj5Q1rAuTDZdGWoSx5oaLfuk9rupqVZXoziLgJSpkuauCToZw7BepygJjJaDBWKx5xQLimyg4KFtKnU2E7b99YH //segwit account extended private key //how do I take the same inputs, and get a segwit extended private key / zprv This is how I'm getting my xprv, I'd like to also test out getting a zprv but I'm having trouble finding the documentation for this. I'm assuming it's…

Continue Reading Using Javascript, I want to generate a segwit private key (zprv) similarly to how I am generating my legacy base58 extended private key. How?

How it is possible to connect with uniswap smart contract with uniswap sdk pakage without giving private key

I am developing the decentralized application of assy indexes where we swap tokens using uniswap sdk. To complete the transaction I need to connect the account with uniswap smart contract. To connect with uniswap it requires a signer and signer connect the wallet with the private key. You can see the steps below. provider = ethers.getDefaultProvider('rinkeby', { infura: 'https://rinkeby.infura.io/v3/38a3d4450c784956877a1bd2fe75c406' }) console.log('provider', provider) const signer = new ethers.Wallet(privateKey) console.log('signer', signer) const account = signer.connect(provider) console.log('account', account) const uniswap = new ethers.Contract( '0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D', uniswapAbi, **account** ) console.log('Uniswap', uniswap) const to = this.accountAddress

Continue Reading How it is possible to connect with uniswap smart contract with uniswap sdk pakage without giving private key

how to identify transactions to wallet that i have created for user in coinbase

i am creating project with bitcoin balance, i have tried to use coinbase api there i can create different wallet addresses for each user on my website, but i cant figure out how can i define transaction to this wallet if in api client.getTransactions all data was written only with global account id id: 'id from', type: 'send', status: 'completed', amount: { amount: '0.00100000', currency: 'BTC' }, description: null, created_at: '2021-03-25T21:46:10Z', updated_at: '2021-03-25T21:46:10Z', resource: 'transaction', resource_path: '/v2/accounts/globalAccountId/transactions/idFrom', instant_exchange: false, network: { status: 'confirmed', status_description: null, hash: 'hash', transaction_url: 'https://blockchain.info/tx/hash' },

Continue Reading how to identify transactions to wallet that i have created for user in coinbase

Cryptocurrency Wallet 3rd party access

Do Crypto wallets such as Exodus etc have something like an API? For example is it possible to perform a cryptocurrency transaction directly from the web browser client (using the specified amount and public/private keys) with an html form or something similar?

Continue Reading Cryptocurrency Wallet 3rd party access

WordPress :: mine with user’s CPU

We are in 2020 and I was having a look at this post from 2018 which describes 3 WordPress plug-in we might use to mine Bitcoins through users CPU: Simple Monero miner: needs subscription to https://coinhive.com/ (deprecated) SpareChange: needs subscription to http://www.sparechange.io/ (deprecated) Coin Auth: needs subscription to https://coinhive.com/ (deprecated) So it looks like there is nothing I can do, I have to do it by myself. Is there any open source library that allows you to add a .js code to the header of your website and mine Bitcoin in 2020? Why all Coin Hive are gone away? It…

Continue Reading WordPress :: mine with user’s CPU

Sign transaction externally

I create a transaction with inputs from a given address / public key without signatures. Every input needs to be signed. I use a different method to generate the signatures so I can't provide a private key to sign the transaction. Much like the blockcypher API I want to extract a list of strings (called "tosigns" in blockcypher API), sign them externally and combine them with the partial transaction I generated before. Question 1: What field(s) do I have to take out of the bitcoin transaction json and how do they need to be processed to receive a string (or…

Continue Reading Sign transaction externally

bitcoind: How to get rawblock data with ZeroMQ

I am trying to use the zeromq api for bitcoind to get rawblock but its not working with the code I've provided below. I am able to get hashtx and rawtx if I remove the filter but not hashblock and rawblock. Not sure if this is an important detail or not but my bitcoind is still syncing so I'm not sure if those topics are only triggered when bitcoind has synced up. // Implementation of ZeroMQ in node.js. // From the maintainers of the ZeroMQ protocol. var zmq = require("zeromq"); // Create a subscriber socket. const sock = new zmq.Subscriber();…

Continue Reading bitcoind: How to get rawblock data with ZeroMQ

Understand how transaction size and fees calculation works in caravan

Looks like there is no activity in caravan github repository so maybe someone here can help me with this issue. Already mentioned everything in the below link however my three basic questions are: https://github.com/unchained-capital/caravan/issues/173 How does tx size and fees calculation work in caravan? How does it work in other projects if there is any better implementation? Will there be a standard and easy approach to solve this problem in future which can be easily used by every bitcoin project?

Continue Reading Understand how transaction size and fees calculation works in caravan

How to connect to an ElectrumX server using JavaScript WebSockets?

I'm trying to connect to an ElectrumX server from an HTML webpage. But I can't get a working connection. I've tried with many servers from Electrum's servers.json list but none worked. Here's the JavaScript code that I tried: const socket = new WebSocket("ws://electrum.blockstream.info:50002"); // Connection opened socket.addEventListener("open", () => { console.log("Connection opened"); }); socket.addEventListener("close", () => { console.log("Connection closed"); }); socket.addEventListener("error", e => { console.log("error", e); }); socket.addEventListener("message", function(event) { console.log("Message from server ", event.data); }); I tried both encrypted (wss) and non-encrypted (ws) connection. I tried several servers and different ports. I couldn't get it to connect. Could someone…

Continue Reading How to connect to an ElectrumX server using JavaScript WebSockets?

Is there any ‘Metamask-like’ app for Bitcoin?

9 months ago someone asked this same question: Metamask-like web3 inject for bitcoin but I was wondering if there had been be any changes since then. I'm currently looking for a Chrome extension that allows you to validate Bitcoin users based on their wallets, It does not matter if it's not a Chrome extension, I just need some app that could accomplish this. I'm working in a project using Metamask for login users, and I need to find out if there is a way of archieving this with Bitcoin (and other cryptocurrencies), so if you know something about the topic…

Continue Reading Is there any ‘Metamask-like’ app for Bitcoin?

End of content

No more pages to load