Bitcoin Forum
May 02, 2024, 06:29:15 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: « 1 ... 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 58 59 60 61 62 63 64 65 66 67 68 69 [70] 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 »
1381  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: November 28, 2012, 01:49:32 AM
This seems quite an exaggeration, with no supporting evidence of what needs a major rework.  I do embedded programming for the day job, so I don't see this.  The Linux kernel is as bare metal as it gets, and must work in all environments, all platforms.  Smiley
For starters, you'll have heck of a time to remove your dependency on glib.h from GTK. But there's more. You could actually try to compile your code from within the Linux kernel tree to see for yourself.

For a die-hard Linux developer like you I think the minimum definition of bare-metal would be uClinux. Full Linux doesn't count anymore for a true embedded development.

The main chore of embedded use is simply the dependencies, most notably OpenSSL, and to a lesser extent GLib.  Once you have that, or its replacement, embedded use is straightforward.
Both GLib and OpenSSL are heavy duty harvester combines. Removing the dependencies on them will at least halve the resource usage.

For a RedHat-ter at least make the code work with newlib instead of glib. The required knowledge should be no more than the internal phone call away for you. This includes a whole sermon on why you don't want to build a dependency on them.

Using "union" decreases the performance and quality of code output for zero gain.  It is trivial enough to use sparse with a type specifier to guarantee endian purity, like the Linux kernel does, if that is desired ("__le32" etc.)

The code has long since been verified to work on big endian.
As I've noted: I've forgot that you are one of the very few Bitcoin developers with regular access to big-endian hardware. I'm thinking that you will continue to be the only one developer who can test picocoin on the big-endian architecture. The mojibake-endian problem will continue to badly affect the future contributors/users of your library if you aren't going to use your own medicine (that is "sparse" and "__le32")

The performance loss for passing unions around may have been true for GCC 2.96. I'm not normally working with Linux kernel and/or GCC.

But I have a great, positive experience with code of the following style(C++ used for brevity, ... expands to long #ifdef trees using platform- and compiler-specific intrinsics)
Code:
union be_int {
  unsigned char b[4];
  int i;
  inline operator =(int a) { ... }
  inline operator int() { ... }
};
The explicit strong-typing of endianness blocks the vast majority of possible endian errors and allows to produce meaningfull, endian-bug-free contributions from people who are exclusively using little-endian hardware. In my (rather extensive) experience it actually increases the performance because programmers can visualize the data structures better and can spend more time designing the algorithms instead of debugging trivial omissions or transpositions.

All in all, I apologise for jumping in into the battle between you and MatthewLM. Regretfully I can't easily build neither of yours code, because I'm almost exclusively working on the closed-source platforms like Windows, MacOS, etc. and standalone environments not relying on GCC/GLIB/autogen. But it is a shame that another C implementation of Bitcoin is useless for the developers of Bitcoin hardware wallets.
1382  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: November 27, 2012, 10:45:58 PM
Yes, embedded usage is another target.

Each module in libccoin is carefully designed to minimize internal dependencies.  The core data structures, address generation, script execution and transaction validation are wholly independent of any filesystem or network design.

These modules may be used on a non-POSIX flash filesystem, with zero network support, today.

picocoin (the client) requires certain network, filesystem and process features, but libccoin (the library) does not.  This is by design.
But even the definitions in your "ccoin" include files are deeply incompatible with any standalone environment, even if it uses GCC toolchain. Major rework would be required even now, when there's just couple of hundred lines of code.

The big-endian compatibility is already super-confusing. Istead of using uint32_t in bu256_t use an "union le_int32" to at least flag the mixing of little endian uint32_t with guint32_t.

From my extensive commercial experience of porting from Linux/Posix/Intel-only code to anything standalone or lightweight OS will unfortunatly go through the "first deny then rewrite from almost scratch" stages.

If I may suggest two things:

1) from the start build also on Mac Leopard or Snow Leopard to verify the endian-neutrality with "-arch ppc" with Rosetta on Intel CPU. Edit: Never mind, I forgot that you have access to the Linux on POWER and z/Arch through your association with RedHat.
2) obtain any embedded development/simulation environment. If you have any Xilinx Spartan6 boards (with memory) laying around you could use them to test using MicroBlaze CPU with Xilinx EDK/SDK.

Thank you for yor time.
1383  Bitcoin / Wallet software / Re: [ANNOUNCE] picocoin and libccoin -- C-based bitcoin library and client on: November 27, 2012, 09:22:49 PM
  • Very low resource usage (cpu, disk, and memory)
  • Small codebase (both source code and compiled object)
  • Multi-platform: Linux supported currently.  Should work on OSX/BSD/Windows with minimal modifications.
Comments are welcome.
Jeff, I have one comment that has value only very early in the design of your architecture. Since you've made a choice of C as a implementation language I suggest that you add one more target to the list of supported platforms: standalone a.k.a. bare metal.

It will be nearly impossible to convert your code later unless you very early make a commitment to supporting the event-driven programming like using lwIP-style network interface in addition to socket-style networking.

The same architectural choice needs to be made early to accomodate various lightweight flash-storage access methods instead of Unix-style open/lseek/read/write/close. Same for fork/wait/pthreads versus any RTOS-style explicit synchronization primitives.

One possible advantage of such choices would be that instead of relying purely on donations you may be able to obtain funds via cooperation with future manufacturers of the future Bitcoin devices that will greatly benefit from the "very low resource usage".
1384  Bitcoin / Project Development / Re: BitSafe Hardware Wallet Development - SCHEMATIC NOW INCLUDED on: November 27, 2012, 11:34:33 AM
Comparing apples and oranges here. Bitsafe is MIPS architecture, ours is ARM. MIPS binaries are approx 2x bigger than ARM ones.
Are you sure? Are you really comparing MIPS16 with Thumb?

I've seen some numbers for an older project and the MIPS vs. MIPS16
and ARM vs. Thumb sizes were within about 10% of each other. Tests were made with commercial C compilers, not GCC though. Maybe some GCC oddity?
1385  Bitcoin / Project Development / Re: BitSafe - Hardware Wallet Development Kit on: November 25, 2012, 11:19:20 PM
It's my understanding that the GPU and bootloader were opened. Besides, this device doesn't need to use a GPU.
I'm sorry, but this is disinformation. I repeat: GPU boots first, then it starts the CPU. The "open source" driver is just a lean thunk layer to call back the real supervisor that runs on the GPU's undocumented instruction set. GPU also does things like power management.

Broadcom guys are very smart and very cynical. Turning upside down the central processor vs. peripheral processor architecture was a very smart, forward looking move.

Edit: Before anyone quotes the above: the term GPU is also a disinformation. The main processing unit in the Broadcom VideoCore architecture is a systolic array of relatively slow-clocked DSP processors. It works as a GPU when the DSP chips are executing graphic pipeline code. The secret architecture of the VideoCore processors was a serious drawback... unitil they came with a bright idea of tackling an ARM CPU running as an attached processor. This allows Broadcom to claim some sort of openness to bait the uninformed. It also allows them to markets using Android on ARM.
1386  Bitcoin / Project Development / Re: BitSafe - Hardware Wallet Development Kit on: November 25, 2012, 11:03:27 PM
A Raspberry Pi is cheaper and far more powerful.
In Raspbery Pi a closed source GPU boots and controls the CPU. It is going to be a new frontier for hacking the gullible. Score for Broadcom.
1387  Other / Meta / Re: Bug: Quotes in password on: November 25, 2012, 06:23:41 PM
Maybe somebody changed the "magic_quites_<whatever>" in php.ini?
1388  Bitcoin / Hardware / Re: Block Erupter: Dedicated Mining ASIC Project (Open for Discussion) on: November 24, 2012, 06:49:51 PM
Thus why I'm certainly using USB direct for all ASIC USB devices - not Serial-USB and adding more overhead on top of it (and timing issues)
Thank you for the writeup. I'm not really familiar with building clusters using USB, I always worked with real serial HDLC/RS-232/RS-422 controllers or with Ethernet multicast.

The only real USB experience I had was with FTDI USB controllers. Neither ngzhang nor Enterpoint bothered to route all available signals from the serial chip to the FPGAs, so the high-bandwidth low-latency modes of transmission couldn't be used with them.

Hopefully the ASIC controller designers won't make the same mistakes and will allow you to use isochronous or bulk modes when the bus utilization becomes non-neglible.
1389  Bitcoin / Hardware / Re: Block Erupter: Dedicated Mining ASIC Project (Open for Discussion) on: November 24, 2012, 01:06:17 PM
1) Firstly, the double sha256 is a total of 3 rounds (with 64 steps each) - just the whole first round is constant across a full nonce range.
(commonly known as the midstate) that you only need to do once per nonce range.
2) Secondly, the first 3 steps of the 2nd round are constant across a full nonce range.
3) Thirdly, some of the W values are also constant across a full nonce range (easy to work out which)
4) Then finally, as you said, you don't need to complete the last 3 steps of the 3rd round.
Thanks. I'm quoting this because it is a very nice reference for the state-of-the-art GPU/FPGA optimizations. I remembered the 4) on your list the most because it most clearly shows the shift-register structure inherent to the SHA-256.

Edit: Note to self: Kano is swapping the standard terminology: step vs. round. Using standard terminology first SHA-256 hash in Bitcoin consists of 2 steps of 64 rounds each.

In ASIC terms it would be risky to implement any of 2, 3 or 4
While you may gain a few % overall (6 out of 128 steps plus W optimistations) it also means you can only sha256 an exact BTC block header.
If BTC continues to use sha256 but makes any changes to the block header, then that wouldn't be a problem if none of steps 2, 3 or 4 were implemented in the silicon, since you could change the firmware to deal with a different header.
At least for the chip discussed in this thread it appears that the block header structure is fixed:
0-31    writing midstate
32-43   writing data
44-47   reading nonce
1390  Bitcoin / Hardware / Re: Block Erupter: Dedicated Mining ASIC Project (Open for Discussion) on: November 24, 2012, 12:55:17 PM
only to find all the windows problems were driver related - not my code.
I'm presuming that you had problems with the usbser.sys from Microsoft. Did you also had problems with the Prolific/FTDI drivers as well?

I think (though not 100% sure) the serial-USB device's existence is decided by the firmware so it can be fixed after the fact anyway?
On the LPC1343 like ModMiner yes. ngzhang used hard serial-USB chips (Prolific or FTDI) in his designs. Same with Enterpoint (FTDI).
1391  Bitcoin / Hardware / Re: Block Erupter: Dedicated Mining ASIC Project (Open for Discussion) on: November 24, 2012, 10:54:18 AM
seventy-two 32-bit registers
Fixed that first part for you... but just wasn't up to trying to edit the rest for conceptual logic failures.
The 72 misconception is really getting boring.

FIPS-180-2 defines SHA-256 in terms of two arrays of 32-bit words:
H[8] and W[64]. 8+64=72. Yet a quick comparison with SHA-1 shows that the same "alternative implementation" can be used for SHA-256.

In case of SHA-1 the "original implementation" is H[5] and W[80]; while "alternative implementation" is H[5] and W[16]. Thus: 85 vs. 21.

In case of SHA-256 we have 72 vs. 24 (H[8] and W[16]).

The further observation is that the "arrays" or "circular queues" in the FIPS-180-2 definition aren't really accessed randomly or in any variable order. Therefore both H and W can be converted to 32-bit wide shift registers, but with unusual feedback functions.

The above is just for pure SHA-256, without any Bitcoin specific optimizations. At least two people claimed to be able to apply some unspecified optimizations to Bitcoin hash expressed as a binary function:

1) killerstorm
https://bitcointalk.org/index.php?topic=55888.0

2) Gareth (BitInstant)
https://bitcointalk.org/index.php?topic=10661.msg557579#msg557579

but nothing came out of it. By now pretty much everyone knows about the fact that one can shave 3 last rounds from the 2nd SHA-256 in Bitcoin: instead of looking for zero 32-bit word at the most significant position in H; take an advantage of the fact that H is a shift register and last 3 rounds simply shift the would-be-most-significant-word. So look for a negation of a specific constand value (0x3c6ef372?).
 
Software optimization isn't the same as hardware optimization. ASIC design should not be thought of as "lets make a chip that can do this calculation at 2000mhz over and over and over..." that's counter-intuitive. You've locked yourself into thinking in terms of GPU design which need not apply to other processes. The reason GPUs (and yes, CPUs too) are designed this way is because they are multi-function chip. There's operations they know how to do, and they process things according to instructions. That's fine for generalized applications. In the case of GPU you've got a hard limit / goal of producing a video frame every so many fractions of a second... sha2 just doesn't need that level of coordination. You aren't having to work for a variety of instructions - it's a single process that doesn't change.

Besides which we're not actually talking about that much data. sha2... we only need to work with 512 bits at a time. At the very least we had better be unrolling the chunk processing for so that it isn't looping... that's hardware design 101.

I'm puzzled by this part. I never mentioned CPU nor GPU. I tried to pattern my argument after the sort of arguments that were being made around 1980 during the http://en.wikipedia.org/wiki/Mead_%26_Conway_revolution . Perhaps you were mixing me with someone else?
1392  Bitcoin / Hardware wallets / Re: [ANN] Hardware wallet project on: November 22, 2012, 09:11:29 AM
with the handy drawer-o-cables-and-adapters within arm's reach.
EU-landia has since 2009 a law requiring that a cellphone sold there needs to be rechargable through the micro-USB port.  So maybe not every household does have micro-USB to USB cable, but the situation is on the way to where it becomes ubiquitous.

Hopefully the less progressive lands (like the USA) will join this standard sometime this century. Or maybe not. But there's no need for a device targeted for a global acceptance to specifically pander to the backward.
1393  Bitcoin / Hardware / Re: Block Erupter: Dedicated Mining ASIC Project (Open for Discussion) on: November 21, 2012, 10:40:50 PM
That's because the routing really sucks on Spartan-6 FPGAs. I'm not convinced an ASIC would have the same problem.
The argument for the sea-of-hashes design can be derived from the classic analysis made by Mead & Conway and contemporaries.

Consider a circular sea-of-gates big enough to implement many copies of the Bitcoin double-SHA256.

SHA256 is basically a pair of 32-bit wide shift registers with some somewhat convoluted feedback logic. The feedback logic is active (doing the actual computation) whereas D-type flip-flops and connections are passive (just shuffle the signal around). Let X be the average connection length in this design.

Now think about unrolling the above design over a plane. You'll need the values of the feedback terms from the neighbouring cells w-2,w-7,w-15,w-16. Your average connection length rises (2+7+15+16)/4 times or about 10*X . So the passive losses in the interconnect rose about an order of magnitude. You could compensate for this by removing some D-type flip-flop stages and slowing down the clock. By definition you can't really remove the active logic gates that compute the feedback terms. As an extreme you can have a purely combinatorial SHA-256 hasher doing everything in single cycle of a rather slow clock.

I'm not aware of any neat analytical solution for the above optimization problems. But the numerical experiments show that racing the combinatorial signals over vast expanses of silicon is a losing game. Speed of light in MOS transmission line is much less than the speed of light in vacuum. This analysis can be made without actual place-and-route, it is sufficient to have an estimated distribution of the inter-connection lenghts that create planar graph for the logic. I don't recall if sphere-of-gates instead of sea-of-gates is a win, but sphere-of-gates has an obvious termal problem even if we could somehow manufacture it.

In summary: wafer-scale integration was attempted several times in the past without an obvious win. Check out the history before you follow that trail.
1394  Bitcoin / Development & Technical Discussion / Re: ANN: Announcing code availability of the bitsofproof supernode on: November 21, 2012, 09:26:09 PM
I would be interested to know what extra data would support forensic accounting, and would attempt to derive it from the server's interaction with peers.
The additional data that is not available from the blockchain:

1) true timestamps for transactions first (and last) seen over p2p
2) true timestamps for blocks first seen over p2p
3) non-volatile database of transactions seen over p2p (a.k.a. mempool, but non-volatile) pruned of the entries actually recorded in the blockchain.
4) a way to quickly locate only orphaned blocks without having to scan the whole table of blocks, really just an additional index to the blockchain storage, but explicitly indexing all the losing chains. This in theory is available from the blockchain, but under current architecture it is difficult to obtain this information. In effect the whitewash of the bitcoin transaction history is ongoing when the tools keep only the winning chain.

Thanks.
1395  Bitcoin / Development & Technical Discussion / Re: ANN: Announcing code availability of the bitsofproof supernode on: November 21, 2012, 08:45:53 PM
This is about independent global fiscal checks.
Are you talking about pure binary yes/no consistency check audit?

Or are you talking about open-ended auditing for the purpose of discovering normal vs. abnormal transaction patterns?

I've spoken a while back with an experienced forensic accounting professional and we discussed various things that would require keeping true time vs. block time stamp. It would also require keeping a separate database of the in-flight transactions, ones that aren't yet recorded in the blockchain.

4) provide a way of obtaining sincere ledger / audit log for the transactions with multiple timestamps:
4a) true time when first seen on the p2p net
4b) true time when first seen in a block
4c) block time when seen in a block
4d) true time when some block caused a reorg and un-confirmed the transaction
4e) true time when other block reconfirmed the transaction
4f) block time when reconfirmed
4g) etc.. for each subsequent chain reorganization

The observation he had made is that the blockchain is a perfect whitewash: it leaves no trace of the attempted double-spends or other malarkey that would be of great interest to a forensic auditor, e.g.

a) list of addresses involved in the attempted double-spends
b) list of addresses involved in transactions recorded in the orphaned sub-chains but not recorded on the winning chain.

I'm not actually suggesting that you actually implement those auditing reports. But it would be nice if your architecture made possible generating such reports.
1396  Alternate cryptocurrencies / Altcoin Discussion / Re: How to clone Bitcoin to create your own crypto currency / crypto shares system on: November 20, 2012, 02:32:55 PM
for people new to this concept it would be nice behavior to print a line: bitcoind daemon running, please run bitcoind help from separate command instance
When I was young I thought so too. But now I understand this ritual.

It is like a secret handshake of the members of masonic lodge or some other gang. It allows to quickly recognize impostors and other newbies.

You can be sure that almost nobody will start their post: I'm a complete newbie to the computers, have very little idea how they work and understand only how to click with the mouse. I'm also slow with this "typing commands" thing. Listing the running processes in Task Manager/Resource Monitor (or equivalent method) is beyond me.

On the other hand people will freely post: "I clicked, black window popped up and disappeared." or "typed a command and nothing happened".

It declares the same informational content. In addition to the above one can frequently guess just from the writing style if the newbie is going to be a friendly, curious, inteligent person or a nasty, obnoxious dumbass. Or maybe somebody inbetween? Like a person who claims to be a writer but doesn't know which side of the postal stamp to lick?

As with many human social rituals: it works because it saves time overall for the society.
1397  Bitcoin / Development & Technical Discussion / Re: Hardware wallet wire protocol on: November 20, 2012, 03:50:37 AM
P.S.  NTP has been around since 1985, if someone doesn't know if their clock is right or not, they deserve what they get.
I'm fully with you on the use of ISO format for dates, but I disagree on the NTP for autoconfiguration.

NTP abuse is so rampant that it now has its own notable Wikipedia article:

http://en.wikipedia.org/wiki/NTP_server_misuse_and_abuse

And thats just a tip of iceberg. In many locales servers like "time.windows.com" are unreachable because of the rampant abuse by the various software licensing/subscription enforcement schemes. McAfee private-label products were implicated in DDoS-ing Swiss government NTP servers, if I recall correctly. And apparently the situation is slowly getting worse, not better.
1398  Bitcoin / Development & Technical Discussion / Re: Hardware wallet wire protocol on: November 20, 2012, 01:56:54 AM
The clock might be wrong... but it's not gonna days or weeks wrong.
Hardcore Americanism detected!  Grin

The month-day-year versus day-month-year ambiguity with dates is an endless source of the errors that stick is thinking about. People in USA don't see is as often because most of the BIOSes and other low-level tools use the American layout. But it trips over many Europeans.

Wait till Americans start importing Czech-made wallets that use day-month-year order...
1399  Bitcoin / Hardware wallets / Re: [ANN] Hardware wallet project on: November 19, 2012, 09:46:41 PM
@2112: I edited the post above at the same time you sent the reply, so I repost it once again. Thanks for your feedback, I think this is valuable information and I'm not so experienced in building hardware stuff. We'll have physical prototype in next days, so I'll focus on the eyelet robustness. Nothing is set in stone yet, so if I'll see any possible issue with it, we'll redesign the casing.
I sincerely wish you good luck with this. Now that I had a moment to think, I realize that most of the short-run die-casting manufacturers are working in the toy industry. They may not have the required strength information available at all. The toy industry is strictly form over function: the products are almost exclusively for display only. They will talk about surface smoothness or detail fidelity, not about internal voids or ultrasonic inspection or measuring the residual stress by X-ray diffraction.

I'm not mech-eng myself, but we used the mech-eng labs as a subsitute during the construction in the el-eng building. One can learn a lot by just passively staring at the cool experiments they make.

1400  Alternate cryptocurrencies / Altcoin Discussion / Re: How to clone Bitcoin to create your own crypto currency / crypto shares system on: November 19, 2012, 08:32:45 PM
Probably it should say so... (some old bitcoin weirdness)
Actually this weirdness is as old as Unix, so it dates to mid-seventies of the last century. It allowed people to work efficiently with multiple programs in a single session over 300/1200bps modems.

And the "no news is good news" principle is even older than that.

If you are spooked by bitcoind running silently then use an argument "-printtoconsole" or put "printtoconsole=1" in "bitcoin.conf". You will get a nice, reassuring real-time spew scrolling in the window you used to start the bitcoin server.
Pages: « 1 ... 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 58 59 60 61 62 63 64 65 66 67 68 69 [70] 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 »
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!