Bitcoin Forum
July 25, 2024, 12:24:20 AM *
News: Help 1Dq create 15th anniversary forum artwork.
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 3 4 »
1  Alternate cryptocurrencies / Altcoin Discussion / Re: Get a mnemonic from a private Key Eth address on: May 02, 2017, 09:15:47 PM
OK, since I start from scratch, I can generate the mnemonic and then the private key.
Is there a library for that ?
2  Alternate cryptocurrencies / Altcoin Discussion / Re: Get a mnemonic from a private Key Eth address on: May 02, 2017, 08:47:37 PM
Hi, I have the same problem.

With bitcore-mnemonic, the library generate the mnemonic for an extended private key.

According to
https://www.ethnews.com/jaxx-to-abandon-ethereum-hierarchical-deterministic-structure-and-embrace-more-erc20-tokens
I don't want to use an HDWallet for Ethereum.

So, is there a way to generate the mnemonic from a private key (not extended) ?
3  Bitcoin / Development & Technical Discussion / Re: RFC: proposition to extend BIP44 - extended HD Wallet on: April 20, 2016, 09:20:30 PM
Quote
Are you implying that "current_account" can access the keys of restaurants, beers, and food, in order to present a summary balance for all three?
Yes: All parent wallets have full access to all their child wallets and the balance will be the sum of itself and all its childs.
Quote
But then what if I try to make a spend from "current account"?  Does it use a key from restaurants, or from beers, or from food, or from itself?
from itself: the account's path for "current account" is /0'/0'/
so this account will use addresses like /0'/0'/change/address_index
Since the owner of "current_account" has full access to its childs he can indicate to use a child wallet to pay for restaurants.
Then the wallet will use the corresponding path for "current_account/restaurants": /0'/0'/0'/change/address_index
Quote
what if "current account" does not have any keys with funds but "beers" does?
In this specific case, the user will have to transfert money from one account to another involving a Tx in the blockchain.
This is not a very good example since the application can provide a simple way to give a tag to a Tx (you're right on this point:  it has nothing to do with bip44).

But let say you own few businesses: you create a sub wallet for each and you give the corresponding private key (and chain code)
to the managers so they can do any Tx they need and it is also possible for them to derive and create any child keys and wallets. They have no access to any parent wallets.
As the owner, you keep the total control over all sub wallets and you can have an instant financial report of all Tx. That's the aim of my proposition.

Thanks for your comments, I always appreciate
4  Bitcoin / Development & Technical Discussion / RFC: proposition to extend BIP44 - extended HD Wallet on: April 20, 2016, 03:07:09 PM
I would like to here your comments about this proposition:

from BIP44: Multi-Account Hierarchy for Deterministic Wallets

Code:
We define the following 5 levels in BIP32 path:
m / purpose' / coin_type' / account' / change / address_index

With this definition, a (single) wallet can have multiple accounts:
account' = 0', 1', 2', ...

I'm working on a new wallet and I would like to have a full hierarchy a wallets
where
Code:
/account'/
will be replaced by a multiple level of wallets (all with hardened derivation)
Code:
/master wallet n'/sub wallet m'/.../sub wallet p'/
Something like this:
Code:
-- personnal wallet                      /0'/
    -- current account                   /0'/0'/
        -- restaurants                   /0'/0'/0'/
        -- beers                         /0'/0'/1'/
        -- food                          /0'/0'/2'/
    -- saving account                    /0'/1'/
        -- retirement                    /0'/1'/0'/
        -- next summer vacation          /0'/1'/1'/
        -- income taxes                  /0'/1'/2'/
    -- house expenditure                 /0'/2'/
    -- donations                         /0'/3'/
    -- kid's school                      /0'/4'/
-- personnal business                    /1'/
    -- North America                     /1'/0'/
        -- USA                           /1'/0'/0'/
            -- ...                       ...
        -- Canada                        /1'/1'/
            -- Quebec                    /1'/1'/0'/
                -- Montreal              /1'/1'/0'/0'/
                    -- 00 Ste-Catherine  /1'/1'/0'/0'/0'/
                    -- 99 St-Denis       /1'/1'/0'/0'/1'/
            -- British Colombia          /1'/1'/1'/
-- Joint account (with wife)             /2'/
    -- lawyers                           /2'/0'/
This proposition can be seen as an extension of a Multi-Account Hierarchy for Deterministic Wallets (BIP44).
An HD Wallet implementing BIP44 will be considered as containing only one master wallet /0'/
and will be compatible with this proposition. That's why I call it "Multi-Account Hierarchy for extended Deterministic Wallets"
or simply "extended HD Wallet" or "xHD Wallet".

5  Bitcoin / Development & Technical Discussion / BIP47 - Reusable Payment Codes - compute Shared Secret for Notification Tx on: April 13, 2016, 09:12:46 PM
From BIP47        : https://github.com/bitcoin/bips/blob/master/bip-0047.mediawiki
and  test vectors : https://gist.github.com/SamouraiDev/6aad669604c5930864bd

I would like to compute the shared secret from the test vectors:

If I follow the BIP47 protocol:

0) It is assumed that Alice can easily obtain Bob's payment code via a suitable method outside the scope of the payment code protocol.

So Alice knows Bob's Payment Code:
Code:
PC_BOB = PM8TJS2JxQ5ztXUpBBRnpTbcUXbUHy2T1abfrb3KkAAtMEGNbey4oumH7Hc578WgQJhPjBxteQ5GHHToTYHE3A1w6p7tU6KSoFmWBVbFGjKPisZDbP97
Then Alice unserialize PC_BOB and can find Bob's pubkey and chain code  (path : m/47'/0'/0')
Code:
pubkey     : (02) 9d125e1cb89e5a1a108192643ee25370c2e75c192b10aac18de8d5a09b5f48d5
Chain Code :      1db1243aaa57c7fbea3072249c1bd4dab9482b4fee4d25e1c69707e8144dc137
1) Alice select an input...
2.i) Alice selects the private key corresponding to the first exposed public key, of the first pubkey-exposing input, of the transaction:
I tried with
Code:
a0 = 8d6a8ecd8ee5e0042ad0cb56e3a971c760b5145c3917a8e7beaf0ed92d7a520c  path  m/47'/0'/0'/0
ao is given in the paper. It gave me the wrong shared secret, I also tried with
Code:
a  = 0a5c1795378b3ba756efcb5ca47e605c3f4f8bcff99eced897b45a4b051e980d  path m/47'/0'/0'
with a wrong result again ("a" can be computed form the raw entropy)
Which value should I use for Alice private key ?
2.ii)
Alice selects the public key associated with Bob's notification address:
This address is given in the paper:
Code:
B = 024ce8e3b04ea205ff49f529950616c3db615b1e37753858cc60c1ce64d17e2ad8 (= B0) path: m/47'/0'/0'/0
2.iii) Alice calculates a secret point:
Code:
S = a B = 736a25d9250238ad64ed5da03450c6a3f4f8f4dcdf0b58d1ed69029d76ead48d
I think the value of B is correct but what should I take for a ?
6  Bitcoin / Development & Technical Discussion / Re: BIP 32 - Find xprv from seed and passphrase (bitcore-mnemonic) on: April 12, 2016, 01:29:16 PM
You're right: I want to do exactly this: given seed and passphrase: get xpriv

from BIP32: https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
Code:
Master key generation:
Generate a seed byte sequence S of a chosen length (between 128 and 512 bits; 256 bits is advised) from a (P)RNG.
Calculate I = HMAC-SHA512(Key = "Bitcoin seed", Data = S)
Split I into two 32-byte sequences, I_L and I_R.
Use parse256(I_L) as master secret key, and I_R as master chain code.
xpriv is essentially a serialization of the master secret key (I_L) and the master chain code (I_R).

So the function you gave me seems the right one BUT I have 2 problems:

1) if I do in node.js

var Mnemonic = require('bitcore-mnemonic');
var bitcore = require('bitcore');

I have the following error:
Code:
Error: More than one instance of bitcore found with versions: v0.13.4 and v0.13.14.
Please make sure to require bitcore and check that submodules do not also include their own bitcore dependency.
2) I don't understand the keyword "prototype" so I can't try your function.
Can you please indicate me how can I can use this function in my code
7  Bitcoin / Development & Technical Discussion / BIP 32 - Find xprv from seed and passphrase (bitcore-mnemonic) on: April 11, 2016, 07:19:05 PM
from BIP 47:  https://github.com/trezor/python-mnemonic/blob/master/vectors.json
Code:
passphrase = "TREZOR";
entropy = "00000000000000000000000000000000";
code    = "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about";
seed    = "c55257c360c07c72029aebc1b53c05ed0362ada38ead3e3e9efa3708e53495531f09a6987599d18264c1e1c92f2cf141630c7a3c4ab7c81b2f001698e7463b04";
xprv    = "xprv9s21ZrQH143K3h3fDYiay8mocZ3afhfULfb5GX8kCBdno77K4HiA15Tg23wpbeF1pLfs1c5SPmYHrEpTuuRhxMwvKDwqdKiGJS9XFKzUsAF";
from entropy and passphrase, I can find code, seed and xprv with bitcore-mnemonic (node.js):
Code:
var Mnemonic = require('bitcore-mnemonic');
mnemonic   = Mnemonic._entropy2mnemonic(new Buffer(entropy, 'hex'), Mnemonic.Words.ENGLISH);
customCode = new Mnemonic(mnemonic);
theSeed    = customCode.toSeed(passphrase);
xprv       = customCode.toHDPrivateKey(passphrase);

Now I would like to use "seed" in BIP 32 with passphrase and find xprv (and mnemonic?) with bitcore-mnemonic.
Is there a way to do that ?
8  Bitcoin / Development & Technical Discussion / BIP47 - Reusable Payment Codes - Notification Tx on: February 24, 2016, 03:04:47 PM
From BIP47 on mediawiki:
https://github.com/bitcoin/bips/blob/master/bip-0047.mediawiki
step 3 of the notification tx:
Quote
3. Alice serializes her payment code in binary form.
According the Binary Serialization on the same page,
the Payment Code is essentially Alice's pubkey (A = a * G) and Alice's Chain Code(c)
in the next step:
Quote
4. Alice renders her payment code (P) unreadable to anyone except Bob:
  i. Replace the x value with x':
The problem is x is the x coordinate of the secret point S = a * B = (x, y)
where a is Alice's privatekey and B is Bob's publickey point (B = b * G)
Question: even if I replace x by x', it won't change the value of the Payment Code
since x is not involved in this value !
What I'm missing ?
9  Bitcoin / Development & Technical Discussion / Reusable Payment Codes: How to compute Payment Code from HD Wallet private key on: February 22, 2016, 06:27:03 PM
I would like to extract the chain code from an extended private key (BIP32)
and compute the Payment code to implement Reusable Payment Codes (BIP47)

I will use the 2 test vectors from BIP32 mediawiki (HD Wallet):
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki

Test Vector 1:

Code:
prvkey = xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi

base58Check to string hex:

Code:
prvkey = 0488ade4000000000000000000873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d50800e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35e77e9d71

from the serialization format info on the same page, I can extract:

Code:
chain code  : 873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d508
private key : e8f32e723decf4051aefac8e2c93c9c5b214313817cdb01a1494b917c8436b35

And I can calculate the public key:
Code:
public key  : 0339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2
If I do the same with the pubkey (xpub...), I get the same chain code which is what I should obtain.

Test Vector 2:

Code:
prvkey = xprv9s21ZrQH143K31xYSDQpPDxsXRTUcvj2iNHm5NUtrGiGG5e2DtALGdso3pGz6ssrdK4PFmM8NSpSBHNqPqm55Qn3LqFtT2emdEXVYsCzC2U

Code:
chain code : 60499f801b896d83179a4374aeb7822aaeaceaa0db1f85ee3e904c4defbd9689
private key: 4b03d6fc340455b363f51020ad3ecca4f0850280cf436c70c727923f6db46c3e
public key : 03cbcaa9c98c877a26977d00825c956a238e8dddfbd322cce4f74b0b5bd6ace4a7


The next step is to create the Payment Code:

I will follow BIP47 mediawiki (binary serialization):
https://github.com/bitcoin/bips/blob/master/bip-0047.mediawiki

1)    Byte 0: version. required value: 0x01
2)    Byte 1: features bit field. All bits must be zero except where specified elsewhere in this specification
          Bit 0: Bitmessage notification
          Bits 1-7: reserved
3)    Byte 2: sign. required value: 0x02 or 0x03
4)    Bytes 3 - 34: x value, must be a member of the secp256k1 group
5)    Bytes 35 - 66: chain code
6)    Bytes 67 - 79: reserved for future expansion, zero-filled unless otherwise noted

Test vector 1:

Code:
1) 01
2) 00
3) 03
4) 39a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2
5) 873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d508
6) 00000000000000000000000000

Code:
string1 : 01000339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d50800000000000000000000000000

Base58 Serialization

checksum = SHA256(SHA256(string1))
checkSum = 20A4FA8F1BDFA6D0AC185F5F5F5DF9A50F5183C3492D2102038FCF7F5A83878F
checkSum = 20a4fa8f

version byte = 47

Code:
string1: 4701000339a36013301597daef41fbe593a02cc513d0b55527ec2df1050e2e8ff49c85c2873dff81c02f525623fd1fe5167eac3a55a049de3d314bb42ee227ffed37d5080000000000000000000000000020a4fa8f

string hex to base58Check :
Code:
PaymentCode: PM8TJZZ58ujgBFcwn2ii56ZDPVBmRTXqNBgqaRPhrqEaooQYKgsAUMkjmaXybz4zpMNVwgXSndvNNz7WTxFayVfbQQBCRroXqiN8tGMvJt9PaTwADf5Y


for test vector 2:

Code:
PaymentCode: PM8TJganX13rAQB9ZwomHFc8y8k8SoKJrgywreocjKE27Zjg3W72QVnyryaZzjknJXB7czkEufZC8QdRirThhETbQ4yCRb5QfGx1xYnn8ULN6URxrxox

I would like to know if those Payment Codes are correct.
10  Bitcoin / Bitcoin Technical Support / Re: watch new Tx in mempool (testnet) on: January 08, 2016, 04:18:46 PM
UPDATE: no answer ?
11  Bitcoin / Bitcoin Technical Support / watch new Tx in mempool (testnet) on: December 17, 2015, 02:00:21 PM
I'm developping a wallet and I want to listen to the mempool (testnet) for incoming transactions.
I run a node on the same computer so I ping bitcoind every 1 sec with getmempoolinfo.

If getmempoolinfo.size is greater that 1 sec ago, it means there is at least one new transaction
in the mempool, then I get the array of all Tx in the mempool with getrawmempool.

My question : It seems that the new Tx hash is inserted anywhere in the array.
Is there a way to avoid comparing the old rawmempool (~ 1000 Tx) with the new rawmempool
to figure which Tx are new ? Or: why the new Tx are not append at the end
or at the beginning of the array ?
12  Bitcoin / Bitcoin Technical Support / Re: createrawtransaction: Invalid private key on: November 23, 2015, 07:09:38 PM
UPDATE:

instead of:
Code:
bitcore.Networks.defaultNetwork = 'testnet'; WRONG
use:
Code:
bitcore.Networks.defaultNetwork = bitcore.Networks.testnet;
The private now is OK (starts with "c").
13  Bitcoin / Bitcoin Technical Support / Re: createrawtransaction: Invalid private key on: November 19, 2015, 09:31:56 PM
OK, Thanks a lot

I have to figure what's wrong with my bitcore module...
14  Bitcoin / Bitcoin Technical Support / Re: createrawtransaction: Invalid private key on: November 19, 2015, 09:20:45 PM
I made 2 tests with bitaddress.org (livenet)

<privkey> WIF = 5JoVxXdyoVFPaVL4xHQUvdb8vVRDFCdeh8A16fodXMiYKmrgtCu
<pubkey>        = 1KLgFamwn7cm1qQSnuFVuYw99dmWUVZC9b

<privkey> WIF = 5K1xnQXX5d1xVaRab75HbLT6oPejddN1eUdesL8epMdjRgHVuqG
<pubkey>       = 1Npcxoh99nGGf829uJhvMWan4vUbTzfi9y

If I understand well, the private key is the same in livenet and tesnet:
the private key is just a ramdom number and the WIF format will
also be the same.

Then we calculate the <pubkey> by adding points on a elliptic curve,
so the pubkey is a pair of coordinates (x,y). Then we write the pubkey
like "04 x y" OR "02 x" (if y is positive) OR "03 x" (if y is negative).
It is only when we create the base-58 pubkey that we use a different
format so the pubkeys looks different in testnet and livenet.

Is it correct ? 
15  Bitcoin / Bitcoin Technical Support / Re: createrawtransaction: Invalid private key on: November 19, 2015, 08:38:52 PM
OK but here is a simple example:

Code:
bitcore = require('bitcore');
bitcore.Networks.defaultNetwork = 'testnet';
var privateKey = new bitcore.PrivateKey();
console.log('privateKey: ' + privateKey);
var exported = privateKey.toWIF();
console.log('privateKey toWIF: ' + exported);
and the output is:
Code:
privateKey:       13421db757900dae2ecd471b2cca0d950f8ca47fd867e3c44dadd64f57194252
privateKey toWIF: 1eSGCW9EJ8pUZ6QEpa3385at83n3hdXrJ57VpmmFQRSv3JcMVHW
16  Bitcoin / Bitcoin Technical Support / Re: createrawtransaction: Invalid private key on: November 19, 2015, 07:56:12 PM
Quote
Where did you get the private keys?
It has been generated by bitcore (node.js), for testnet.
Code:
var privateKey = new bitcore.PrivateKey();
the key has 64 char
the WIF format is 14xCi3eQ3AJvk...xyEQRooQNv1GGQSb
and has 52 char
17  Bitcoin / Bitcoin Technical Support / Re: createrawtransaction: Invalid private key on: November 19, 2015, 07:37:11 PM
From the developer doc:
Quote
signrawtransaction <hex string> [{"txid":txid,"vout":n,"scriptPubKey":hex},...] [<privatekey1>,...] [sighash="ALL"]

Sign as many inputs as possible for raw transaction (serialized, hex-encoded).
1)
Quote
The first argument may be several variations of the same transaction concatenated together;
signatures from all of them will be combined together, along with signatures for keys in the local wallet.
I want to spend only 1 output which needs only 1 signature (P2PK):
My first argument is the result of:
Code:
createrawtransaction '[{"txid":"5fbce786b0bd9f46e0511a5e8091d57900e2eb5d4132375aada3e964a75e6ca5","vout":0}]'
 '{"2NCo1Y7JJgLabJ5AQjBpgavyX1JLWJxGPYK":0.005, "n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu":0.004}'

-->  "0100000001a56c5ea764e9a3ad5a3732415debe20079d591805e1a51e0469fbdb086e7bc5f00000 00000ffffffff0260e316000000000017a91
4d66d4e8e58f8e1457fd3c3dff2def8f7075fa77887801a0600000000001976a914e7c6286efb87 30ef8211964f5046e0a0e3568bf788ac00000000"

2)
Quote
The optional second argument is an array of parent transaction outputs,
so you can create a chain of raw transactions that depend on each other before sending them to the network
This argument is optionnal: I only have 1 tx with 1 input, not a chain
(the parent tx is confirmed, I don't have a chain of tx to include in the same block)
the second argument is empty:

--> '[]'

Just to make sure: I tried with the previous tx output with no difference:
'[{"txid":"5fbce786b0bd9f46e0511a5e8091d57900e2eb5d4132375aada3e964a75e6ca5","vout":"0","scriptPubKey":"76a914e7c6286efb8730ef8211964f5046e0a0e3568bf788ac"}]'

3)
Quote
Third optional argument is an array of base58-encoded private keys that,
if given, will be the only keys used to sign the transaction.
the previous output is a simple array of one private Key (P2PK) corresponding to n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu
since I don't use the bitcoind wallet, I MUST give this private Key (it's not in the wallet)
this private key should be in base-58

--> '["14xCi3eQ3AJvk...xyEQRooQNv1GGQSb"]'

4)
Quote
The fourth optional argument is a string that specifies how the signature hash
is computed, and can be "ALL", "NONE", "SINGLE", "ALL|ANYONECANPAY", "NONE|ANYONECANPAY", or "SINGLE|ANYONECANPAY".
I'm not sure about this one, If i try anything ("ALL", "NONE", "SINGLE"),
I still have the "Invalid private key" error
The default value is sighash="ALL" so this last argument is empty

The final command is the same as in my first post but with the base-58 private key: 14xCi3eQ3AJvk...xyEQRooQNv1GGQSb
with the same error: "Invalid private key (code -5)"
Code:
signrawtransaction "0100000001a56c5ea764e9a3ad5a3732415debe20079d591805e1a51e0469fbdb086e7bc5f0000000000ffffffff0260e316000000000017a914d66d4e8e58f8e1457fd3c3dff2def8f7075fa77887801a0600000000001976a914e7c6286efb8730ef8211964f5046e0a0e3568bf788ac00000000"
'[]' '["14xCi3eQ3AJvk...xyEQRooQNv1GGQSb"]'
I don't see what my problem is.
18  Bitcoin / Bitcoin Technical Support / createrawtransaction: Invalid private key on: November 19, 2015, 05:43:57 PM
I want to spend 0.01 tBTC from vout 0 of txid 5fbce786b0bd9f46e0511a5e8091d57900e2eb5d4132375aada3e964a75e6ca5
on testnet

from: n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu (0.01 tBTC)

to:     0.005 tBTC -> 2NCo1Y7JJgLabJ5AQjBpgavyX1JLWJxGPYK
change: 0.004 tBTC -> n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu
fees:   0.001 tBTC

Code:
createrawtransaction '[{"txid":"5fbce786b0bd9f46e0511a5e8091d57900e2eb5d4132375aada3e964a75e6ca5","vout":0}]'
 '{"2NCo1Y7JJgLabJ5AQjBpgavyX1JLWJxGPYK":0.005, "n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu":0.004}'

output:
0100000001a56c5ea764e9a3ad5a3732415debe20079d591805e1a51e0469fbdb086e7bc5f0000
000000ffffffff0220a107000000000017a914d66d4e8e58f8e1457fd3c3dff2def8f7075fa778
87801a0600000000001976a914e7c6286efb8730ef8211964f5046e0a0e3568bf788ac00000000

the problem is when I try to sign that tx:

Code:
signrawtransaction "0100000001a56c5e...211964f5046e0a0e3568bf788ac00000000"
'[]' '["75e8fd535e581ba...12e23500a96ee675"]'

output:  Invalid private key (code -5)

I also tried with WIF format: 14xCi3eQ3AJvk...xyEQRooQNv1GGQSb
with the same output...

what's wrong ?
If I don't use the wallet of bitcoind, should I provide the "scriptPubKey"
and the redeemScript ? If yes, it's easy to find the scriptPubKey in the previous
tx but how do I create the redeemScript ?


to verify that my private Key is valid, I tested it with bitcore (node.js):

Code:
bitcore = require('bitcore');
bitcore.Networks.defaultNetwork = 'testnet';

var privateKey = new bitcore.PrivateKey('75e8fd535e581ba...12e23500a96ee675');
console.log('privateKey: ' + privateKey);          // 75e8fd535e581ba...12e23500a96ee675
var exported = privateKey.toWIF();         
console.log('exported privateKey: ' + exported);   // 14xCi3eQ3AJvk...xyEQRooQNv1GGQSb
var publicKey = privateKey.toPublicKey();
console.log('publicKey: ' + publicKey);            // 03f0435d4a6284...c14d33566929584990
var addressTest = publicKey.toAddress(bitcore.Networks.testnet);
console.log('address testnet: ' + addressTest);     // n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu  <-- OK
19  Bitcoin / Bitcoin Technical Support / pubkeyhash vs scripthash with createrawtransaction on: November 18, 2015, 04:50:16 PM
I want to create a new wallet without using the bitcoind wallet.
I have created a testnet wallet on blocktrail.com so I use
pubkeys from blocktrail and from bitcore package (node.js).

pubkey generated by bitcore:    n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu
pubkey generated by blocktrail: 2NCo1Y7JJgLabJ5AQjBpgavyX1JLWJxGPYK

my transaction: from n2e... to 2NC... change back to n2e...

When I do a createrawtransaction I have two different types of scriptPubKey:

n2eTmd37KTGhRZNJsf9tfVdCG1YejciETu:     pubkeyhash  (bitcore)
2NCo1Y7JJgLabJ5AQjBpgavyX1JLWJxGPYK:  scripthash     (blocktrail)

My question: why I have a scripthash from blocktrail ?

What I think the answer is:
quote from blocktrail: "The BlockTrail Payment API is built using Multi-Signature HD Wallets, this means that there are 3 keys in total, 2 of which are necessary to get access to your Bitcoin!" (primary key, backup key and blocktrail key)
so instead of paying to a single pubkey, I must pay to a scripthash representing 2 out of 3 signatures.

Is it correct ? or there is another reason ?
20  Bitcoin / Bitcoin Technical Support / Re: bitcoind: getrawtransaction: No information available on: October 21, 2015, 07:07:12 PM
Thanks  Smiley
Pages: [1] 2 3 4 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!