Author

Topic: [ANN][XCP] Counterparty - Pioneering Peer-to-Peer Finance - Official Thread - page 650. (Read 1276928 times)

sr. member
Activity: 321
Merit: 250
What exactly is the proof that address 1CounterpartyXXXXXXXXXXXXXXXUWLpVr cannot have a private key?

Sorry if a stupid question, but I feel that understanding this is important.
sr. member
Activity: 266
Merit: 250
Help and Love one another ♥
I got an invalid symlink at first.
'was sleepy and decided to run bitcoind.
Obvious error that there was not bitcoin.conf, copy pasted the file.
then really didn't wish to copy the 17Go on my crappy computer.
So I renamed ~/.bitcoin in .bitcoin_newuseless
And then firgured out what went wrong with my symlink. (wrong path)
Now the symlink looks absolutely fine.
It links a dot.bitcoin278606 folder on an extHD.
'made sure the bitcoin.conf inside was editted with txindex=1
bitcoind -reindex
and now I'm at block ~12400...

I have a backup of dot.bitcoin278606 on another extHD if it can help.
So I could be back synced up 278606 pretty easilly, but without txindex.
Is that absolutely necessary?    edit: yeah, 'outta gum Wink laugh  so 5sec sleep addict

I think I read burning BTC to get XCP was possible even if bitcoind wasn't sync?! is it? (edit: nope)
The rescan is really painfully slow.
I expected it, but not to this point. Can't skip the -reindex I guess? (edit: nope)

edit 40min later: well, 'block 28k. That's 10%. So the rescan should be done by 12h from now.

Can a given address hold multiple counterparty assets?
Sure, that's the point.
sr. member
Activity: 321
Merit: 250
I guess what I am saying is that it would be nice if there was a listaddresses command, so that one could easily see which of my bitcoin addresses have counterparty assets associated with them.

Right now, the only way I know of to do that is to iterate one-by-one through all addresses in a given bitcoin wallet calling 'counterpartyd address' with each.

Otherwise, one must keep an external list of wallet addresses that hold counterpartyd funds.   This feels klunky.

So instead I would like to be able to call something like counterpartyd listaddresses [asset]

If [asset] is specified it would return a list of all addresses that hold the specified asset.

If [asset] is not specified, it would return a list of all addresses that hold any asset and specify witch asset(s) are associated.

This actually brings up a question in my mind: Can a given address hold multiple counterparty assets?

Question: what if you forget which bitcoin address you used?   I don't see a command equivalent to listtransactions or getinfo in bitcoind.

Quote
counterpartyd --rpc-password=rpcpw1234 address 1CrmTo7Rtk6keeBHbN93B3tAMCm31sG5Tc



In general Bitcoind/-qt takes care of wallet management. Right now, in Counterparty, every log is the same, and Counterparty doesn't keep track of which transactions you make - but we are working to change that.
sr. member
Activity: 476
Merit: 300
Counterparty Chief Scientist and Co-Founder
hum...
I decided to make a clean install from the start (new OS, everything).
I made a symlink to my .bitcoin folder of 17.5Go (synced up block 278606).
I edited my bitcoin.conf with txindex=1
Got me this
Code:
Error: You need to rebuild the databases using -reindex to change -txindex
'fine: bitcoind -reindex
And now I'm back to block 3000...
Does anybody know a way to speedup the process? It's gonna take over a week 24/24h at this speed...
It shouldn't have to resync completely from the start. The 17.5Go are local now.
Help please.

A reindexing is slow, but it shouldn't take that long. Are you sure that you made the symlink properly?
sr. member
Activity: 476
Merit: 300
Counterparty Chief Scientist and Co-Founder
This is really cool stuff.  I'd like to setup a feed on the test net.  Is there someone I could look for some info on how to do that?

Here's the script that I've been using for that feed (to be used with cron):
Code:
import requests
import time
import sqlite3
import os
import logging


logging.basicConfig(filename='LOG', level=logging.INFO,
                        format='%(asctime)s %(message)s',
                        datefmt='%Y-%m-%dT%I:%M:%S%z')
requests_log = logging.getLogger("requests")
requests_log.setLevel(logging.WARNING)

from counterpartyd.lib import (config, broadcast, util, bitcoin)


URL = 'https://api.coindesk.com/v1/bpi/currentprice.json'
response = requests.get(URL).json()
value = response['bpi']['USD']['rate_float']
response_time = int(time.time())

source = 'ADDRESS'
fee_multiplier = round(.0001 * 1e8)
text = 'CoinDesk BPI USD'


RPCUSER = 'bitcoinrpc'
RPCPASSWORD = 'PASSWORD'
RPCCONNECT = 'localhost'
RPCPORT = 18332                # testnet
config.RPC = 'http://'+RPCUSER+':'+RPCPASSWORD+'@'+RPCCONNECT+':'+str(RPCPORT)
config.PREFIX = b'CNTRPRTY'
config.ADDRESSVERSION = b'\x6F' # testnet
config.TESTNET = True           # testnet
config.TESTCOIN = False         # testnet

DATABASE = os.path.join('DATABASE.db')
db = sqlite3.connect(DATABASE)
db.row_factory = sqlite3.Row

util.bitcoind_check(db)
util.database_check(db)

unsigned_tx_hex = broadcast.create(db, source, response_time, value, fee_multiplier, text)
logging.info(bitcoin.transmit(unsigned_tx_hex, ask=False))
sr. member
Activity: 266
Merit: 250
Help and Love one another ♥
hum...
I decided to make a clean install from the start (new OS, everything).
I made a symlink to my .bitcoin folder of 17.5Go (synced up block 278606).
I edited my bitcoin.conf with txindex=1
Got me this
Code:
Error: You need to rebuild the databases using -reindex to change -txindex
'fine: bitcoind -reindex
And now I'm back to block 3000...
Does anybody know a way to speedup the process? It's gonna take over a week 24/24h at this speed...
It shouldn't have to resync completely from the start. The 17.5Go are local now.
Help please.
sr. member
Activity: 390
Merit: 254
Counterparty Developer
Is there any form of mining with XCP, either in the minting of new CXP (which I doubt) or in the form of harvesting transaction fees?

Thanks.

No, and all of the transaction fees are in BTC, except for those paid in XCP to the operators of 'feeds'.

Does that mean we collect fees in BTC by processing XCP transactions or does it go to the normal bitcoin miners?

Also, what about those pain in XCP to the operators of feeds?  Can you please explain a bit more about who that works or provide a link to the documentation about this.

Highly interesting.

The BTC fees go to the normal Bitcoin miners. The address which broadcasts a feed picks a fraction of every bet made on it that it would like to receive in fees. On testnet, for instance, the feed published by mt1N2qE4wHkjdDeumCtRg1NKwxXGMCAx5X takes .01% of every bet made on it, when that bet is matched and settled. So if I bet 100 XCP that the value of that feed, then 100 + (100 * .0001) XCP is deducted from my address, and if/when the bet is settled, .01 XCP goes to mt1N2qE4wHkjdDeumCtRg1NKwxXGMCAx5X.

This is really cool stuff.  I'd like to setup a feed on the test net.  Is there someone I could look for some info on how to do that?

I wrote an additional section to the docs that may help here: http://counterpartyd-build.readthedocs.org/en/latest/AdditionalTopics.html#testing-counterpartyd-on-testnet
sr. member
Activity: 390
Merit: 254
Counterparty Developer
Support for Ubuntu 12.04 LTS added to the build scripts (I had actually been testing with 13.10, but now it works on both). Documentation has been updated to state that Linux support is limited to Ubuntu 12.04 and 13.10 for now.

Pull requests welcome for additional OS support (especially Mac OS)!
legendary
Activity: 1232
Merit: 1001
Is there any form of mining with XCP, either in the minting of new CXP (which I doubt) or in the form of harvesting transaction fees?

Thanks.

No, and all of the transaction fees are in BTC, except for those paid in XCP to the operators of 'feeds'.

Does that mean we collect fees in BTC by processing XCP transactions or does it go to the normal bitcoin miners?

Also, what about those pain in XCP to the operators of feeds?  Can you please explain a bit more about who that works or provide a link to the documentation about this.

Highly interesting.

The BTC fees go to the normal Bitcoin miners. The address which broadcasts a feed picks a fraction of every bet made on it that it would like to receive in fees. On testnet, for instance, the feed published by mt1N2qE4wHkjdDeumCtRg1NKwxXGMCAx5X takes .01% of every bet made on it, when that bet is matched and settled. So if I bet 100 XCP that the value of that feed, then 100 + (100 * .0001) XCP is deducted from my address, and if/when the bet is settled, .01 XCP goes to mt1N2qE4wHkjdDeumCtRg1NKwxXGMCAx5X.

This is really cool stuff.  I'd like to setup a feed on the test net.  Is there someone I could look for some info on how to do that?
sr. member
Activity: 266
Merit: 250
Help and Love one another ♥
bitcoin.conf
erase testnet
member
Activity: 114
Merit: 10
I may have missed something easy, but I followed the instructions here:

http://counterpartyd-build.readthedocs.org/en/latest/SettingUpBitcoind.html

for Windows, and restarted my Bitcoin client and now at the top it says Bitcoin - Wallet [testnet]

I want to burn for real, not on testnet....what did I miss?

Should I just remove "testnet=1" from the last line?  or change it to something else?
sr. member
Activity: 476
Merit: 300
Counterparty Chief Scientist and Co-Founder
Is there any form of mining with XCP, either in the minting of new CXP (which I doubt) or in the form of harvesting transaction fees?

Thanks.

No, and all of the transaction fees are in BTC, except for those paid in XCP to the operators of 'feeds'.

Does that mean we collect fees in BTC by processing XCP transactions or does it go to the normal bitcoin miners?

Also, what about those pain in XCP to the operators of feeds?  Can you please explain a bit more about who that works or provide a link to the documentation about this.

Highly interesting.

The BTC fees go to the normal Bitcoin miners. The address which broadcasts a feed picks a fraction of every bet made on it that it would like to receive in fees. On testnet, for instance, the feed published by mt1N2qE4wHkjdDeumCtRg1NKwxXGMCAx5X takes .01% of every bet made on it, when that bet is matched and settled. So if I bet 100 XCP that the value of that feed, then 100 + (100 * .0001) XCP is deducted from my address, and if/when the bet is settled, .01 XCP goes to mt1N2qE4wHkjdDeumCtRg1NKwxXGMCAx5X.
full member
Activity: 216
Merit: 100
Question: what if you forget which bitcoin address you used?   I don't see a command equivalent to listtransactions or getinfo in bitcoind.

Quote
counterpartyd --rpc-password=rpcpw1234 address 1CrmTo7Rtk6keeBHbN93B3tAMCm31sG5Tc



In general Bitcoind/-qt takes care of wallet management. Right now, in Counterparty, every log is the same, and Counterparty doesn't keep track of which transactions you make - but we are working to change that.
legendary
Activity: 1232
Merit: 1001
Is there any form of mining with XCP, either in the minting of new CXP (which I doubt) or in the form of harvesting transaction fees?

Thanks.

No, and all of the transaction fees are in BTC, except for those paid in XCP to the operators of 'feeds'.

Does that mean we collect fees in BTC by processing XCP transactions or does it go to the normal bitcoin miners?

Also, what about those pain in XCP to the operators of feeds?  Can you please explain a bit more about who that works or provide a link to the documentation about this.

Highly interesting.
sr. member
Activity: 476
Merit: 300
Counterparty Chief Scientist and Co-Founder
Yes, you can. counterpartyd will try to warn you if you attempt to burn more than 1 BTC (but if the first burn still isn't confirmed, it might not catch the error!). The fee paid for every Counterparty transaction is 10000 satoshis, as none of them is over a KB.

Do the funds have to all come from the same BTC address?

That is, I have a btw address xfoo...

I TX 0.001 BTX to xfoo...

I counterpartyd burn --from=xfoo.. --quantity=0.0099 [paying the 10,000 satoshi (aka 0.0001 BTC) fee]

So far burned 0.0099

I TX 0.9902 BTX to xfoo...

I counterpartyd burn --from=xfoo.. --quantity=0.9901 [paying the 10,000 satoshi (aka 0.0001 BTC) fee]

So far burned 1.0 BTC

Is this find to do?  Does it all add up correctly?

All good?

Can anyone confirm the above proceedure is fine?

Also, how many confirmations must I want on BTC transfer?


That looks correct, yes.

One confirmation.
legendary
Activity: 1232
Merit: 1001
Yes, you can. counterpartyd will try to warn you if you attempt to burn more than 1 BTC (but if the first burn still isn't confirmed, it might not catch the error!). The fee paid for every Counterparty transaction is 10000 satoshis, as none of them is over a KB.

Do the funds have to all come from the same BTC address?

That is, I have a btw address xfoo...

I TX 0.001 BTX to xfoo...

I counterpartyd burn --from=xfoo.. --quantity=0.0099 [paying the 10,000 satoshi (aka 0.0001 BTC) fee]

So far burned 0.0099

I TX 0.9902 BTX to xfoo...

I counterpartyd burn --from=xfoo.. --quantity=0.9901 [paying the 10,000 satoshi (aka 0.0001 BTC) fee]

So far burned 1.0 BTC

Is this find to do?  Does it all add up correctly?

All good?


Can anyone confirm the above proceedure is fine?

Also, how many confirmations must I want on BTC transfer?

sr. member
Activity: 321
Merit: 250
Question: what if you forget which bitcoin address you used?   I don't see a command equivalent to listtransactions or getinfo in bitcoind.

Quote
counterpartyd --rpc-password=rpcpw1234 address 1CrmTo7Rtk6keeBHbN93B3tAMCm31sG5Tc

sr. member
Activity: 476
Merit: 300
Counterparty Chief Scientist and Co-Founder
Success, finally!

Quote
$ ./counterpartyd.py  --rpc-password=$BTCPASS burn --from=15GzM24gRpNHqPvLJGqWkGMwzQzf8giqJf --quantity=0.00121056
Confirm? (y/N) y
"d9784b362d3a16bfb587a068ca0209b4d7735c24f774d984894e62accd0db2e1"

It required this patch.

Quote
$ git diff
diff --git a/lib/bitcoin.py b/lib/bitcoin.py
index c61636b..6d8ed5e 100644
--- a/lib/bitcoin.py
+++ b/lib/bitcoin.py
@@ -111,7 +111,7 @@ def serialise (inputs, destination_output=None, data_output=None, change_output=
     # List of Inputs.
     for i in range(len(inputs)):
         txin = inputs
-        s += binascii.unhexlify(txin['txid'])[::-1]         # TxOutHash
+        s += binascii.unhexlify(bytes(txin['txid'], 'UTF-8'))[::-1]         # TxOutHash
         s += txin['vout'].to_bytes(4, byteorder='little')   # TxOutIndex
 
         # No signature.
diff --git a/lib/blocks.py b/lib/blocks.py
index 7a9985b..827a0d6 100644
--- a/lib/blocks.py
+++ b/lib/blocks.py
@@ -316,7 +316,7 @@ def get_tx_info (tx):
         if not data:
             asm = vout['scriptPubKey']['asm'].split(' ')
             if asm[0] == 'OP_RETURN' and len(asm) == 2:
-                data = binascii.unhexlify(asm[1])
+                data = binascii.unhexlify(bytes(asm[1], 'UTF-8'))
 
     # Only look for source if data were found (or destination is UNSPENDABLE), for speed.
     if not data and destination != config.UNSPENDABLE:

devs, please audit/fix all instances of binascii.unhexlify.  grep finds more of them.

Quote
lib/bitcoin.py:    res = binascii.unhexlify(h.encode('utf8'))
lib/bitcoin.py:        s += binascii.unhexlify(bytes(txin['txid'], 'UTF-8'))[::-1]         # TxOutHash
lib/blocks.py:                data = binascii.unhexlify(bytes(asm[1], 'UTF-8'))
lib/cancel.py:    offer_hash_bytes = binascii.unhexlify(offer_hash)
lib/btcpay.py:    tx0_hash_bytes, tx1_hash_bytes = binascii.unhexlify(tx0_hash), binascii.unhexlify(tx1_hash)
test/test_.py:                data = binascii.unhexlify(asm[1])

Way ahead of you Wink. Thanks for the reminder, though!
legendary
Activity: 1232
Merit: 1001
xibeijan, how did you get around the 'label empty or too long' error?

I had an old version of the requests library.  I think it was 0.12.1

I upgraded to version 2.1.0
full member
Activity: 221
Merit: 100
Quote
counterpartyd --rpc-password=rpcpw1234 burn --from=1EFU6nkG4y9BmrBTZd4VPu1cF7AwR3qYrN --quantity=0.01

Quote
counterpartyd --rpc-password=rpcpw1234 address 1CrmTo7Rtk6keeBHbN93B3tAMCm31sG5Tc

Why do you use two different addresses?


Oops...ignore the two different address...you would need to use the same address ofcourse!
Didnt notice i had switched the address. Thx for catching that. Will get that fixed.
Jump to: