Bitcoin Forum
April 26, 2024, 05:40:12 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 ... 126 »
  Print  
Author Topic: [ANN][FLO] A Worldwide Public Record | Alexandria | ETDB | Medici | 0.15 Segwit  (Read 515901 times)
coinerd
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
June 21, 2013, 09:32:58 PM
 #121


Code:
function hex2str($hex) {
    for($i=0;$i<strlen($hex);$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));
    $str=substr($str, strpos($str, 'text:'));
    return $str;
}

Also, I sent you a PM. Please respond when you can Smiley


That's almost exactly what I used to make the conversion.  Most of the data just coimes out as gibberish it's not useful ASCII values.

that and a preg_split will catch the messages, so far.

If anyone can see it not working please let me know Smiley
1714153212
Hero Member
*
Offline Offline

Posts: 1714153212

View Profile Personal Message (Offline)

Ignore
1714153212
Reply with quote  #2

1714153212
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714153212
Hero Member
*
Offline Offline

Posts: 1714153212

View Profile Personal Message (Offline)

Ignore
1714153212
Reply with quote  #2

1714153212
Report to moderator
1714153212
Hero Member
*
Offline Offline

Posts: 1714153212

View Profile Personal Message (Offline)

Ignore
1714153212
Reply with quote  #2

1714153212
Report to moderator
1714153212
Hero Member
*
Offline Offline

Posts: 1714153212

View Profile Personal Message (Offline)

Ignore
1714153212
Reply with quote  #2

1714153212
Report to moderator
skyangel (OP)
Sr. Member
****
Offline Offline

Activity: 301
Merit: 260


FLO dev


View Profile
June 21, 2013, 09:59:23 PM
Last edit: June 21, 2013, 10:17:51 PM by skyangel
 #122

http://lotto.coinworld.us/FLO/bc/index.php

ok you can find your messages there for now, I was able to find a few messages and it seems to work.

...

It would be nice to have the old bitcoin message (comment) stubs either removed, or activated for this feature.  Did you save time by implementing it in parallel or do you have other ideas for expansion?

Very nice! Exciting to see this. I'll update the first post with a link.

The version 1 transactions was kept for compatibility sake. Most of the version 1 transactions in the block chain was generated by mining software/pools other than the wallet.

The client generates version 2 transactions. I don't plan on changing the format of version 2 packets. I added the "text:" part in the beginning of the comment so that people could adopt the convention for their own kind of transaction comments, for example "encrypted:HGKJHGYXBgjh5j" or "url:http://example.com" or "reference:12345" or whatever they choose.

coinerd
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
June 21, 2013, 10:22:25 PM
 #123


Very nice! Exciting to see this. I'll update the first post with a link.

The version 1 transactions was kept for compatibility sake. I don't plan on changing the format of version 2 transactions. I added the "text:" part in the beginning of the comment so that people could adopt the convention for their own kind of transaction comments, for example "encrypted:HGKJHGYXBgjh5j" or "url:http://example.com" or "reference:12345" or whatever they choose.


For now it's a good add because it allows this sort of easy trapping of the message for folks that aren't comfortable fliflopping between bases and encodings.

The more people can work with it the more people will be attracted to it, for sure.  An update that returned it as a parameter of the RPC-JSON transaction data would make adoption easy. At the moment it's a bit of a (realtively easy) trick.

1. grab TX hex
2. Convert to ASCII using common tutorial funciton or native language function
3. use regex to split the ASCII translation of the hex at "text:"
4. second half of the split is the text message. (if one exists)

A check for transaction version may improve overall software efficiency but isn't necessary as a v2 transaciton may not have a message anyways.

Sound reliable enough, with your knowledge of how it actually works? 

Are there cases where it will catch "garbage" after the message in the hex? 

If it's always the end the length bytes only matter when you're already making sense of the rest of the hex. If you don't parse the actual hex into transaction data locally (and very few will) they're essentially at a random location it seems to me.

Also not to seem awful but I'm totally up for bounties and tips Roll Eyes

F6cSj818K2b1DsQWMDVZDRck6TaiNfxEm7
skyangel (OP)
Sr. Member
****
Offline Offline

Activity: 301
Merit: 260


FLO dev


View Profile
June 21, 2013, 10:38:31 PM
 #124

Are there cases where it will catch "garbage" after the message in the hex? 

If it's always the end the length bytes only matter when you're already making sense of the rest of the hex. If you don't parse the actual hex into transaction data locally (and very few will) they're essentially at a random location it seems to me.

Also not to seem awful but I'm totally up for bounties and tips Roll Eyes

F6cSj818K2b1DsQWMDVZDRck6TaiNfxEm7

It will always be at the end of the message with version 2 transactions.

Of course it would be safer to parse this field like all the other fields are parsed (checking length, etc), but I think it should be fine as you have it now.

Sent you a donation, thanks Smiley

coinerd
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
June 21, 2013, 10:40:06 PM
 #125

.... I added the "text:" part in the beginning of the comment so that people could adopt the convention for their own kind of transaction comments, for example "encrypted:HGKJHGYXBgjh5j" or "url:http://example.com" or "reference:12345" or whatever they choose...


Wait, that's just sinking in.  If I was to add a comment to a console or RPC transaction, would it be preceded by the "text:" string or is the QT gui doing that?

is there currently a way to send a message without including the "text:" in the transaction data?

Uh oh Wink

I'm not sure I'm ready to build an actual transaction parser for raw hex transactions in php. Until now the JSON return has been sufficient for what I've done.

And thank you for the donation as well.
metacoin
Sr. Member
****
Offline Offline

Activity: 437
Merit: 260


balance


View Profile WWW
June 21, 2013, 10:41:01 PM
 #126

Sent some coins to coinerd Smiley

pin.org
skyangel (OP)
Sr. Member
****
Offline Offline

Activity: 301
Merit: 260


FLO dev


View Profile
June 21, 2013, 10:41:37 PM
 #127

The more people can work with it the more people will be attracted to it, for sure.  An update that returned it as a parameter of the RPC-JSON transaction data would make adoption easy.

The listtransactions RPC call returns the comment in the "tx-comment" field.

Also the send RPC calls also support an optional "tx-comment" parameter.

skyangel (OP)
Sr. Member
****
Offline Offline

Activity: 301
Merit: 260


FLO dev


View Profile
June 21, 2013, 10:43:21 PM
 #128

.... I added the "text:" part in the beginning of the comment so that people could adopt the convention for their own kind of transaction comments, for example "encrypted:HGKJHGYXBgjh5j" or "url:http://example.com" or "reference:12345" or whatever they choose...


Wait, that's just sinking in.  If I was to add a comment to a console or RPC transaction, would it be preceded by the "text:" string or is the QT gui doing that?

is there currently a way to send a message without including the "text:" in the transaction data?

Yes, the GUI adds the "text" part in front. If you send using RPC calls, nothing is prefixed, you must add your own prefix.

coinerd
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
June 21, 2013, 11:05:12 PM
 #129

Sent some coins to coinerd Smiley

Thank you as well Smiley


The listtransactions RPC call returns the comment in the "tx-comment" field.

Also the send RPC calls also support an optional "tx-comment" parameter.

Ok, that's great for your own incoming stuff.


Yes, the GUI adds the "text" part in front. If you send using RPC calls, nothing is prefixed, you must add your own prefix.


So, for this to 'really' work in some sort of web service, a raw TX parser is required, then?

Ahhh, bitcoin.it just never seems very inviting, heh.
coinerd
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
June 22, 2013, 12:38:43 AM
 #130

We had the first public drawing the numbers are here:

http://lotto.coinworld.us/FLO/history.php?draw=2

If you entered please make sure you received your winnings, it's a new lottery after all Smiley

Thanks to all the players
MobGod
Hero Member
*****
Offline Offline

Activity: 532
Merit: 500



View Profile WWW
June 22, 2013, 01:47:57 AM
 #131

Get in the lotto I just pumped it up

For security, your account has been locked. Email acctcomp15@theymos.e4ward.com
frobley
Hero Member
*****
Offline Offline

Activity: 708
Merit: 500


View Profile
June 22, 2013, 07:04:12 AM
 #132

nice work coinerd!  Wink
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
June 22, 2013, 08:09:38 AM
 #133

All right I hope I don't end up feeling like an idiot but I'm tired and I can't see it in the tx data:

http://lotto.coinworld.us/FLO/bc/index.php?transaction=de2824f54ccf5391bfc0c9b5a0a5e09214e4c045627a44c696bfb325f20c92ce

can someone help me fish it out or something so it can be displayed cleartext>?



02000000010cd18acf5f2a854e93cc88058fc59c95c7b97ed2f255900bc0829a1f813d0b7801000 0006b483045022100ec82001cca4924e0f9b857153a0e6e07bcb5d657b090b870929014a14dbe6c f602207047b247b6c6b99f985406d9df184c81ff302b01c0dea1c396df1b8d0061713f0121037e6 9a13d14797dc3d9555cc75da616edb9c1a058876183fe0171f85c7ebf2672ffffffff02c35d462a 010000001976a914e969fd5fb098999ab4df96429cf33aed4f33fe0788ac00ab904100000000197 6a914ad5de988256a98eee955c77b1e92c7ff065ebf9988ac000000001b746578743a476f207769746820746865203c423e464c4f3c2f423e

1b (27) is the length of the message.

The full message is:

"text:Go with the <B>FLO</B>"

In hex:

746578743a476f207769746820746865203c423e464c4f3c2f423e


Also note that only those transactions that have "Tx version" = 2 have a message at the end.

Quote
Since messages are currently a maximum of 140 characters, the three bytes before the length byte should be 0.

It would be nice for a coin creator to know how his coin works Roll Eyes
The 00000000 at the end will never change... Only 1B describes the size of the comment.

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
skyangel (OP)
Sr. Member
****
Offline Offline

Activity: 301
Merit: 260


FLO dev


View Profile
June 22, 2013, 08:58:25 AM
 #134

All right I hope I don't end up feeling like an idiot but I'm tired and I can't see it in the tx data:

http://lotto.coinworld.us/FLO/bc/index.php?transaction=de2824f54ccf5391bfc0c9b5a0a5e09214e4c045627a44c696bfb325f20c92ce

can someone help me fish it out or something so it can be displayed cleartext>?



02000000010cd18acf5f2a854e93cc88058fc59c95c7b97ed2f255900bc0829a1f813d0b7801000 0006b483045022100ec82001cca4924e0f9b857153a0e6e07bcb5d657b090b870929014a14dbe6c f602207047b247b6c6b99f985406d9df184c81ff302b01c0dea1c396df1b8d0061713f0121037e6 9a13d14797dc3d9555cc75da616edb9c1a058876183fe0171f85c7ebf2672ffffffff02c35d462a 010000001976a914e969fd5fb098999ab4df96429cf33aed4f33fe0788ac00ab904100000000197 6a914ad5de988256a98eee955c77b1e92c7ff065ebf9988ac000000001b746578743a476f207769746820746865203c423e464c4f3c2f423e

1b (27) is the length of the message.

The full message is:

"text:Go with the <B>FLO</B>"

In hex:

746578743a476f207769746820746865203c423e464c4f3c2f423e


Also note that only those transactions that have "Tx version" = 2 have a message at the end.

Quote
Since messages are currently a maximum of 140 characters, the three bytes before the length byte should be 0.

It would be nice for a coin creator to know how his coin works Roll Eyes
The 00000000 at the end will never change... Only 1B describes the size of the comment.

I assumed since I'm writing an a 32 bit value to the serializer it would use 32 bits to encode the value. If this is not the case, how would a value of 256 be encoded?

jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
June 22, 2013, 09:01:50 AM
 #135

All right I hope I don't end up feeling like an idiot but I'm tired and I can't see it in the tx data:

http://lotto.coinworld.us/FLO/bc/index.php?transaction=de2824f54ccf5391bfc0c9b5a0a5e09214e4c045627a44c696bfb325f20c92ce

can someone help me fish it out or something so it can be displayed cleartext>?



02000000010cd18acf5f2a854e93cc88058fc59c95c7b97ed2f255900bc0829a1f813d0b7801000 0006b483045022100ec82001cca4924e0f9b857153a0e6e07bcb5d657b090b870929014a14dbe6c f602207047b247b6c6b99f985406d9df184c81ff302b01c0dea1c396df1b8d0061713f0121037e6 9a13d14797dc3d9555cc75da616edb9c1a058876183fe0171f85c7ebf2672ffffffff02c35d462a 010000001976a914e969fd5fb098999ab4df96429cf33aed4f33fe0788ac00ab904100000000197 6a914ad5de988256a98eee955c77b1e92c7ff065ebf9988ac000000001b746578743a476f207769746820746865203c423e464c4f3c2f423e

1b (27) is the length of the message.

The full message is:

"text:Go with the <B>FLO</B>"

In hex:

746578743a476f207769746820746865203c423e464c4f3c2f423e


Also note that only those transactions that have "Tx version" = 2 have a message at the end.

Quote
Since messages are currently a maximum of 140 characters, the three bytes before the length byte should be 0.

It would be nice for a coin creator to know how his coin works Roll Eyes
The 00000000 at the end will never change... Only 1B describes the size of the comment.

I assumed since I'm writing an a 32 bit value to the serializer it would use 32 bits to encode the value. How would a value of 256 be encoded then?


VarInt... Should be something like fd0100, check on the wiki.

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
skyangel (OP)
Sr. Member
****
Offline Offline

Activity: 301
Merit: 260


FLO dev


View Profile
June 22, 2013, 09:03:23 AM
 #136

All right I hope I don't end up feeling like an idiot but I'm tired and I can't see it in the tx data:

http://lotto.coinworld.us/FLO/bc/index.php?transaction=de2824f54ccf5391bfc0c9b5a0a5e09214e4c045627a44c696bfb325f20c92ce

can someone help me fish it out or something so it can be displayed cleartext>?



02000000010cd18acf5f2a854e93cc88058fc59c95c7b97ed2f255900bc0829a1f813d0b7801000 0006b483045022100ec82001cca4924e0f9b857153a0e6e07bcb5d657b090b870929014a14dbe6c f602207047b247b6c6b99f985406d9df184c81ff302b01c0dea1c396df1b8d0061713f0121037e6 9a13d14797dc3d9555cc75da616edb9c1a058876183fe0171f85c7ebf2672ffffffff02c35d462a 010000001976a914e969fd5fb098999ab4df96429cf33aed4f33fe0788ac00ab904100000000197 6a914ad5de988256a98eee955c77b1e92c7ff065ebf9988ac000000001b746578743a476f207769746820746865203c423e464c4f3c2f423e

1b (27) is the length of the message.

The full message is:

"text:Go with the <B>FLO</B>"

In hex:

746578743a476f207769746820746865203c423e464c4f3c2f423e


Also note that only those transactions that have "Tx version" = 2 have a message at the end.

Quote
Since messages are currently a maximum of 140 characters, the three bytes before the length byte should be 0.

It would be nice for a coin creator to know how his coin works Roll Eyes
The 00000000 at the end will never change... Only 1B describes the size of the comment.

I assumed since I'm writing an a 32 bit value to the serializer it would use 32 bits to encode the value. How would a value of 256 be encoded then?


VarInt... Should be something like fd0100, check on the wiki.

Ah, something similar to Google's Varint in protocol buffers. Thanks for the info Smiley

coinerd
Full Member
***
Offline Offline

Activity: 196
Merit: 100


View Profile
June 22, 2013, 10:41:33 AM
 #137

Hey, whoever owns florin address FMgofXxjaHW7wyw8mYMQd189eCq7dZGi93 -


I'm guessing it's a reader here, got caught in an issue at the lotto site where an empty drawing was run before the deposit confirmed.

Your new reservation address is FV9YQMAX95BFxBHsg9FioaThG9GQnS9xNZ and also I added a couple of tickets for you in the next drawing.

On another topic - frobley, thank you for your support Smiley
Petr1fied
Hero Member
*****
Offline Offline

Activity: 630
Merit: 502


View Profile
June 22, 2013, 11:07:01 AM
 #138

I'd use something like this to get the text in php:
Code:
<?php

$text_output
=false;
$hex="02000000010cd18acf5f2a854e93cc88058fc59c95c7b97ed2f255900bc0829a1f813d0b78010000006b483045022100ec82001cca4924e0f9b857153a0e6e07bcb5d657b090b870929014a14dbe6cf602207047b247b6c6b99f985406d9df184c81ff302b01c0dea1c396df1b8d0061713f0121037e69a13d14797dc3d9555cc75da616edb9c1a058876183fe0171f85c7ebf2672ffffffff02c35d462a010000001976a914e969fd5fb098999ab4df96429cf33aed4f33fe0788ac00ab9041000000001976a914ad5de988256a98eee955c77b1e92c7ff065ebf9988ac000000001b746578743a476f207769746820746865203c423e464c4f3c2f423e";

$decoded_text=hex2bin($hex);
$text_pos=strpos($decoded_text"text:");
if(
$text_pos)
{
    
$text_output=strip_tags(substr($decoded_text, ($text_pos+5)));
}

if(
$text_output)
{
    echo 
$text_output;
}
else
{
    echo 
"No text in transaction";
}

?>

Note: the hex2bin function requires php 5.4 or above.
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
June 22, 2013, 01:11:35 PM
 #139

Bad idea, you could have 746578743a in the transaction inputs, in the signature, in the output amounts, or even in the hashes you send the money to.
Actually you could have this everywhere.

Taking the last 746578743a in the transaction would be better
Taking the first 746578743a after the last 00000000 would be even better
Actually parsing the transaction would be the only way to be sure

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
Petr1fied
Hero Member
*****
Offline Offline

Activity: 630
Merit: 502


View Profile
June 22, 2013, 01:17:31 PM
Last edit: June 22, 2013, 01:52:55 PM by Petr1fied
 #140

If it appears in a random position within the hex string, perhaps. But with only one hex string to go on there is really no easy way to test other eventualities.
Pages: « 1 2 3 4 5 6 [7] 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 ... 126 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!