ngccc dev status

1 view
Skip to first unread message

Alex Mizrahi

unread,
Dec 8, 2013, 8:48:14 PM12/8/13
to bitc...@googlegroups.com
1. testing identified that asset definition management user interface
sucks a bit too much, so I'll try to improve it before wider release
2. I've identified the main problem which prevented p2ptrade from
working, but it needs a bit more testing and fixes
3. I've tested that building for Windows is possible

4. There is now experimental "smartpro" branch which implements what I
call "token smart property". I've previously described similar idea in
"advanced color states" topic, and something similar was described in
Vitalik's document on genesis transactions:

There is a bunch of generic tokens from which you can create specific
smart property instances.
For example, suppose you want smart property which represents
computers within your organization. You can do it this way, first you
create generic tokens which represent computers:

$ ./ngccc issue computer_token obc 1000 10000

this creates 1000 tokens
Now you can create individual computers:

$ ./ngccc create_sp computer_token my_laptop "serial number"

This creates a new asset definition for my_laptop. Now it can tell you
how many laptops you have:

$ ./ngccc balance my_laptop
1

And, of course, you can send this token which represents this specific laptop:

$ ./ngccc send my_laptop <somebody's address> 1

From now it will say that balance is 0.

Each smart property instance can have a piece of data attached to it,
it is recorded in genesis transaction using OP_RETURN script, for
example:

{
"value" : 0.00010000,
"n" : 2,
"scriptPubKey" : {
"asm" : "OP_RETURN 3132332062726f",
"reqSigs" : 1,
"type" : "nulldata",
"addresses" : [
]
}
},

represents data "123 bro".

Now, in principle, you can scan all transactions involving
computer_token color to get a list of all serial numbers which were
registered this way.
I haven't implemented it yet, though, but it's pretty straightforward.

What's interesting, it took me only 2 hours to implement this feature,
as ngccc's architecture is designed to handle overlapping colors. So I
just create a new asset definition for each smart property instance
and it just works. Nice.

Jorge Timón

unread,
Dec 9, 2013, 9:54:06 AM12/9/13
to bitc...@googlegroups.com
Cool, this "token smart property" reminds me to our
"indivisible/unique tokens" in freimarkets.
> --
> You received this message because you are subscribed to the Google Groups
> "Colored coins (BitcoinX)" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to bitcoinX+u...@googlegroups.com.
> To post to this group, send email to bitc...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>


--
Jorge Timón

http://freico.in/

Manuel Aráoz

unread,
Dec 9, 2013, 9:53:47 AM12/9/13
to bitc...@googlegroups.com
Wow, this is huge. Great work Alex. I didn't have time to test it this weekend due to the conference here, but I'll find the time today or tomorrow. I'm very interested in learning how to use OP_RETURN for my document timestamping app, so I'll read that code too. 

Manuel


Jorge Timón

unread,
Dec 9, 2013, 10:07:52 AM12/9/13
to bitc...@googlegroups.com
Manuel, I think that would be pretty straight-forward.
You can just append the hash of the document after the OP_RETURN and I
would say that's it.
The wiki says:
OP_RETURN Marks transaction as invalid.

But that's outdated:

https://en.bitcoin.it/wiki/Script

You can read more about what OP_RETURN currently does here:

https://github.com/bitcoin/bitcoin/pull/2738

Basically the output is unspendable (thus prunable out of the UTXO
set), but you got your file hash timestamped on the chain as you
wanted.


On 12/9/13, Manuel Aráoz <manue...@gmail.com> wrote:
> Wow, this is huge. Great work Alex. I didn't have time to test it this
> weekend due to the conference here, but I'll find the time today or
> tomorrow. I'm very interested in learning how to use OP_RETURN for my
> document timestamping app <http://www.proofofexistence.com/>, so I'll read

Dan Miller

unread,
Dec 9, 2013, 10:14:44 AM12/9/13
to bitc...@googlegroups.com
And even though OP_RETURN transactions are now considered "standard" and relay-able, keep in mind they are strongly discouraged still by the bitcoin devs as spammy, off-purpose, wasteful, even parasitic. I'm not debating the sides of that position, just make sure you are aware of it.

Jorge Timón

unread,
Dec 9, 2013, 10:19:50 AM12/9/13
to bitc...@googlegroups.com
On 12/9/13, Dan Miller <dan.r....@gmail.com> wrote:
> And even though OP_RETURN transactions are now considered "standard" and
> relay-able, keep in mind they are strongly discouraged still by the bitcoin
> devs as spammy, off-purpose, wasteful, even parasitic. I'm not debating the
> sides of that position, just make sure you are aware of it.

I think most core devs think this is the right way to use bitcoin for
external timestamping.
I don't see how this can be parasitic if you're paying a fee and your
data won't be bloating the UTXO.
In case of doubt, I would ask in bitcoin-dev mailing list or irc channel.

> On Mon, Dec 9, 2013 at 10:07 AM, Jorge Timón <jti...@monetize.io> wrote:
>
>> Manuel, I think that would be pretty straight-forward.
>> You can just append the hash of the document after the OP_RETURN and I
>> would say that's it.
>> The wiki says:
>> OP_RETURN Marks transaction as invalid.
>>
>> But that's outdated:
>>
>> https://en.bitcoin.it/wiki/Script
>>
>> You can read more about what OP_RETURN currently does here:
>>
>> https://github.com/bitcoin/bitcoin/pull/2738
>>
>> Basically the output is unspendable (thus prunable out of the UTXO
>> set), but you got your file hash timestamped on the chain as you
>> wanted.
>>
>>
>> On 12/9/13, Manuel Aráoz <manue...@gmail.com> wrote:
>> > Wow, this is huge. Great work Alex. I didn't have time to test it this
>> > weekend due to the conference here, but I'll find the time today or
>> > tomorrow. I'm very interested in learning how to use OP_RETURN for my
>> > document timestamping app <http://www.proofofexistence.com/>, so I'll
>> read
>> > that code too.
>> >
>>
>

Dan Miller

unread,
Dec 9, 2013, 10:24:04 AM12/9/13
to bitc...@googlegroups.com
Yes #bitcoin-dev would be good. A few days ago they were recommending a merged-mining approach specifically over OP_RETURN for a time-stamping application.

Alex Mizrahi

unread,
Dec 9, 2013, 10:44:07 AM12/9/13
to bitc...@googlegroups.com
> I didn't have time to test it this
> weekend due to the conference here, but I'll find the time today or
> tomorrow.

FYI I haven't created a new build yet, but I've fixed some bugs...

> I'm very interested in learning how to use OP_RETURN for my
> document timestamping app, so I'll read that code too.

That part is literally two lines of code, script compiler does it for me :)

Basically it's just "OP_RETURN %s" % hex_string

Alex Mizrahi

unread,
Dec 9, 2013, 8:25:10 PM12/9/13
to bitc...@googlegroups.com
Win32 build: http://killerstorm.xen.prgmr.com/alex/ngccc-0.0.1-win32.zip

Experimental. p2ptrade seems to work now, but it isn't secure. (It doesn't check that we're paid before it signs the transaction.)

Instructions are same as for Linux version: ngccc-cli setval testnet true to configure it to use testnet, and then you can use ngccc-gui.

We'll make a better release a bit later...

Manuel Aráoz

unread,
Dec 10, 2013, 9:44:23 AM12/10/13
to bitc...@googlegroups.com
Windows build seems to be running OK. Is it normal that when I issue a new asset I lose some bitcoins but gain no balance in the new asset? I created some test asset definitions but I have 0 balance in all of them.

I'd also like to test if p2ptrade works over the internet. Is there anywhere I can read about how this works? How are buy/sell orders broadcast to the network? 


Manuel


--

Alex Mizrahi

unread,
Dec 10, 2013, 9:50:27 AM12/10/13
to bitc...@googlegroups.com
Windows build seems to be running OK.

Note that there was a problem with package: I've included wallet.db, so users who don't delete it all share same wallet. :)
I've already removed it.
 
Is it normal that when I issue a new asset I lose some bitcoins but gain no balance in the new asset?

Somebody already reported this issue, somehow new coins appear after restart. This needs to be investigated...
 
I'd also like to test if p2ptrade works over the internet. Is there anywhere I can read about how this works? How are buy/sell orders broadcast to the network? 

Well, for the start: 
:)
I'll explain in more detail a bit later...

Manuel Aráoz

unread,
Dec 10, 2013, 9:52:03 AM12/10/13
to bitc...@googlegroups.com
Alex, thanks. Yes, I restarted the client and the balances where showing up :)
Thanks for pointing out the code, that's enough.




--

Manuel Aráoz

unread,
Dec 10, 2013, 10:32:32 AM12/10/13
to bitc...@googlegroups.com
Some feedback on the UI/UX aspect:
  • Consider replacing word "moniker" with "color name" or "asset name" for users. 
  • Add delete asset definition functionality
  • Add a visual indicator of activity (spinner)
  • Add a visual indicator of connection status to bitcoind

Alex Mizrahi

unread,
Dec 13, 2013, 6:34:50 PM12/13/13
to bitc...@googlegroups.com
Some feedback on the UI/UX aspect:
  • Consider replacing word "moniker" with "color name" or "asset name" for users. 
  • Add delete asset definition functionality
Definitely. 
  • Add a visual indicator of activity (spinner)

Sadly, this isn't possible without significant changes: it is single-threaded, and all work is done in the main thread.
We'd have to have a separate "wallet" thread to be able to do this. 
Reply all
Reply to author
Forward
0 new messages