Enumerations within a struct - C vs C++ - Stack Overflow

Parallel.For uses 50-70% of CPU part 2 (narrowed down to some BigInteger math)

A while ago I asked about this problem I had with Parallel.For where it used all cores but only at ~60%. Thanks to all the excellent advice I received here I was able to narrow down the problem to 3 parts of the code. 1. The way I was creating the IEnumerable which I replaced with a simple array (special thanks to u/panoskj) 2. A bug where different threads were actually writing to the same buffers inside ICompareService which was a global instance instead of being created for each thread (but this also suffers from 3). 3. Some math involving BigInteger on this line.
Out of these 3 I've fixed 1 and 2 and they make sense but I can't figure out why the third one is causing problems and I need help again (haven't published these changes on GitHub due to being incomplete). If I comment out L329 and replace L467 with a simple array comparison the parallel loop can successfully use 100% CPU on all cores.
I am creating both the calculator and the generator (starting point) inside each thread although I don't think it matters. The full calculator code can be seen here: https://github.com/Coding-Enthusiast/FinderOutetree/masteSrc/FinderOuteBackend/Asymmetric/EllipticCurve The relevant code for the method being called is this (Elliptic Curve point multiplication):
internal EllipticCurvePoint MultiplyChecked(BigInteger k, EllipticCurvePoint point) { EllipticCurvePoint result = EllipticCurvePoint.InfinityPoint; EllipticCurvePoint addend = point; while (k != 0) { if ((k & 1) == 1) { result = AddChecked(result, addend); } addend = DoubleChecked(addend); k >>= 1; } return result; } internal EllipticCurvePoint AddChecked(EllipticCurvePoint point1, EllipticCurvePoint point2) { if (point1 == EllipticCurvePoint.InfinityPoint) return point2; if (point2 == EllipticCurvePoint.InfinityPoint) return point1; BigInteger m; if (point1.X == point2.X) { if (point1.Y != point2.Y) // (x,y) + (x,−y) = O { return EllipticCurvePoint.InfinityPoint; } // Point double or (x,y) + (x,y) m = ((3 * point1.X * point1.X) + curve.A) * (2 * point1.Y).ModInverse(curve.P); // Note that since points are on a group with a prime (mod p) all of them do have multiplicative inverses. } else // point1 != point2. (x1,y1) + (x2,y2) { m = (point1.Y - point2.Y) * (point1.X - point2.X).ModInverse(curve.P); } BigInteger x3 = ((m * m) - point1.X - point2.X).Mod(curve.P); BigInteger y3 = (m * (point1.X - x3) - point1.Y).Mod(curve.P); return new EllipticCurvePoint(x3, y3); } internal EllipticCurvePoint DoubleChecked(EllipticCurvePoint point1) { if (point1 == EllipticCurvePoint.InfinityPoint) return point1; BigInteger m = 3 * point1.X * point1.X * (2 * point1.Y).ModInverse(curve.P); BigInteger x3 = ((m * m) - (2 * point1.X)).Mod(curve.P); BigInteger y3 = (m * (point1.X - x3) - point1.Y).Mod(curve.P); return new EllipticCurvePoint(x3, y3); } 
EllipticCurvePoint is a struct with 2 readonly BigInteger properties
public struct EllipticCurvePoint : IEquatable { public EllipticCurvePoint(BigInteger x, BigInteger y) { X = x; Y = y; } public BigInteger X { get; } public BigInteger Y { get; } 
submitted by Coding_Enthusiast to csharp [link] [comments]

Advice for an incoming CS Freshman in India

Hey, csMajors!
I'll be attending a reputed private University for Computer Science this year. My goals for the next four years are as follows -
  1. Building a strong understanding of Data Structures and Algorithms
  2. Landing an internship in a good company (Including, but not limited to, FAANG Companies)
  3. Exploring my research interest (currently primarily interested in Distributed Systems and concurrency, Databases, Distributed Ledgers, Blockchain, etc)
  4. If I find myself more inclined towards it, landing a research internship in a good school (again, including, but not limited to, the CS Ivies and similar schools) sometime around my 3rd year-4th year
  5. Building a heavily backend-oriented capstone-level project (something like a database or a VCS, which involves heavy use of Data Structures and Algorithms)
TL;DR - Given what I now know and what I plan to do, how can I make the best use of my time in the next 4 years to meet as many of my goals as possible?
Now, read on.
For the rest of the Indians here, worried about why competitive programming is not a part of my goals -
  1. I have tried it before. I enjoy the problem-solving aspect of the whole thing, but I'm not a big fan of rat-race-ization of the whole domain that's happening.
  2. I Intend to learn DSA on my own well enough to do the interviews at the end of the 4 years (if I don't opt for higher studies straight out of college, that is)
  3. I prefer project-oriented learning
Now, Here's what I'm already doing to align myself with those goals, and prepare myself to meet the challenges that I'll encounter along the way -
  1. I'm 90% done with Harvard's CS50x 2020
  2. I'm following MIT's Mathematics for Computer Science on a regular basis, and once this is done I'll be following MIT's Introduction to Algorithms (for which Mathematics for Computer Science is a pre-requisite)
  3. Occasionally reading research publications (mostly blockchain related stuff, but I'm not restricting myself. I did spend quite some time on the Libra whitepaper, as well as the Bitcoin Whitepaper. I'm looking to exploring the IPFS whitepaper next)
  4. Following the Computer Science track on Brilliant
Here's what I already know, and what I can already do -
  1. Python (Intermediate - TDD, OOP, Making API Calls, Websockets, Decorators, etc)
  2. Javascript (Amateur - I learned by using React and Vue, writing a few applications along the way, making a few small websites here and there)
  3. C (Amateur - Know how to use malloc, free, structs and how they work - Most of this was learned from CS50x)
  4. Certifications in Django and Django REST Framework - Built a few small applications for my school with Django (election system, guest pass manager, etc - mostly from Udemy
  5. SQL (some from school, but I've got a certification in it from the Web Applications for Everybody Course (U of M)
  6. Linux (using Ubuntu since 14.04 as my daily driver)
I'm interestedpretty serious. I love reading and want to make the best use of my 4 years in University so that I can meet my (admittedly pretty ambitious) goals. I am very interetested in the field of Computer Science, and would love to learn more - I enjoy the more theoretical, mathematical, and low-level parts as well. If you've read till here, thank you for the time! I appreciate any advice the wise greybeards of this subreddit have for me. What projects can I do that will help me reach there? are there any books I can read to make the best of it? Any specific material I should follow?
Thank you in advance.
submitted by 0v3rr1de to csMajors [link] [comments]

Advice for an incoming CS Freshman in India

Hey cscareerquestions! I know that this post is a bit out of the scope of this sub, but please bear with me :D
I'll be attending a reputed private University for Computer Science this year. My goals for the next four years are as follows -
  1. Building a strong understanding of Data Structures and Algorithms
  2. Landing an internship in a good company (Including, but not limited to, FAANG Companies)
  3. Exploring my research interest (currently primarily interested in Distributed Systems and concurrency, Databases, Distributed Ledgers, Blockchain, etc)
  4. If I find myself more inclined towards it, landing a research internship in a good school (again, including, but not limited to, the CS Ivies and similar schools) sometime around my 3rd year-4th year
  5. Building a heavily backend-oriented capstone-level project (something like a database or a VCS, which involves heavy use of Data Structures and Algorithms)
TL;DR - Given what I now know and what I plan to do, how can I make the best use of my time in the next 4 years to meet as many of my goals as possible?
Now, read on.
For the rest of the Indians here, worried about why competitive programming is not a part of my goals -
  1. I have tried it before. I enjoy the problem-solving aspect of the whole thing, but I'm not a big fan of rat-race-ization of the whole domain that's happening.
  2. I Intend to learn DSA on my own well enough to do the interviews at the end of the 4 years (if I don't opt for higher studies straight out of college, that is)
  3. I prefer project-oriented learning
Now, Here's what I'm already doing to align myself with those goals, and prepare myself to meet the challenges that I'll encounter along the way -
  1. I'm 90% done with Harvard's CS50x 2020
  2. I'm following MIT's Mathematics for Computer Science on a regular basis, and once this is done I'll be following MIT's Introduction to Algorithms (for which Mathematics for Computer Science is a pre-requisite)
  3. Occasionally reading research publications (mostly blockchain related stuff, but I'm not restricting myself. I did spend quite some time on the Libra whitepaper, as well as the Bitcoin Whitepaper. I'm looking to exploring the IPFS whitepaper next)
  4. Following the Computer Science track on Brilliant
Here's what I already know, and what I can already do -
  1. Python (Intermediate - TDD, OOP, Making API Calls, Websockets, Decorators, etc)
  2. Javascript (Amateur - I learned by using React and Vue, writing a few applications along the way, making a few small websites here and there)
  3. C (Amateur - Know how to use malloc, free, structs and how they work - Most of this was learned from CS50x)
  4. Certifications in Django and Django REST Framework - Built a few small applications for my school with Django (election system, guest pass manager, etc - mostly from Udemy
  5. SQL (some from school, but I've got a certification in it from the Web Applications for Everybody Course (U of M)
  6. Linux (using Ubuntu since 14.04 as my daily driver)
I'm pretty serious. I love reading and want to make the best use of my 4 years in University so that I can meet my (admittedly pretty ambitious) goals. I am very interetested in the field of Computer Science, and would love to learn more - I enjoy the more theoretical, mathematical, and low-level parts as well. If you've read till here, thank you for the time! I appreciate any advice the wise greybeards of this subreddit have for me. What projects can I do that will help me reach there? are there any books I can read to make the best of it? Any specific material I should follow?
Thank you in advance.
submitted by 0v3rr1de to cscareerquestions [link] [comments]

[ANN] RustCrypto: `k256` and `p256` v0.2.0: pure Rust secp256k1 and NIST P-256 ECDH and ECDSA (no_std/embedded-friendly)

Announcing v0.4.0 releases of these RustCrypto elliptic curve crates:
(see also ecdsa v0.7 and p384 v0.3)
The major notable new features in these releases are:

Elliptic Curve Diffie-Hellman

Key exchange protocol which establishes a shared secret between two parties.

Elliptic Curve Digital Signature Algorithm

Pervasively used public-key scheme for authenticating messages.

Notes on this release

These crates contain experimental pure Rust implementations of scalafield arithmetic for the respective elliptic curves (secp256k1, NIST P-256). These implementations are new, unaudited, and haven't received much public scrutiny. We have explicitly labeled them as being at a "USE AT YOUR OWN RISK" level of maturity.
That said, these implementations utilize the best modern practices for this class of elliptic curves (complete projective formulas providing constant time scalar multiplication).
In particular:
This release has been a cross-functional effort, with contributions from some of the best Rust elliptic curve cryptography experts. I'd like to thank everyone who's contributed, and hope that these crates are useful, especially for embedded cryptography and cryptocurrency use cases.
EDIT: the version in the title is incorrect. The correct version is v0.4.0, unfortunately the title cannot be edited.
submitted by bascule to rust [link] [comments]

Using the data after parsing it through JSON - Swift

I am a beginner Swift coder, and am attempting to parse JSON data from the NewsAPI website and use it. I have successfully parsed the JSON data and it is organized via my structs, but I am unable to set it to a variable outside of the background thread, use it outside of it. Any suggestions? I have included my code.
Thank you

import UIKit class ViewController: UIViewController { var test:Int? override func viewDidLoad() { super.viewDidLoad() GrabJSON() } @IBOutlet weak var labelTime: UILabel! func GrabJSON() { // hit the API endpoint let urlString = "http://newsapi.org/v2/everything?q=bitcoin&from=2020-05-13&sortBy=publishedAt&apiKey=_________(it actually is here)" let url = URL(string: urlString) guard url != nil else { return } let session = URLSession.shared let dataTask = session.dataTask(with: url!) { (data, response, error) in // check for errors if error == nil && data != nil { // if there is no error and there is data let decoder = JSONDecoder() do { //parse json let newsFeed = try decoder.decode(NewsFeed.self, from: data!) print(newsFeed) } catch { print("error in JSON parsing") } } } // makes the API call dataTask.resume() } 
submitted by georgethornguy to swift [link] [comments]

Colin gives a rundown on Nexus layered architecture

This is an excerpt from a much larger impromptu Q&A on Nexus Telegram, and provides an excellent overview of Nexus architecture. (edited for clarity)
Paul Screen, [10.09.19 22:03]
[In reply to CryptoJoker]
yes it is. There's no question that ethereum and it's direct competitors that offer turing-complete programmable contracts are very powerful. But when you actually look at the requirements of businesses trying to onboard to blockchain, we found that most of them just need simple requirements met and don't need all of the complexity and baggage that comes with it.

CryptoJoker, [10.09.19 22:04]
[In reply to Paul Screen]
ok so ca u run only simple multi conditional transactions on the nexus VM or facebook type DAPPs on nexus ?

Viz., [10.09.19 22:09]
[In reply to CryptoJoker]
Nah the VM is the interpreter so the language fits on top, we haven’t designed nexus to be a programming language this is an approach we didn’t agree with. It is APi based so you can code in any language and work with the functionality of the blockchain layer for what you need it to do. No you can’t port EVM code into Nexus

CryptoJoker, [11.09.19 00:22]
[In reply to Viz.]
when you make an api request, does this result in computations done on the blockchain ?

Viz., [11.09.19 00:23]
It depends on the API request, if you do let’s say users/list/notifications then no as this is reading data, but finance/credit/account would since it broadcasts a transaction with OP::CREDIT

CryptoJoker, [11.09.19 00:24]
[In reply to Viz.]
ok thanks , and can you provide me an idea of the flexbility of the VM on nexus ? can it run like facebook type dapps for example ?

Viz., [11.09.19 00:28]
It depends, it depends on what you want the blockchain to do and don’t. Dapp is an overused word and overstated in capability because a blockchain isn’t a computer and shouldn’t ever be, it’s a verifier. So, if you wanted to make a social network on nexus, trade tokens, chat, sure you could. A lot of functionality will be in the logical Layer as there’s no point to compute let’s say an image compression on the blockchain, you would on the logical Layer compress it, hash it, then build an object Register to hold the meta data associated with it that includes the checksum, include description. Then to update, you change the state in the object register, etc. If you wanted to do conditions in some of these interactions you could program the Boolean expression in such as, I’ll sell you this object for 5 NXS, someone is able to claim the transfer based on the condition of their debit, so on.

CryptoJoker, [11.09.19 00:29]
[In reply to CryptoJoker]
how does the functinonality of the nexus scripts compare to that of bitcoin scripts ?
is it fair to assume this:
bitcoin scripting < nexus scripting < ethereum type smart contracts ?
it seems like its mostly built to handle only transactions ...

Viz., [11.09.19 00:31]
[In reply to CryptoJoker]
Not really, our architecture is completely different, hard to compare functionality. Let’s just say bitcoin scripts are slow, clunky, and stack based and only handle a Boolean expression to spend inputs, ours is a register based system with primitive operations and conditions that all interact to provide contract functionality

Viz., [11.09.19 00:31]
[In reply to CryptoJoker]
You miss what the term register means then
And “programmable data structures”

CryptoJoker, [11.09.19 00:31]
[In reply to Viz.]
yes, this is the first time i am encountering this
i also dont have a programming background unfortunately

Viz., [11.09.19 00:33]
A register is a structure that on hardware is what your cpu uses to store numbers in low latency memory (close to the CPU in its internal cache).... hang on, switching to computer...

CryptoJoker, [11.09.19 00:34]
[In reply to Viz.]
ok this is all fine and good, but i guess for a layman like me i just wanna know what its functionalities are in comparison to EVM type VMs ...
what can it do in comparison to EVMs, and is it fasteslower, more expensive/cheaper ?

Viz., [11.09.19 00:36]
Let me explain it like this: Ethereum is like everything put in one bucket, it has a turing complete byte code because they imagined you could program it like a universal computer. The reality is though, that most people abstract away from the EVM and use it for pure data storage, or managing accounts and tokens. They include operations like EXP for example, and use what is termed "Big Numbers" which are numbers that are in the range of 2^256 which is a number with over a hundred zeros. This has led to significant bottlenecks, and little value in being turing complete even though this was their value propositiion.

Viz., [11.09.19 00:36]
Now we get to Bitcoin, which was deliberatly not turing complete, and its scripts were designed to control the conditions on spending inputs in the UTXO model, in which it has proven useful, and some scripts such as OP_RETURN have allowed people to store data on it, but then again it aws not useful for much more than that.

Viz., [11.09.19 00:37]
Then we get to us, think of us between bitcoin and ethereum, but building contracts to act like contracts between people, rather than computer code.

Viz., [11.09.19 00:41]
So think of us as a blend of the two concepts, but in a way that is practical and useful for developers. From my research of talking to many companies that were using blockchain, I deduced a simple common denominator: nobody used ethereum for the turing completeness, they used it to store data. This was the foundation of the architecture that I developed for tritium that is a seven layer stack. So I'm going to break this down, and hope this communicates how it functions to create smart contracts or dapps in just about any capacity that's needed:

Viz., [11.09.19 00:41]
  1. Network - this is responsible for end to end communication between nodes, handling the relaying and receiving of ledger level data

Viz., [11.09.19 00:43]
  1. Ledger - this is responsible for ensuring all data is formed under consensus and is immutable by nature. This is where your 'sigchain' or blockchain account exists. A sigchain is a decentralized blockchain account that allows you to login from any node with a username, password, and pin without the need for wallet.dat files or constantly rescanning the database. This is an important piece to how the layers above work as well, think of it as a personal blockchain that allows decentralized access through the login system that does not store any credentials, but rather deterministically creates a 'lock' mathematically that only your credentials can unlock, using a few different cryptographic functions I won't name here

Viz., [11.09.19 00:46]
  1. Register - this layer is the data retention layer, or the layer that stores information relating to users. A register takes two forms: state and object. A state register is jsut a simple register that can store data in any sequence with no formatting enforced by the ledger. This would be for applications that have a state they want to remain immutable whih they can record in a state register. The second form is an object register, which is a programmable data type. What this means is that I can specify the fields of this register, and set some of the fields to be mutable or immutable such as lets say S/N would be immutable, but notes mutable. This allows objects to take the form much like a struct or class in object oritented languages, that can be accessed by any node, and only written to by the owning sigchain. Now registers sit on top of the ledger, and they can be transferred between sigchains or users, allowing them to take a natural form as assets or simple objects that would be included in a decentralized application such as a crypto kitty, or a post yoj make on social media, etc. This layer is responsible for managing all these states and ensuring the specified fields in these states are immutable, while other fi9elds can be updated like a program would do as it operates.

Viz., [11.09.19 00:51]
  1. Operation - this layer is what gives context to a register and causes some action to take place. It includes two aspects to this layer, Primitive operations and Conditional operations. A contract object is a self contained object containing: a register pre-state (the register that is being operated on), a primitive operation (only one primitive operation per contract), and a set of conditions (any amount of conditional ops may be used for a fee of course). The primitive operations are basic ones like WRITE, APPEND, DEBIT, CREDIT, TRANSFER, CLAIM, CREATE, AUTHORIZE, TRUST, CONBASE, GENERATE. Each of these has a specific operation on the register it is initiated in. This is how you would maintain the state of a decentralized app, lets say crypto kitties, you have an object register that you create with OP::CREATE that has a specific meta data format associated with it, you then OP::TRANSFER it to someone else, but you gie a condition saying they must send 500 NXS beforehand, and this is the stiuplation of the TRANSFER being CLAIMABLE. When this ondition is satisfied you are able to claim the other point allowing for forms of exhange. Other stipulations or conditions could be arbitration, escrow, etc. Conditions are when there is an interaction between two actors or sigchains, which happens with a DEBIT or TRANSFER. Otherwise the other primitive oeprations act on the register such as changing its state.

Viz., [11.09.19 00:52]
  1. API - This layer is responsible for giving an interface for the programmer to build their DAPP. This gies them direct access to login, create registers, create accounts, send coins, read data, manage notifications, etc. This is the layer develoeprs will interact with when building applications.

Viz., [11.09.19 00:53]
  1. Logical - This is the first 'developer' layer, menaing that this is the layer that will give most of the logic to the application. This coudl be simple things like, send message to this user if they have this object that has a value of 'you're my friend' ,or antything else. This layer is the 'backend' of the dapp, and what provides a lot of the functionality. States can be read and written into the register layer, information from the ledger can be shared, stipulations on interactions can be applied. etc.

Viz., [11.09.19 00:54]
  1. Interface - This is the 'user' layer, where the user will interact with. This in the facebook example would be the website you go to, and all the buttons that do fun stuff. This is the last layer of the 'developer' application space.

CryptoJoker, [11.09.19 00:54]
thank you
big applause!!!!

CryptoJoker, [11.09.19 00:56]
ok so to summarize my understanding of this
3 allows for creation and transfer of digital assets/objects
4 governs the operations that on objects in 3
5 interface between dapp logic and registeoperations layer
  1. this is where the "dapp" is written by developers
am i right ?

Viz., [11.09.19 00:57]
So as you can see, all these layers together are what form the foundation of a dapp, with the blockchain doing some things, the application does other things. They togheter give the blockchain scability and easy to build on, and also give the appliation powerful tools to utilize. For example of an object register, your NXS account. It contains fields identifier and balance. The identifier identfies the token's contract-id or object register, and the balance keeps track of how much you have at stake. Object registers can be polymorphic though, so you can create an object register with tehse two base types, but add, notes, which you could fill with personal notes and the DEBIT and CREDIT operations would process it off of the base object, or the account menaing that you can expand from these basic objects and create many different types and uses, creating object oriented and polymorphic behavior

Viz., [11.09.19 00:57]
3 is simply where they are store, it takes 4 to create the object
5 yes
6 yes plus 7, the dapp space is layers 6 and 7 together. If the dapp developer is really good though, they make custom API's with more complex contracts under the hood to provide additional functionality to their dapp, but we currently abstract the developer away from this to prevent them making mistakes that could lose people a lot of money

CryptoJoker, [11.09.19 00:59]
whereas for the EVM, 3,4,5,6 and 7 are all bundles into one entitiy, am i right ?

Viz., [11.09.19 00:59]
And last note, on layer 4, the conditional statements. These also operate on a register based VM that processes the conditional statements, and they can be grouped with as many different conditions as desired, so they can grow into quite complex contracts like we would see with legal contracts.

Viz., [11.09.19 01:00]
EVM doesn't really have layers
It's just EVM opcodes, and then the compiler for solidity which creates the byte code, so maybe two layers
Same with bitcoin scripts
But bitcoin scripts dont have a compiler that creates the byte code so you have to program it as a type of assembly

Viz., [11.09.19 01:01]
So long story short is, our techniques and architecture are quite unique, and designed around years of market research to ensure that it was built as something that people could use easily, but also powerful enough to power the dapps people want to see

Viz., [11.09.19 01:03]
The login account is really important for adoption in my opinion, because users having to manage keys wont bode well for applications that expand, lets say like supply chains or other mobile applications. Managing keys in a file on your computer I think is a big hurdle to mainstream adoption, the other one is the complexity of EVM and how little practical appliation it has, even though it contains a lot of functionality, most of it us unused or abstracted away from
submitted by scottsimon36 to nexusearth [link] [comments]

Threadripper KVM GPU Passthru: Testers needed

TL;DR: Check update 8 at the bottom of this post for a fix if you don't care about the history of this issue.
For a while now it has been apparent that PCI GPU passthrough using VFIO-PCI and KVM on Threadripper is a bit broken.
This manifests itself in a number of ways: When starting a VM with a passthru GPU it will either crash or run extremely slowly without the GPU ever actually working inside the VM. Also, once a VM has been booted the output of lspci on the host changes from one kind of output to another. Finally the output of dmesg suggests an issue bringing the GPU up from D0 to D3 power state.
An example of this lspci before and after VM start, as well as dmesg kernel buffer output is included here for the 7800GTX:
08:00.0 VGA compatible controller: NVIDIA Corporation G70 [GeForce 7800 GTX] (rev a1) (prog-if 00 [VGA controller]) [ 121.409329] virbr0: port 1(vnet0) entered blocking state [ 121.409331] virbr0: port 1(vnet0) entered disabled state [ 121.409506] device vnet0 entered promiscuous mode [ 121.409872] virbr0: port 1(vnet0) entered blocking state [ 121.409874] virbr0: port 1(vnet0) entered listening state [ 122.522782] vfio-pci 0000:08:00.0: enabling device (0000 -> 0003) [ 123.613290] virbr0: port 1(vnet0) entered learning state [ 123.795760] vfio_bar_restore: 0000:08:00.0 reset recovery - restoring bars ... [ 129.534332] vfio-pci 0000:08:00.0: Refused to change power state, currently in D3 08:00.0 VGA compatible controller [0300]: NVIDIA Corporation G70 [GeForce 7800 GTX] [10de:0091] (rev ff) (prog-if ff) !!! Unknown header type 7f Kernel driver in use: vfio-pci 
Notice that lspci reports revision FF and can no longer read the header type correctly. Testing revealed that pretty much all graphics cards except Vega would exhibit this behavior, and indeed the output is very similar to the above.
Reddit user wendelltron and others suggested that the D0->D3 transition was to blame. After having gone through a brute-force exhaustive search of the BIOS, kernel and vfio-pci settings for power state transitions it is safe to assume that this is probably not the case since none of it helped.
AMD representative AMD_Robert suggested that only GPUs with EFI-compatible BIOS should be able to be used for passthru in an EFI environment, however, testing with a modern 1080GTX with EFI bios support failed in a similar way:
42:00.0 VGA compatible controller: NVIDIA Corporation Device 1b80 (rev a1) and then 42:00.0 VGA compatible controller: NVIDIA Corporation Device 1b80 (rev ff) (prog-if ff) !!! Unknown header type 7f 
Common to all the cards was that they would be unavailable in any way until the host system had been restarted. Any attempt at reading any register or configuration from the card would result in all-1 bits (or FF bytes). The bitmask used for the headers may in fact be what is causing the 7f header type (and not an actual header being read from the card). Not even physically unplugging and re-plugging the card, rescanning the PCIe bus (with /sys/bus/pci/rescan) would trigger any hotplug events or update the card info. Similarly, starting the system without the card and plugging it in would not be reflected in the PCIe bus enumeration. Some cards, once crashed, would show spurious PCIe ACS/AER errors, suggesting an issue with the PCIe controller and/or the card itself. Furthermore, the host OS would be unable to properly shut down or reboot as the kernel would hang when everything else was shut down.
A complete dissection of the vfio-pci kernel module allowed further insight into the issue. Stepping through VM initialization one line at a time (yes this took a while) it became clear that the D3 power issue may be a product of the FF register issue and that the actual instruction that kills the card may have happened earlier in the process. Specifically, the function drivers/vfio/pci/vfio_pci.c:vfio_pci_ioctl, which handles requests from userspace, has entries for VFIO_DEVICE_GET_PCI_HOT_RESET_INFO and VFIO_DEVICE_PCI_HOT_RESET and the following line of code is exactly where the cards go from active to "disconnected" states:
if (!ret) /* User has access, do the reset */ ret = slot ? pci_try_reset_slot(vdev->pdev->slot) : pci_try_reset_bus(vdev->pdev->bus); 
Commenting out this line allows the VM to boot and the GPU driver to install. Unfortunately for the nVidia cards my testing stopped here as the driver would report the well known error 43/48 for which they should be ashamed and shunned by the community. For AMD cards a R9 270 was acquired for further testing.
The reason this line is in vfio-pci is because VMs do not like getting an already initialized GPU during boot. This is a well-known problem with a number of other solutions available. By disabling the line it is neccessary to use one of the other solutions when restarting a VM. For Windows you can disable the device in Device Manager before reboot/shutdown and re-enable it again after the restart - or use login/logoff scripts to have the OS do it automatically.
Unfortunately another issue surfaced which made it clear that the VMs could only be stopped once even though they could now be rebooted many times. Once they were shut down the cards would again go into the all FF "disconnect" state. Further dissection of vfio-pci revealed another instance where an attempt to reset the slot that the GPU is in was made: in drivers/vfio/pci/vfio_pci.c:vfio_pci_try_bus_reset
if (needs_reset) ret = slot ? pci_try_reset_slot(vdev->pdev->slot) : pci_try_reset_bus(vdev->pdev->bus); 
When this line is instead skipped, a VM that has had its GPU properly disabled via Device Manager and has been properly shutdown is able to be re-launched or have another VM using the same GPU launched and works as expected.
I do not understand the underlying cause of the actual issue but the workaround seems to work with no issues except the annoyance of having to disable/re-enable the GPU from within the guest (like in ye olde days). Only speculation can be given to the real reason of this fault; the hot-reset info gathered by the ioctl may be wrong, but the ACS/AER errors suggest that the issue may be deeper in the system - perhaps the PCIe controller does not properly re-initialize the link after hot-reset just as it (or the kernel?) doesn't seem to detect hot-plug events properly even though acpihp supposedly should do that in this setup.
Here is a "screenshot" of Windows 10 running the Unigine Valley benchmark inside a VM with a Linux Mint host using KVM on Threadripper 1950x and an R9 270 passed through on an Asrock X399 Taichi with 1080GTX as host GPU:
This is the culmination of many weeks of debugging. It is interesting to hear if anyone else is able to reproduce the workaround and can confirm the results. If more people can confirm this then we are one step closer to fixing the actual issue.
If you are interested in buying me a pizza, you can do so by throwing some Bitcoin in this direction: 1KToxJns2ohhX7AMTRrNtvzZJsRtwvsppx
Also, English is not my native language so feel free to ask if something was unclear or did not make any sense.
Update 1 - 2017-12-05:
Expanded search to non-gpu cards and deeper into the system. Taking memory snapshots of pcie bus for each step and comparing to expected values. Seem to have found something that may be the root cause of the issue. Working on getting documentation and creating a test to see if this is indeed the main problem and to figure out if it is a "feature" or a bug. Not allowing myself to be optimistic yet but it looks interesting, it looks fixable at multiple levels.
Update 2 - 2017-12-07:
Getting a bit closer to the real issue. The issue seems to be that KVM performs a bus reset on the secondary side of the pcie bridge above the GPU being passed through. When this happens there is an unintended side effect that the bridge changes its state somehow. It does not return in a useful configuration as you would expect and any attempt to access the GPU below it results in errors.
Manually storing the bridge 4k configuration space before the bus reset and restoring it immediately after the bus reset seems to magically bring the bridge into the expected configuration and passthru works.
The issue could probably be fixed in firmware but I'm trying to find out what part of the configuration space is fixing the issue and causing the bridge to start working again. With that information it will be possible to write a targeted patch for this quirk.
Update 3 - 2017-12-10:
Begun further isolation of what particular registers in the config space are affected unintentionally by the secondary bus reset on the bridge. This is difficult work because the changes are seemingly invisible to the kernel, they happen only in the hardware.
So far at least registers 0x19 (secondary bus number) and 0x1a (subordinate bus number) are out of sync with the values in the config space. When a bridge is in faulty mode, writing their already existing value back to them brings the bridge back into working mode.
Update 4 - 2017-12-11 ("the ugly patch"):
After looking at the config space and trying to figure out what bytes to restore from before the reset and what bytes to set to something new it became clear that this would be very difficult without knowing more about the bridge.
Instead a different strategy was followed: Ask the bridge about its current config after reset and then set its current config to what it already is; byte by byte. This brings the config space and the bridge back in sync and everything, including reset/reboot/shutdown/relaunch without scripts inside the VM, now seems to work with the cards acquired for testing. Here is the ugly patch for the brave souls who want to help test it.
Please, if you already tested the workaround: revert your changes and confirm that the bug still exists before testing this new ugly patch:
In /drivers/pci/pci.c, replace the function pci_reset_secondary_bus with this alternate version that adds the ugly patch and two variables required for it to work:
void pci_reset_secondary_bus(struct pci_dev *dev) { u16 ctrl; int i; u8 mem; pci_read_config_word(dev, PCI_BRIDGE_CONTROL, &ctrl); ctrl |= PCI_BRIDGE_CTL_BUS_RESET; pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl); /* * PCI spec v3.0 requires minimum Trst of 1ms. Double * this to 2ms to ensure that we meet the minimum requirement. */ msleep(2); ctrl &= ~PCI_BRIDGE_CTL_BUS_RESET; pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl); // The ugly patch for (i = 0; i < 4096; i++){ pci_read_config_byte(dev, i, &mem); pci_write_config_byte(dev, i, mem); } /* * Trhfa for conventional PCI is 2^25 clock cycles. * Assuming a minimum 33MHz clock this results in a 1s * delay before we can consider subordinate devices to * be re-initialized. PCIe has some ways to shorten this, * but we don't make use of them yet. */ ssleep(1); } 
The idea is to confirm that this ugly patch works and then beautify it, have it accepted into the kernel and to also deliver technical details to AMD to have it fixed in BIOS firmware.
Update 5 - 2017-12-20:
Not dead yet!
Primarily working on communicating the issue to AMD. This is slowed by the holiday season setting in. Their feedback could potentially help make the patch a lot more acceptable and a lot less ugly.
Update 6 - 2018-01-03 ("the java hack"):
AMD has gone into some kind of ninja mode and has not provided any feedback on the issue yet.
Due to popular demand a userland fix that does not require recompiling the kernel was made. It is a small program that runs as any user with read/write access to sysfs (this small guide assumes "root"). The program monitors any PCIe device that is connected to VFIO-PCI when the program starts, if the device disconnects due to the issues described in this post then the program tries to re-connect the device by rewriting the bridge configuration.
This program pokes bytes into the PCIe bus. Run this at your own risk!
Guide on how to get the program:
If you have any PCI devices using VFIO-PCI the program will output something along the lines of this:
------------------------------------------- Zen PCIe-Bridge BAConfig Recovery Tool, rev 1, 2018, HyenaCheeseHeads ------------------------------------------- Wed Jan 03 21:40:30 CET 2018: Detecting VFIO-PCI devices Wed Jan 03 21:40:30 CET 2018: Device: /sys/devices/pci0000:40/0000:40:01.3/0000:42:00.0 Wed Jan 03 21:40:30 CET 2018: Bridge: /sys/devices/pci0000:40/0000:40:01.3 Wed Jan 03 21:40:30 CET 2018: Device: /sys/devices/pci0000:00/0000:00:01.3/0000:08:00.1 Wed Jan 03 21:40:30 CET 2018: Bridge: /sys/devices/pci0000:00/0000:00:01.3 Wed Jan 03 21:40:30 CET 2018: Device: /sys/devices/pci0000:40/0000:40:01.3/0000:42:00.1 Wed Jan 03 21:40:30 CET 2018: Bridge: /sys/devices/pci0000:40/0000:40:01.3 Wed Jan 03 21:40:30 CET 2018: Device: /sys/devices/pci0000:00/0000:00:01.3/0000:08:00.0 Wed Jan 03 21:40:30 CET 2018: Bridge: /sys/devices/pci0000:00/0000:00:01.3 Wed Jan 03 21:40:30 CET 2018: Monitoring 4 device(s)... 
And upon detecting a bridge failure it will look like this:
Wed Jan 03 21:40:40 CET 2018: Lost contact with /sys/devices/pci0000:00/0000:00:01.3/0000:08:00.1 Wed Jan 03 21:40:40 CET 2018: Recovering 512 bytes Wed Jan 03 21:40:40 CET 2018: Bridge config write complete Wed Jan 03 21:40:40 CET 2018: Recovered bridge secondary bus Wed Jan 03 21:40:40 CET 2018: Re-acquired contact with /sys/devices/pci0000:00/0000:00:01.3/0000:08:00.1 
This is not a perfect solution but it is a stopgap measure that should allow people who do not like compiling kernels to experiment with passthru on Threadripper until AMD reacts in some way. Please report back your experience, I'll try to update the program if there are any issues with it.
Update 7 - 2018-07-10 ("the real BIOS fix"):
Along with the upcoming A.G.E.S.A. update aptly named "ThreadRipperPI-SP3r2" comes a very welcome change to the on-die PCIe controller firmware. Some board vendors have already released BETA BIOS updates with it and it will be generally available fairly soon it seems.
Initial tests on a Linux 4.15.0-22 kernel now show PCIe passthru working phenomenally!
With this change it should no longer be necessary to use any of the ugly hacks from previous updates of this thread, although they will be left here for archival reasons.
Update 8 - 2018-07-25 ("Solved for everyone?"):
Most board vendors are now pushing out official (non-BETA) BIOS updates with AGESA "ThreadRipperPI-SP3r2" including the proper fix for this issue. After updating you no longer need to use any of the temporary fixes from this thread. The BIOS updates comes as part of the preparations for supporting the Threadripper 2 CPUs which are due to be released in a few weeks from now.
Many boards support updating over the internet directly from BIOS, but in case you are a bit old-fashioned here are the links (please double-check that I linked you the right place before flashing):
Vendor Board Update Link
Asrock X399 Taichi Update to 2.3, then 3.1
Asrock X399M Taichi Update to 1.10 then 3.1
Asrock X399 Fatality Profesional Gaming Update to 2.1 then 3.1
Gigabyte X399 AURUS Gaming 7 r1 Update to F10
Gigabyte X399 DESIGNARE EX r1 Update to F10
Asus PRIME X399-A Possibly fixed in 0601 (TR2 support and sure fix inbound soon)
Asus X399 RoG Zenith Extreme Possibly fixed in 0601 (TR2 support and sure fix inbound soon)
Asus RoG Strix X399-E Gaming Possibly fixed in 0601 (TR2 support and sure fix inbound soon)
MSI X399 Gaming Pro Carbon AC Update to Beta BIOS 7B09v186 (TR2 update inbound soon)
MSI X399 SLI plus Update to Beta BIOS 7B09vA35 (TR2 update inbound soon)
submitted by HyenaCheeseHeads to Amd [link] [comments]

Weekly Dev Update #14

Weekly Dev Update #14

THORChain Weekly Dev Update for Week 22–28 Oct 2019


BEPSwap Goes Cross-chain

BEPSwap is THORChain’s first go-to market product, built on a statechain to Binance Chain. BEPSwap was intended to only support BEP2 assets to minimise complexity with external chains. Two recent breakthroughs made by the THORChain development team in how to consider the cross-chain environment, as well as increasing the number of consensus participants, mean the team have now re-considered the scope of mainnet launch. Instead of launching the BEPSwap chain and decommissioning/hard-forking it into the THORChain mainnet, the team believe a network that supports cross-chain from the start can be built now. As such, THORChain will be launched, with support for Binance Chain, Bitcoin and Ethereum at Genesis. Binance Chain assets will be immediately supported, with Bitcoin and Ethereum enabled sometime in 2020. This will prevent large changes needing to occur post-mainnet launch. These two breakthroughs will be discussed in a future blog, but the team describe them as “Cross-chain Pools” and “Asynchronous Liquidity Delegation”.

Cross-chain Pools.

Cross-chain pools solve two key problems: 1. Security 2. User Experience. The first is that the network only holds assets that are in pools which are staked against Rune. This massively simpifies the attack surface of the network, since the network only needs to ensure that the amount of bonded Rune is always double the amount of staked Rune. This means that even if network participants could attack the network, they wouldn’t, because they can only steal 50% of what they bonded. Thus no rational actor would steal external assets. The second characteristic is the User Experience, in that neither pegged tokens, nor atomic swaps are used. Users who wish to swap BTC to ETH send in on-chain BTC, and will receive on-chain ETH immediately (and vice versa). The target speed for BTC->ETH will be 20 seconds. The target speed for ETH->BTC will be 10 minutes (1 block). Users who wish to stake, will stake on-chain BTC with on-chain Rune. Withdrawing their assets will mean they receive on-chain BTC and on-chain Rune. No pegging out, and no pegging in.

Asynchronous Liquidity Delegation.

The second breakthrough is how liquidity is managed in the system. The initial design had a single large Threshold Signature pool that held all the funds. While extremely secure, large committee memberships mean very long signing speeds (minutes for 67/100), which impacts the user experience. The team wish to target a signing speed of less than 5 seconds, which means TSS pools should be less than 11 participants. However, due to the incentive structure created by Cross-chain pools, no node has an incentive to steal assets — even if they were given individual custody of assets. This is because they are always bonding twice as much Rune as there is Rune staked in pools. A node that “exit-scams” the network is the equivalent to simply selling 50% of their bonded Rune to assets and leaving disorderly. The network can rebuild the pools by simply disbursing the node’s abandoned bond back into the pools, and churning in a new node. Thus it is resilient to even internal attacks. This setup even works for a node that goes offline — while offline they are unable to respond and they get “fined” from their bond for every transaction they couldn’t honour in a timely fashion. The final design is a large TSS pool that acts as a global custodian of bonded assets and incoming liquidity ( 22 of 33 is the initial target number), with 11 2 of 3 “satellite” pools which hold 50% of the staked assets. This means nodes can be delegated to asynchronously send out liquidity (swaps and withdrawals) with the signing speed of 2 of 3, but the security of 22 of 33. Over time, the team will target 200 of 300 nodes, with 100 2 of 3 satellite pools.

BEPSwap Development

The team are working on 4 parallel streams of effort. Cross-chain infrastructure has now been merged into a single repo called “THORNode”. 1. THORChain 2. Threshold Signature Scheme implementation 3. Front-end Integration for BEPSwap 4. Other development activities


A lot of new work was done to make the statechain cross-chain, with agnostic treatment to chain data. The first three chains will be BNB, BTC and ETH. A global re-factor of naming conventions surrounding cross-chain assets was made. * Add chain to pools * Issue140 if the ticker and coin are the same , thus we don’t need to swap just refund * Issue150 add GAS result in a pool in suspended status * Auto-seed the development environment after a deploy. * Add Asset and Symbol common structs * Get stage seeding on nightly deploys. * Continue importing asset into thornode * Change coin.Denom to coin.Asset * Replace “Token” → “asset” * issue135 update stake logic to check ticker match coin * issue151 add cors support * Feature/docker compose updated build pipelines * Issue138 fix signer use wrong symbol issue , which cause issue with refund * Per chain gas policy * Remove binance specific logic * Choose rune asset based on mainnet vs testnet * Genesis ceremony * Added seed and smoke-test targets to .PHONY
![](https://miro.medium.com/max/3808/1*6HdyayI35M4ozW6s_eoGQQ.png) Assets will now be referred to as: CHAIN.SYMBOL


Based on community feedback, the front-end is being refreshed. A lot of the past weeks updates were fixing small bugs and implementing the fresh design: * Resolve “Update theme variables and sizes” * Resolve “Update API endpoint with the prefix in the Front-End” * Resolve “Update Tab, Button, CoinButton component” * Resolve “BUG: Token amount selection doesn’t work properly in the Pool Stake” * Resolve “Update header, content layout” * Resolve “Build components for swap detail page” * Resolve “Implement Swap Detail Page” * Resolve “Fix issue for token amount input component”
![](https://miro.medium.com/max/4856/1*ozHbZXXLeCnvTGc0xNxNtQ.png) Swap Home Page
![](https://miro.medium.com/max/4784/1*8YY2dFqdCpO0opEICbQFtQ.png) Swap Detail View
![](https://miro.medium.com/max/2724/1*BYmhdcUgasfAmV9Yldu9bg.png) Swap Confirmation
![](https://miro.medium.com/max/3328/1*8pPD75MCcqaVFk1tZ4doCQ.png) Stake Detail View

Threshold Signature Scheme implementation

Work was done to clean up the code for peer-review, as well as implementing whitelisting for key-generation procedure. The TSS implementation is being integrated into the Statechain this week, in time to validate Asgard churn.

Whats Next?

To ship mainnet, the team are aiming for this:


Feature complete with excellent swapping and staking experience.

Chain Service:

Feature complete public RESTful API.


Feature complete with 22 of 33 Asgard, weekly churn, 2 of 3 satellite pools, asynchronous liquidity delegation and cross-chain support.


The team are working for these milestones.

Other Development:

RUNEVault: July 2019 shipped Telegram Bot: August 2019 shipped Bep2Bot: August 2019 shipped


Testnet: August 2019 shipped Community Testing: shipped


Internal Freeze: 20 November 2019 on-time Audit: 20 December 2019 on-time Genesis: 03 January 2020 on-time


To keep up to date, please monitor community channels, particularly Telegram and Twitter: * Twitter: https://twitter.com/thorchain_org * Telegram Community: https://t.me/thorchain_org * Telegram Announcements: https://t.me/thorchain * Reddit: https://reddit.com/thorchain * Github: https://github.com/thorchain * Medium: https://medium.com/thorchain
submitted by thorchain_org to THORChain [link] [comments]


pragma solidity ^0.4.24; contract StakeableTokenABI { function goodAccounting( address _staker, uint256 _stakeIndex ) external ; struct StakeStruct { uint256 amount; uint256 shares; uint256 lockTime; uint256 endStakeCommitTime; uint256 periods; bool isInGlobalPool; uint256 timeRemovedFromGlobalPool; uint256 latePenaltyAlreadyPooled; } mapping(address => StakeStruct[]) public staked; } contract goodAccountingPump { StakeableTokenABI public h; // bitcoin hex contract address mapping(address => uint256) public funds; mapping(address => uint256) public reward; constructor(StakeableTokenABI _hex) public { h = _hex; } function getReward( address _staker, uint256 _stakeIndex) public view returns(uint256) { (,,,uint256 endStakeCommitTime,,bool isInGlobalPool,,) = h.staked(_staker,_stakeIndex); if(isInGlobalPool && block.timestamp > endStakeCommitTime) { if(funds[_staker] >= reward[_staker]) return reward[_staker]; return funds[_staker]; } return 0; } function goodAccounting( address _staker, uint256 _stakeIndex ) public { (,,,uint256 endStakeCommitTime,,bool isInGlobalPool,,) = h.staked(_staker,_stakeIndex); if(isInGlobalPool && block.timestamp > endStakeCommitTime) { h.goodAccounting(_staker,_stakeIndex); uint256 payment = getReward(_staker,_stakeIndex); if(payment > 0) { funds[_staker] -= payment; msg.sender.transfer(payment); } } } function addfunds(uint256 _reward) public payable { funds[msg.sender] += msg.value; reward[msg.sender] = _reward; } } 
This code is untested and should not be used as it will most likely contain logic errors. I am posting it just to express an idea and coding helps me think about whats possible. Anyway the idea is that this contract calls the good accounting function on the bitcoin hex contract and pays the caller with an amount specified by whoever pays into it. Multiple users can fund it and set their own individual rewards for calling the accounting function on their address. The contract checks to see if the stake is in the global pool and matured otherwise it wont let the caller be rewarded.
Would this be the right condition to pay callers?
submitted by utxohodler to BitcoinHEX [link] [comments]

Galileo — Astronomical Discoveries (ii)

by John Lord, LL. D. Galileo has now attained the highest object of his ambition. He is at the head, confessedly, of all the scien- tific men of Europe. He has an ample revenue; he is independent, and has perfect leisure. Even the Pope is gracious to him when he makes a visit to Rome; while cardinals, princes, and ambassadors rival one an- other in bestowing upon his attention and honors. But there is no height of fortune from which a man may not fall; and it is usually the proud, the ostenta- tious, and the contemptuous who do fall, since they create envy, and are apt to make social mistakes. Gal- lileo continued to exasperate his enemies by his arro- gance and sarcasms. "They refused to be dragged at his chariot-wheels." "The Aristotelian professors," says Brewster, "the temporizing Jesuits, the political church- men, and that timid but respectable body who at all times dread innovation, whether it be in legislation of science, entered into an alliance against the philosoph- ical tyrant who threatened them with the penalties of knowledge." The church dignitaries were especially hostile, since they thought the tendency of Galileo's investigations was to undermine the Bible. Flanked by the logic f the schools and the popular interpreta- tion of Scripture, and backed by the civil power, they were eager for war. Galileo wrote a letter to his friend the Abbé Castelli, the object of which was "to prove that the Scriptures were not intended to teach science and philosophy," but to point out the way to salvation. He was indiscreet enough to write a longer letter of seventy pages, quoting the Fathers in support of his views, and attempting to show that Nature and Scrip- ture could not speak a different language. It was this reasoning which irritated the dignitaries of the Church more than his discoveries, since it is plain that the literal language of Scripture upholds the doctrine that the sun revolves around the earth. He was wrong or foolish in trying to harmonize revelation and science. He should have advanced his truths of science and left them to take care of themselves. He should not have meddled with the dogmas of his enemies: not that he was wrong in doing so, but it was not polite or wise; and he was not called upon to harmonize Scripture with science. So his enemies busily employed themselves in collect- ing evidence against him. They laid their complaints before the Inquisition of Rome, and on the occasion of paying a visit to that city, he was summoned be- fore that tribunal which has been the shame and the reproach of the Catholic Church. It was a tribunal utterly incompetent to sit upon his case, since it was ignorant of science. In 1615 it was decreed that Gali- leo should renounce his obnoxious doctrines, and pledge himself neither to defend nor publish them in the future. And Galileo accordingly, in dread of prison, appeared before Cardinal Bellarmine and declared that he would renounce the doctrines he had defended. The cardinal was not an ignorant man. He was the greatest theolo- gian in the Catholic Church; but his bitterness and ran- cor in reference to the new doctrines were as marked as his scholastic learning. The Pope, supposing that Galileo would adhere to his promise, was gracious and kind. But the philosopher could not resist the temptation of ridiculing the advocates of the old system. He called them "paper philosophers." In private he made a mockery of his persecutors. One Saisi undertook to prove from Suidas that the Babylonians used to cook eggs by whirling them swiftly on a sling; to which he replied: "If Saisi insists on the authority of Suidas, that the Babylonians cooked eggs by whirling them on a sling, I will believe it. But I must add that we have eggs and slings, and strong men to whirl them, yet they will not become cooked; nay, if they were hot at first, they more quickly become cool; and as there is nothing wanting to us but to be Babylonians, it follows that Being Babylonians is the true cause why the eggs became hard." Such was his prevailing mockery and ridicule. "Your Eminence," write one of his friends to the Cardinal D'Este, "would be delighted if you could hear him hold forth in the midst of fifteen or twenty, all violently attacking him, sometimes in one house, and sometimes in another; but he is armed after such a fashion that he laughs them all to scorn." Galileo, after his admonition from the Inquisition, and his promise to hold his tongue, did keep compara- tively quiet for a while, amusing himself with mechan- ics, and striving to find out a new way of discovering longitude at sea. But the want of better telescopes baffled his efforts; and even to-day it is said "that no telescope has yet been made which is capable of observ- ing at sea the eclipses of Jupiter's satellites, by which on shore this method of finding longitude has many advantages." On the accession of a new Pope (1623), Urban VIII., who had been his friend as Cardinal Barberini, Galileo, after eight years of silence, thought that he might now venture to publish his great work on the Ptolemaic and Copernican systems, especially as the papal censor also had been his friend. But the publication of the book was delayed nearly two years, so great were the obsta- cles to be surmounted, and so prejudiced and hostile was the Church to the new views. At last it appeared in Florence in 1632, with a dedication to the Grand Duke,——not the Cosimo who had rewarded him, but his son Ferdinand, who was a mere youth. It was an un- fortunate thing for Galileo to do. He had pledged his word not to advocate the Copernican theory, which was already sufficiently established in the opinions of phi- losophers. The form of the book was even offensive, in the shape of dialogues. One of them he ridiculed under the name of Simplicio. This was supposed to mean the Pope himself,——so they made the Pope believe, and he was furious. Old Cardinal Bellarmine roared like a lion. The whole Church, as represented by its dignita- ries, seemed to be against him. The Pope seized the old weapons of the Clements and the Gregorians to hurl upon the daring innovator; but delayed to hurl them, since he dealt with a giant, covered not only by the shield of the Medici, but that of Minerva. So he convened a congregation of cardinals, and submitted to them the examination of the detested book. The author was summoned to Rome to appear before the Inquisition, and answer at its judgement-seat the charges against him as a heretic. The Tuscan ambassador expostulated with his Holiness against such a cruel thing, considering Galileo's age, infirmities, and fame, ——all to no avail. He was obliged to obey the sum- mons. At the age of seventy this venerated philoso- pher, infirm, in precarious health, appeared before the Inquisition of cardinals, not one of whom had any familiarity with abstruse speculations, or even with mathematics. Whether out of regard to his age and infirmities, or to his great fame and illustrious position as the great- est philosopher of his day, the cardinals treat Galileo with unusual indulgence. Though a prisoner of the Inquisiton, and completely in its hands, with power of life and death, it would seem that he is allowed every personal comfort. His table is provided by the Tuscan ambassador; a servant obeys his slightest nod; he sleeps in the luxurious apartment of the fiscal of that dreaded body; he is even liberated on the responsi- bility of the cardinal; he is permitted to lodge in the palace of the ambassador; he is allowed time to make his defence; those holy Inquisitors would not unneces- sarily harm a hair on his head. Nor was it probably their object to inflict bodily torments: these would call out sympathy and degrade the tribunal. It was enough to threaten these torments, to which they did not wish to resort except in case of necessity. There is no evidence that Galileo was personally tortured. He was indeed a martyr, but not a sufferer except in humiliated pride. Probably the object of his enemies was to silence him, to degrade him, to expose his name to infamy, to arrest the spread of his doctrines, to bow his old head in shame, to murder his soul, to make him stab himself, and be his own executioner, by an act which all posterity should regard as unworthy of his name and cause. After a fitting time has elapsed,——four months of dignified session,——the mind of the Holy Tribunal is made up. Its judgement is ready. On the 22nd of June, 1633, the prisoner appears in penitential dress at the convent of Minerva, and the presiding cardinal, in his scarlet robes, delivers the sentence of the Court, ——that Galileo, as a warning to others, and by way of salutary penance, be condemned to the formal prison of the Holy Office, and be ordered to recite once a week the seven Penitential Psalms for the benefit of his should,——apparently a light sentence, only to be nominally imprisoned a few days, and to repeat those Psalms which were the life of blessed saints in mediæ- val times. But this was nothing. He was required to recant, to abjure the doctrines he had taught; not in private, but publicly before the world. Will he recant? Will he subscribe himself an imposter? Will he abjure the doctrines on which his fame rests? Oh, tell it not in Gath! The timid, infirm, life-loving old patriarch of science falls. He is not great enough for martyrdom. He chooses shame. In an evil hour this venerable sage falls down upon his knees before the assembled cardinals, and reads aloud this recantation: "I, Galileo Galilei, aged seventy, on my knees before you most reverend lords, and having my eye on the Holy Gospel, which I do touch with my lips, thus publish and declare, that I believe, and always have believed, and always will believe every article which the Holy Catholic Roman Church holds and teaches. And as I have written a book in which I have main- tained that the sun is the centre, which doctrine is re- pugnant to the Holy Scriptures, I, with sincere heart and unfeigned faith, do abjure and detest, and curse the said error and heresy, and all other errors contrary to said Holy Church, whose penance I solemnly swear to observe faithfully, and all other penances which have been or shall be laid upon me." It would appear from this confession that he did not declare his doctrines false, only that they were in opposition to the Scriptures; and it is also said that as he arose from his knees he whispered to a friend, "It does move, nevertheless." As some excuse for him, he acted with the certainty that he would be tortured if he did not recant; and at the worst he had only affirmed that his scientific theory was in opposition to the Scriptures. He had not denied his master, like Peter; he had not recanted the faith like Cranmer; he had simply yielded for fear of bodily torments, and therefore was not sincere in the abjuration which he made to save his life. Nevertheless, his recantation was a fall, and in the eyes of the scientific world per- haps greater than that of Bacon. Galileo was false to philosophy and himself. Why did he suffer himself to be conquered by priests and despised? Why did so bold and witty and proud a man betray his cause? Why did he not accept the penalty of intellectual freedom, and die, if he must? What was life to him, dis- eased, infirm, and old? What had he more to gain? Was it not a good time to die and consummate his protests? Only one hundred and fifty years before, one of his countrymen had accepted torture and death rather than recant his religious opinions. Why could not Galileo have been as great in martyrdom as Savon- arola? He was a renowned philosopher and brilliant as a man of genius,——but he was a man of the world; he loved ease and length of days. He could ridicule and deride opponents,——he could not suffer pain. He had a great intellect, but not a great soul. There were flaws in his morality; he was anything but a saint or hero. He was great in mind, and yet he was far from being great in character. We pity him, while we exalt him. Nor is he world harsh to him; it forgives him for his services. The worst that can be said, is that he was not willing to suffer ad die for his opinions: and how many philosophers are there who are willing to be martyrs? Nevertheless, in the eyes of philosophers he has dis- graced himself. Let him then return to Florence, to his own Arceti. He is a silenced man. But he is silenced, not because he believed with Copernicus, but because he ridiculed his enemies and confronted the Church, and in the eyes of blinded partisans had attacked divine authority. Why did Copernicus escape persecution? The Church must have known that there was something in his discoveries, and in those of Gali- leo, worthy of attention. About this time Pascal wrote: "It is vain that you have procured the con- demnation of Galileo. That will never prove the earth to be at rest. If unerring observation proves that it turns round, not all mankind together can keep it from turning, or themselves from turning with it." But let that persecution pass. It is no worse than other persecutions, either in Catholic or Protestant ranks. It is no worse than burning witches. Not only is intolerance in human nature, but there is a repugnance among the learned to receive new opinions when these interfere with their ascendency. The op- position to Galileo's discoveries was no greater than that of the Protestant Church, half a century ago, to some of the inductions of geology. How bitter the hatred, even in our times, to such men as Huxley and Darwin! True, they have not proved their theories as Galileo did; but they gave a great shock as he to the minds of theologians. all science is progressive, yet there are thousands who oppose its progress. And if learning and science should establish a different mean- ing to certain texts from which theological deductions are drawn, and these premises be undermined, there would be the same bitterness among the defenders of the present system of dogmatic theology. Yet theology will live, and never lose its dignity and importance; only, some of its present assumptions may be discarded. God will never be dethroned from the world he gov- erns; but some of his ways may appear to be different from what was once supposed. And all science is not only progressive, but it appears to be bold and scornful and proud,——at least, its advocates are and ever have been contemptuous of all other departments of knowl- edge but its own. So narrow and limited is the human mind in the midst of its triumphs. So full of preju- dices are even the learned and the great. Let us turn then to give another glance at the fallen philosopher in his final retreat at Arceti. He lives under restrictions. But hey allow hi leisure and choice wines, of which he is fond, and gardens and friends; and many come to do him reverence. He amuses his old age with the studies of his youth and manhood, and writes dialogues on Motion, and even discovers the phenomena of the moon's libration; and by means of the pendulum he gives additional impor- tance to astronomical science. But he is not allowed to leave his retirement, not even to visit his friends in Florence. The wrath of the Inquisition still pursues him, even in his villa at Arceti in the suburbs of Florence. Then renewed afflictions come. He loses his daughter, who was devoted to him; and her death nearly plunges him into despair. The bulwarks of his heart break down; a flood of grief overwhelms his stricken soul. His appetite leaves him; his health forsakes him; his infirmities increase upon him. His right eye loses its power,——that eye that had seen more of the heavens than the eyes of all who had gone before him. He became blind and deaf, and cannot sleep, afflicted with rheumatic pains and maladies for- lorn. No more for him is rest, or peace, or bliss; still less the glories of his brighter days,——the sight of glit- tering fields, the gems of heaven, without which "Neither breath of Morn, when she ascends With charm of earliest birds, nor rising sun On this delightful land, nor herb, fruit, flower Glittering with dew, nor fragrance after showers, nor grateful evening mild, . . . is sweet." No more shall he gaze on features that he loves, on stars, or trees, or hills. No more to him "Returns Day, or the sweet approach of even or morn, or sight of vernal bloom, or summer's rose, Or flocks, ir herds, or human face divine; But clouds, instead, and ever-during dark Surround" [him]. It was in those dreary desolate days at Arceti, "Unseen In manly beauty Milton stood before him, Gazing in reverent awe,——Milton, his guest, Just then come forth, all life and enterprise; While he in his old age, . . . . . . exploring with his staff, His eyes upturned as to the golden sun, His eyeballs rolling." This may have been the punishment of his recanta- tion,——not Inquisitorial torture, but the consciousness that he had lost his honor. Poor Galileo! thine illus- trious visitor, when his affliction came, could cast his sightless eyeballs inward, and see and tell "things un- attempted yet in prose or rhyme,"——not "Rocks, caves, lakes, bogs, fens, and shades of death, . . . . . . . . . Where all life dies, death lives, and Nature breeds . . . . . . . . . Gorgons, and Hydras, and Chimeras dire," but of eternal Providence," and "Eden with surpass- ing glory crowned," and our first parents," and of "salvation," "goodness infinite," of "wisdom," which when we know we need no higher though all the stars we know by name,——— "All secrets of the deep, all Nature's works, Or works of God in heaven, or air, or sea." And yet, thou stricken observer of the heavenly bodies! hadst thou but known what marvels would be revealed by the power of thy wondrous instrument after thou should'st be laid lifeless and cold beneath the marble floor of Santa Croce, at the age of seventy-eight, without a monument (although blessed on his death- bed by Pope Urban), having died a prisoner of the Inquisition, yet not without having rendered to astro- nomical science services of utmost value,——even thou might have died rejoicing, as one of the greatest bene- factors of the world. And thy discoveries shall be forever held in gratitude; they shall herald others of even greater importance. Newton shall prove that the different planets are attracted to the sun in the inverse ratio of the squares of their distances; that the earth has a force on the moon identical with the force of gravity, and that all celestial bodies, to the utmost boundaries of space, mutually attract each other; that all particles of matter are governed by the same law,——the great law of gravitation, by which "astronomy," in the language of Whewell, "passed from boyhood to manhood, and by which law the great discoverer added more to the realm of science than any man before or since his day." And after Newton shall pass away, honored and lamented, and be buried with almost royal pomp in the vaults of Westminster, Halley and other mathematicians shall construct lunar tables, by which longitude shall be accurately measured on the pathless ocean. Lagrange and Laplace shall apply Newtonian theory to de- determine the secular inequalities of celestial motion; they shall weigh absolutely the amount of matter in the planets; they shall show how far their orbits de- viate from circles; and they shall enumerate the cycles of changes detected in the circuit of the moon. Clai- raut shall remove the perplexity occasioned by the seeming discrepancy between the observed and com- puted motions of the moon's perigee. Halley shall demonstrate the importance of observations of the tran- sit of Venus as the only certain way of obtaining the sun's parallax, and hence the distance of the sun from the earth; he shall predict the return of that myste- rious body which we call a comet. Herschel shall con- struct a telescope which magnifies two thousand times, and add another planet to our system beyond the mighty orb of Saturn. Römer shall estimate the velocity of light from the eclipse of Jupiter's satel- lites. Bessel shall pass the impassable gulf of space and measure the distance of some of the fixed stars, although such is the immeasurable space between the earth and those distant suns that the parallax of only about thirty has yet been discovered with our finest instruments,——so boundless is the material universe, so vast are the distances, that light, travelling one hun- dred and sixty thousand miles with every pulsation of the blood, will not reach us from some of those remote worlds in one hundred thousand years. So marvellous shall be the victories of science, that the perturbations of the planets in their courses shall reveal the exist- ence of a new one more distant than Uranus, and Leverrier shall tell at what part of the heavens that star shall first be seen. So far as we have discovered, the universe which we have observed with telescopic instruments has no limits that mortals can define, and in comparison with its magnitude our earth is less than a grain of sand, and is so old that no genius can calculate and no imag- ination can conceive when it had its beginning. All that we know is, that suns exist at distances we cannot define. But around what center do they revolve? Of what are they composed? Are they inhabited by intel- ligent and immortal beings? Do we know that they are not eternal, except from the divine declaration that there was a time when the Almighty fiat went forth for this grand creation? Creation involves a creator; and can the order and harmony seen in Nature's laws exist without supreme intelligence and power? Who, then, and what, is God? "Canst thou by searching find out Him? Knowest thou the ordinances of Heaven? Canst thou bind the sweet influences of the Pleiades, or loose the bands of Orion?" What an atom is this world in the light of science! Yet what dignity has man by the light of revelation! What majesty and power and glory has God! What goodness, benevolence, and love, that even a sparrow cannot fall to the ground without His notice,——that we are the special objects of His providence and care! Is there an imagination so lofty that will not be oppressed with the discoveries that even the telescope has made? Ah, to what exalted heights reason may soar when allied with faith! How truly it should elevate us above the evils of this brief and busy existence to the conditions of that other life,—— "When the soul, Advancing ever to the Source of light And all perfection, lives, adores, and reigns in cloudless knowledge, purity, and bliss!" AUTHORITIES. Dekambre, Histoire de l'Astronomie; Arago, Histoire de l'Astronomie; Life of Galileo, in Cabinet Library; Life of Galileo, by Brewster; Lives of Galileo, by Italian and Spanish Literary Men; Whewell's History of Inductive Sciences; Plurality of Worlds; Humboldt's Cosmos; Nichols' Architecture of the Heavens; Chalmers' Astronomical Discourses; Life of Kepler, Library of Useful Knowledge; Brewster's Life of Tycho Brahe, of Kepler, and of Sir Isaac Newton; Mitchell's Stellar and Planetary Worlds; Brad- ley's Correspondence; Airy's Reports; Voiron's History of Astronomy; Philosophical Transactions; Everett's Orations of Galileo; Life of Coper- nicus; Bayly's Astronomy; Encyclopædia Britannica, Art. Astronomy; Proctor's Lectures. 
from Beacon Lights of History, by John Lord, LL. D., Volume III, Part II: Renaissance and Reformation, pp. 447 - 463 Copyright, 1883, by John Lord. Copyright, 1921, By Wm. H. Wise & Co., New York
ይህ የእርስዎ ቦታ ነው። አንዳችሁ ለሌላው ደጎች ሁኑ። https://old.reddit.com/thesee [♘] [♰] [☮]
submitted by MarleyEngvall to arceti [link] [comments]

Discussion: EOS & ETH for dApp development

Hi all! I’m hoping to have some calm and educational discussion here with the community about the pros and cons of Ethereum and EOS for dApp development.
Personally I’ve used ETH for the past 3-4 months and LOVE it. Solidity is such an interesting language and new languages are already in the works to create a better contract development system. I think a separate language for contracts is a huge plus as the data types, security considerations, and overall design requirements are different from most other projects completed in traditional languages.
Now with ETH, there’s the issue of our users paying to use our application (which brings about optimization of structs and such which I enjoy) and the fact that as the first major smart contract platform there’s a good chance it wasn’t done perfectly. To elaborate on that last point, I’m a personal proponent of the idea that bitcoin WAS amazing, but as the first major crypto it did things wrong and later cryptos (mainly focusing on bitcoin like cryptos without smart contracts) improved upon those flaws.
With EOS I honestly don’t know a ton and would like to learn from anyone who’s experimented. I know resources like CPU and RAM are controlled based on staked EOS and I find that model interesting. Being able to stake for my program to run and then at the end of the projects life cycle I could simply unstake my EOS and create a new project with the same (or more likely less) resources for the same EOS.
But the major reason I don’t know much about EOS is because of its largest cons: the lack of complete decentralization with DPOS and the creator not starting in a good light (based on my previous experience with STEEM which just seemed to be a money printing scheme).
Looking forward to hearing what you all have to say, and I’m happy to answer any questions as to my own opinions, knowledge, experiences, and misinterpretations (as I’m sure there’s a few things about EOS or maybe even ETH I don’t correctly understand).
submitted by Chugwig to ethdev [link] [comments]

Is it feasible to attain a price of Bitcoin of $1M in 10 years?

So I was watching the short Wallstreet Journal interview with the CEO of Xapo (Wences Casares ) and invariably at the end of the interview the journalist asked Wences what his projection was for the price of Bitcoin in 10 years.
Without skipping a beat he said between $500K to $1M. I couldn't help but to laugh out loud and think to myself there is no way a price point like that could ever be attained in a 10 year period but what struct me odd was how convinced and assured Wences was when throwing out such an outlandish (or so I thought) price prediction.
His unwavering confidence in his prediction got me thinking. I thought to myself how can he say such an outlandish prediction when he is obviously so knowledgeable in the industry having started and run Xapo these past few years.
I then put pen to paper in trying to figure out how he came up with such an outlandish price prediction and came up with this scenario:
Let's say the average price of Bitcoin is $500 in 2014. Now let's double that price (year 1). You get $1,000. Now double that price year 2 = $2,000, now double that price again for year 3 = $4,000, continue this approach....year 4 = $8,000, year 5 = $16,000, year 6 = $32,000, year 7 = $64,000, year 8 = $128,000, year 9 = $256,000, year 10 = $512,000.
So Wences asserts that if Bitcoin just doubles in price each year we'll be over $500,000 in 10 years. Then I thought to myself how likely is this to happen? Weeeelllll, I think it's safe to say that the price of Bitcoin is somewhat positively correlated to the number of Bitcoin users. As the user base grows so does the price of Bitcoin. Thus, let's take Wences same approach for factoring the number of users of Bitcoin each year.
Let's just estimate that a total of 4M people own Bitcoin now. Thus, let's double that each year. End of year 1 = 8M. End of year 2 = 16M End of year 3 = 32M End of year 4 = 64M End of year 5 = 128M End of year 6 = 256M End of year 7 = 512M End of year 8 = 1B End of year 9 = 2B End of year 10 = 4 Billion people.
Thus, is it feasible that in 10 years 4 Billion people will be transacting in Bitcoin? Weeeellllll, if you consider that nearly 6 Billion people in the world are unbanked/underbanked. Then take into account that cell phone companies are working on a $25 smart phone which could be in the hands of a good portion of these underbanked.
Than it's not inconceivable to think that 2/3rds of the under banked population could be utilizing Bitcoin in 10 years. Thus, i was stunned in realizing it's not that impossible that if the above level of adoption takes place, that the Bitcoin price prediction that Wences made was not as preposterous as I had originally thought.
Makes you think.....
submitted by coyntoss to Bitcoin [link] [comments]

Blockchain Online Training

Blockchain Online Training Hyderabad | Blockchain Course
What is Blockchain?
The blockchain is like the tracking tool which helps the users to track the records of the transactions on all the digital currency without any kind of central recording. Every lump is connected to the computer thereby a copy is recorded automatically.
You can attend Blockchain online training India from Hyderabad, Delhi, Bangalore, Pune, Noida, Kolkata and anywhere from USA UK Singapore through online. online Best BlockChain Training institute in Hyderabad called Blockchain architecture training.
New Batch Schedules: You can attend blockchain free Demo also
Blockchain Online Training start on jan12, 2019 7:30 AM IST
Blockchain Course Details:
· Course Duration:45 Days
· Mon-Fri 7:30 am (IST)
· Mode of Training Online only
· Real-time Trainer
· After Blockchain classes, we will provide class recording for reference purpose
Note:- Plz Watch below Blockchain Online Training Demo and Class1, Class2, Class3, Class4 recording before attending the session. (total 5 Videos here) VLR TRAINING 9985269518
For course details visit this link: https://www.vlrtraining.in/blockchain-online-training-hyderabad/
Visit follow link for free Demo: https://www.youtube.com/watch?v=ElwREV0gL1E&list=PLXx2-0oYp1LNri7bsDwSOEl56-eDtjwFw
What is Blockchain Telugu | Blockchain Demo 2019| VLR Training

Blockchain Class 1 | What is Blockchain |Concepts in Blockchain

Blockchain Class2 | How Blockchain works| VLR Training Jan2

BlockChain class3 Jan3 |Nodes and Consensus| What is AES RSA Cryptography

Blockchain class4 jan4| Hash Function| What is Blockchain Distributed Ledger |

Why should you take this Blockchain Online training
1 BlockChain developer ranked 2nd among 20 fastest growing skillsets. 2.salary of “Blockchain Developer” ranges from $85k for Application Developer to $115k for Senior Software Engineer as per indeed.com 3.Bill & Melinda Gates Foundation goals to use Blockchain technology to help the two billion people worldwide who lack bank accounts 4. As per the World Economic Forum, In 2025 18% of the world’s GDP will be on Blockchain associated technologies
Financial Institutions, Insurance Sectors as well as Government Sectors are all using Block Chain technology steadily to roll-out multiple services to the customers
Who can Learn blockchain Technology Online?
Blockchain Online Training can learn everyone based on interest from any platform. 1.System administrators and DBA 2.Software Programmers/Developers 3. Students/Fresher’s 4. Software developers 5. Specialists in the banking and financial sector 6. Media and Entertainment Sector 7. Government and Public Sector 8. Healthcare and Life science sector 9. Anyone can learn interested in new technology can take this Blockchain course
Blockchain Pre-Requisites:📷
· Should have a fundamental knowledge of Linux and Command Line.
· Having a Basic knowledge of NodeJS and JavaScript are useful.
· here are nothing prerequisites required to learn this course. It’s good to have a basic
· knowledge of programming languages like python. But not compulsory.
· Trainers of VLR training will start with all the required basics of Online Training
Objectives of the Blockchain Online Training course:
· Work with Ethereum BlockChain.
· Study designing and deployment of private BlockChain and monitoring.
· Work with Multichain and private BlockChain.
· Understanding the application of Market Friction.
· Using the BlockChain transactions and miner validations.
· Installing Hyperledger composers.
Which Industries use the blockchain
As per the reports, the Blockchain Technology market is segmented in various fields such as 1.Insurance Sectors. 2.Banking Sector. 3.Media and Entertainment Sector. 4.Financial Institutes. 5.Government and Public Sector. 6.Automotive Sector. 7.Healthcare and Life science sector. 8.Banking Sector. 9.Retail and ECommerce Sector. Others as well.
The scope of Blockchain Market:
· By 2030, significant developments in the world’s standard of living will be attributable to the development of blockchain technology.
· Managing World trade with the help of Blockchain Technology
· By the end of 2030, most of the world trade will be conducted advantage blockchain technology.
· Blockchain will remove the requirement of the third party By the end of 2030, there will be extra trillion-dollar tokens than there will be trillion-dollar companies.
· Blockchain in Cyber Security
· By 2030, maximum governments around the world will create or adopt some form of virtual currency.
Benefits of Block Chain Technology?
Transparency: Block Chain technology maintains transparent business transactions. There is nothing like a centralized system of transactions in the block chains. Accounting: Recording and maintaining the transactions through the blockchain technology is very high. Faster Transactions: In Block Chain technology the currency is digitized and transacted within seconds. Reduces the transactional costs: In blockchain, the users can transact the digital currency with each other the sender without any intermediates like banks.
Block Chain Course Content
Decentralized Money

· Exploring Blockchain
· Bitcoin & Blockchain
o Bitcoin and its History
o Why use Bitcoins?
o Where and how to buy bitcoins

· Ethereum
· What is Ethereum?
· Ethereum Private Blockchain and Smart contracts
· Solidity basics
· Advance Solidity
Client-side signing and remotes nodes for Dapps
· Deploying DAPP using Truffle and Web3J
Running the DApp on the Ethereum node using Metamask
For Blockchain online Training contact us VLR Training 998526951
submitted by kannadhanush to u/kannadhanush [link] [comments]

Blockchain online training

Blockchain online training

Blockchain originally blockchain, is a growing list of called blocks, which are linked using Each block contains a cryptographic hash of the previous block, and transaction data (generally represented as a Merkle tree root hash).


a blockchain is resistant to modification of the data. It is “an open, distributed ledger that can record transactions between two parties efficiently and in a verifiable and permanent way”. For use as a distributed ledger, a blockchain is typically managed by a peer-to-peer network collectively adhering to a protocol for inter-node communication and validating new blocks. for best blockchain training visit follow link

For more information about blockchain visit following site:

blockchain training

For more information about blockchain please contact following mobile number VLR TRAINING 9985269518

#blockchain online training


#Bitcoin & Blockchain


#Blockchain tutorial

#blockchain wallet

For free blockchain class please visit following links :

blockchain demo classes

blockchain classes1

blockchain classes2

Blockchain course content:

Decentralized Money
· Transformation in trading units
· Cryptography and Crypto-currency
· Anonymity and Pseudonymity in cryptocurrencies
· Digital Signatures
· Cryptocurrency Hash codes
· Distributed networks
Exploring Blockchain
· Introduction to Blockchain.
· Why Blockchain is crucial?
· Key vocabulary while discussing Blockchain
· Distinction between databases and blockchain
· Explaining Distributed Ledger
· Blockchain ecosystem
· Blockchain structure
· Working of blockchain technology
· Permission and permission-less blockchain
Bitcoin & Blockchain
· Bitcoin and its History
· Why use Bitcoins?
· Where and how to buy bitcoins
· How to store bitcoins?
· How and where to spend bitcoins?
· Selling bitcoins
· Bitcoin transactions
· How bitcoin transactions work
· What happens in case of invalid transactions
· Parameters that invalidate the transactions
· Scripting language in bitcoin
· Applications of bitcoin script
· Nodes and a network of bitcoin
· Various roles you can play in the Bitcoin Ecosystem
What is Ethereum?
· What is Ether?
· How to use Ethereum?
· The Ethereum ecosystem, DApps, and DAOs
· How Ethereum mining works
· Learning Solidity
· Contract classes, Functions, and conditionals
· Inheritance & abstract contracts
· Libraries
· Types & Optimization
· Global Variables
· Debugging
· Future of Ethereum
Ethereum Private Blockchain and Smart contracts
· Private and public blockchain
· Various blockchain setup platforms
· Using Ethereum to set up private blockchain
· Steps to build a blockchain solution.
· Smart contract on Ethereum
· Compile, deploy and instantiate contracts
· Configuring, running and working with the go-Ethereum client
· Account management and mining
· Understand the different stages of a contract deployment
· How to interact with a contract once deployed?
Solidity basics
· Introduction to Solidity
· Learning Solidity
· Basics (version pragma and comments)
· Structure of a contract
· Keywords
· Data Structures (Arrays, Mapping, Structs)
· Data Types (signed and unsigned int, strings, boolean, address)
· Looping and Conditional Statements
· Inheritance
· Polymorphism
Advance Solidity
· Imports and libraries
· Extended String Functionality and Bytes
· Custom Modifiers and Error Handling
· Creating and deploying your own tokens
· Event logging, handling
· Parameter Mapping and Returning multiple variables
· State Modifiers (Pure/View/Constant/Payable)
· Transferring Ether between contracts (ERC20 and ERC223)
· Deployment
· Contract ABI
· Introduction to the Truffle Framework
· Communicating between smart contracts and HTML pages using web3.js and Metamask
· Setting up event-driven Interfaces
· Client-side signing and remotes nodes for Dapps
Deploying DAPP using Truffle and Web3J
· Creating a project structure on Truffle
· Writing the smart contract
· Compiling and migrating the smart contract
· Publishing the DApp
· How web3.js and truffle work with ReactJS
· Deploying smart contract services on the test blockchain network
· Running the DApp on the Ethereum node using Metamask
submitted by nandhani4321 to u/nandhani4321 [link] [comments]

Maybe this is the wrong sub for this. But there may be info in the blockchain.

it has been more than 30 days and we still do not have proof of life for Julian Assange; and it is possible, if not likely, that the key has been leaked.
All of this is information that is verifiable and you can look over at reddit like /whereisassange to get the details, timeline and evidence, it is there, and it is in the chans
now here is the thing, there is good reason to believe that the key to the insurance files, or some of the data in the insurance files, may be hidden in the blockchain. bitcoin and or lightcoin.
So with that in mind some evidence that such a message from wikileaks may be in the blockchain:
  1. get python 3.5.2 https://www.python.org/downloads/
  2. install
  3. open command prompt and navigate to the \Python\Python35-32\scripts run pip install pycurl
  4. now open a text editor in the some directory as the python.exe file
copy and paste the following:
import sys import pycurl import struct from binascii import unhexlify, crc32 from urllib.request import urlopen transaction = str(sys.argv[1]) data = urlopen("https://blockchain.info/tx/691dd277dc0e90a462a3d652a1171686de49cf19067cd33c7df0392833fb986a?show_adv=true") dataout = b'' atoutput = False for line in data: if b'Output Scripts' in line: atoutput = True if b'' in line: atoutput = False if atoutput: if len(line) > 100: chunks = line.split(b' ') for c in chunks: if b'O' not in c and b'\n' not in c and b'>' not in c and b'<' not in c: dataout += unhexlify(c) length = struct.unpack(' 
  1. save as jean.py
  2. in command promp run:
    python jean.py 691dd277dc0e90a462a3d652a1171686de49cf19067cd33c7df0392833fb986 
See and share.
submitted by goodguy_asshole to WhereIsAssange [link] [comments]

Skycoin Meshnet Project: Skywire Updates

The wifi controller library is now on Github. Its working on Ubuntu and possibly Debian.
Non-Mesh Stuff:
We still have a lot of work to do, but have been making very good progress.
submitted by skycoin to darknetplan [link] [comments]

Wikileaks blockchain spinoff: message from snowden on sept 15?

seen several posts about this. (this was found while decoding wikileaks' messages in the blockchain)
here's how to do it:
taken snowden's deleted hash tweet ffdae96f8dd292374a966ec8b57d9cc680ce1d23cb7072c522efe32a1a7e34b0
use it to generate bitcoin addresses:
from pybitcoin import BitcoinPrivateKey pk = BitcoinPrivateKey('ffdae96f8dd292374a966ec8b57d9cc680ce1d23cb7072c522efe32a1a7e34b0', compressed=True) pk.public_key().address() pk = BitcoinPrivateKey('ffdae96f8dd292374a966ec8b57d9cc680ce1d23cb7072c522efe32a1a7e34b0', compressed=False) pk.public_key().address()
These are the addresses:
1EnDZkT8Thep9sfbAy5gwg23EHhZw7tYwg 1L3Zqv68zsXxNs53r25dKcUgjDe1119Rhj
also see https://www.reddit.com/Bitcoin/comments/4wxyhj/snowden_tweets_private_key_hash_then_deletes_it/
this address was first used a day after the tweet. on september 15 there are a few transactions for 0.000911 BTC. If you decode the data you get a dbase file. apparently snowden was really active on twitter on sept 15 because a report from congress on him came out, there was a lot of talk about a pardon and the movie Snowden was coming out the next day.
how to decode:
copy paste all the data under 'Output Scripts' on blockchain.info into a text file called 'encoded.txt'. For example, in https://blockchain.info/en/tx/6d8c38924cfa05cabc4745d198b4be6163e960eba186989cd5b735b9c6f1867c
Then use this script.
import struct from binascii import unhexlify, crc32
f = open('encoded.txt','r')
data = b'' for ff in f.readlines(): chunks = ff.split(' ') for c in chunks: if 'O' not in c and '\n' not in c: data += unhexlify(c.encode('utf8'))
print data
length = struct.unpack(' save the code above as a script and do 'python script.py > output'.
then check what type of file you got by doing 'file output'. it should say 'DBase 3 data file (244019549 records)'
LibreOffice Base should be able to open the file but it's not working for me. is there another way to see the contents of a dbase file? i also think maybe all the transactions from sept 15 have to be combined.
anyone have any ideas?
submitted by 4a94760a to WhereIsAssange [link] [comments]

Litecoin - Abe

Hi there
Is there someone who successfully run litecoin on bitcoin abe / abe. I used this as my chain config.
CHAIN_CONFIG = [{"chain":"Litecoin", "code3":"LTC", "address_version":"0x30", "magic":"\xfb\xc0\xb6\xdb"}]
But im getting this error:
Opened /home/ubuntu/.litecoin/blocks/blk00046.dat
Exception at 3652130237
Failed to catch up {'blkfile_offset': 29167380, 'blkfile_number': 100046, 'chain_id': 1, 'loader': None, 'conf': u'/home/ubuntu/.litecoin/litecoin.conf', 'dirname': '/home/ubuntu/.litecoin', 'id': Decimal('439')}
Traceback (most recent call last):
>! File "Abe/DataStore.py", line 2530, in catch_up!<
>! File "Abe/DataStore.py", line 2828, in catch_up_dir!<
store.import_blkdat(dircfg, ds, blkfile['name'])
>! File "Abe/DataStore.py", line 2950, in import_blkdat!<
b = chain.ds_parse_block(ds)
>! File "Abe/Chain/__init__.py", line 82, in ds_parse_block!<
>! File "Abe/Chain/__init__.py", line 75, in ds_parse_transaction!<
return deserialize.parse_Transaction(ds)
>! File "Abe/deserialize.py", line 90, in parse_Transaction!<
>! File "Abe/deserialize.py", line 46, in parse_TxIn!<
d['sequence'] = vds.read_uint32()
>! File "Abe/BCDataStream.py", line 71, in read_uint32!<
def read_uint32 (self): return self._read_num('
>! File "Abe/BCDataStream.py", line 110, in _read_num!<
(i,) = struct.unpack_from(format, self.input, self.read_cursor)
error: unpack_from requires a buffer of at least 4 bytes
submitted by mjbquieta to litecoin [link] [comments]

Help me make a MS diet calculator :)

Hey guys! I was just diagnosed with ms, and doc said that a lot of foods and activities make the flare ups worse, but as to what those foods and activities are, they are different for every person.
So onto the app dev side! I am going to be recording each day in a struct as a ms scale of 1-10, how much stress i am feeling 1-10, and a list or vector of food consumed and activities done. For example: spaghetti, swimming, apple, green beans. Stress: 4 ms symptoms:2.
Then I want to take the vector of days and perform a fancy algorithm on it to score each food item and life event as being positively or negatively correlated with the flare ups and a number that shows the likelihood of correlation.
This is the part I need help on, I can do calc but I have always sucked at statistics. I need the name of an existing statistical algorithm so I can look it up or an explanation of how you would do it.
Motivation! If this algorithm helps me recover, I will develop it into an android app, and I will contact the poster(s) that I used info from. I will send some bitcoin your way. Also, you will be responsible for making the lives of a lot of people better!
submitted by frostfire1337 to learnprogramming [link] [comments]

Ideas about features which may be useful for Rust

I've recently discovered rust and I think it's awesome language! My head is full of ideas regarding it's development and I'd like to discuss them and know what do you, more expe rienced guys, think.
First, let me tell you some background. During several years of programming in C++ I started to pay attention to most common mistakes I did (uninitialized variables, memory management, resource management...), language features I missed (more inteligent for loops, compile-time reflection...) and ergonomy of language (shared_ptr is horrible). This led me to thinking about how better programming language could look like and considering it's development. Then my friend told me about Rust and to my surprise, it has MANY features that I wanted and many things are even better.
So here is list of my ideas. Please keep in mind that I don't want to push them into Rust, I'm just interested in your opinion, pros/cons. If some idea is useful feel free to implement it.
I think I've covered all of my important ideas. I will add others if I forgot something. I'm looking forward to discussion.
submitted by kixunil to rust [link] [comments]

Tree-chains Preliminary Summary - Peter Todd

Reposted from the Bitcoin development list on mailarchive.com. The author is Peter Todd.
https://www.mail-archive.com/[email protected]/msg04388.html

Tree-chains Preliminary Summary


Bitcoin doesn't scale. There's a lot of issues at hand here, but the most fundemental of them is that to create a block you need to update the state of the UTXO set, and the way Bitcoin is designed means that updating that state requires bandwidth equal to all the transaction volume to keep up with the changes to what set. Long story short, we get O(n2) scaling, which is just plain infeasible.
So let's split up the transaction volume so every individual miner only needs to keep up with some portion. In a rough sense that's what alt-coins do - all the tipping microtransactions on Doge never have to hit the Bitcoin blockchain for instance, reducing pressure on the latter. But moving value between chains is inconvenient; right now moving value requires trusted third parties. Two-way atomic chain transfers does help here, but as recent discussions on the topic showed there's all sorts of edge cases with reorganizations that are tricky to handle; at worst they could lead to inflation.
So what's the underlying issue there? The chains are too independent. Even with merge-mining there's no real link between one chain and another with regard to the order of transactions. Secondly merge-mining suffers from 51% attacks if the chain being merge-mined doesn't have a majority of total hashing power... which kinda defeats the point if we're worried about miner scalability.

Blocks and the TXO set as a binary radix tree

So how can we do better? Start with the "big picture" idea and take the linear blockchain and turn it into a tree:
 ┌───────┴───────┐ ┌───┴───┐ ┌───┴───┐ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ ┌─┴─┐ ┌┴┐ ┌┴┐ ┌┴┐ ┌┴┐ ┌┴┐ ┌┴┐ ┌┴┐ ┌┴┐ 
Obviously if we could somehow split up the UTXO set such that individual miners/full nodes only had to deal with subsets of this tree we could significantly reduce the bandwidth that any one miner would need to process. Every transaction output would get a unique identifier, say txoutid=H(txout) and we put those outputs in blocks appropriately.
We can't just wave a magic wand and say that every block has the above structure and all miners co-ordinate to generate all blocks in one go. Instead we'll do something akin to merge mining. Start with a linear blockchain with ten blocks. Arrows indicate hashing:
a0 ⇽ a1 ⇽ a2 ⇽ a3 ⇽ a4 ⇽ a5 ⇽ a6 ⇽ a7 ⇽ a8 ⇽ a9 
The following data structure could be the block header in this scheme. We'll simplify things a bit and make up our own; obviously with some more effort the standard Satoshi structures can be used too:
struct BlockHeader: uint256 prevBlockHash uint256 blockContentsHash uint256 target uint256 nonce uint time 
For now we'll say this is a pure-proof-of-publication chain, so our block contents are very simple:
struct BlockContents: uint256 merkleRoot 
As usual the PoW is valid if H(blockHeader) < blockHeader.target. Every block creates new txouts, and the union of all such txouts is the txout set. As shown previously(1) this basic proof-of-publication functionality is sufficient to build a crypto-currency even without actually validating the contents of the so-called transaction outputs.
The scalability of this sucks, so let's add two more chains below the root to start forming a tree. For fairness we'll only allow miners to either mine a, a+b, or a+c; attempting to mine a block with both the b and c chains simultaneously is not allowed.
struct BlockContents: uint256 childBlockHash # may be null bool childSide # left or right uint256 merkleRoot 
Furthermore we shard the TXO space by defining txoid = H(txout) and allowing any txout in chain a, and only txouts with LSB=0 in b, LSB=1 in c; the beginning of a binary radix tree. With some variance thrown in we get the following:
 b0 ⇽⇽ b1 ⇽⇽⇽⇽⇽ b2 ⇽ b3 ⇽ b4 ⇽ b5 ⇽ b6 ⇽ b7 ⇽ b8 ↙ ↙ a0 ⇽ a1 ⇽ a2 ⇽ a3 ⇽⇽⇽⇽⇽⇽ a4 ⇽ a5 ⇽ a6 ⇽ a7 ⇽ a8 ↖ ↖ ↖ ↖ ↖ c0 ⇽ c1 ⇽ c2 ⇽ c3 ⇽⇽⇽⇽⇽⇽ c4 ⇽ c5 ⇽ c6 ⇽⇽⇽⇽⇽⇽ c7 
We now have three different versions of the TXO set: ∑a, ∑a + ∑b, and ∑a+∑c. Each of these versions is consistent in that for a given txoutid prefix we can achieve consensus over the contents of the TXO set. Of course, this definition is recursive:
a0 ⇽ a1 ⇽ a2 ⇽ a3 ⇽⇽⇽⇽⇽⇽ a4 ⇽ a5 ⇽ a6 ⇽ a7 ⇽ a8 ↖ ↖ ↖ ↖ ↖ c0 ⇽ c1 ⇽ c2 ⇽ c3 ⇽⇽⇽⇽⇽⇽ c4 ⇽ c5 ⇽ c6 ⇽⇽⇽⇽⇽⇽ c7 ↖ ↖ ↖ ↖ ↖ d0 ⇽ d1 ⇽⇽⇽⇽⇽⇽ d2 ⇽⇽⇽⇽⇽⇽ d3 ⇽ d4 ⇽⇽⇽ d5 ⇽⇽⇽⇽ d6 
Unicode unfortunately lacks 3D box drawing at present, so I've only shown left-sided child chains.

Herding the child-chains

If all we were doing was publishing data, this would suffice. But what if we want to syncronize our actions? For instance, we may want a new txout to only be published in one chain if the corresponding txout in another is marked spent. What we want is a reasonable rule for child-chains to be invalidated when their parents are invalidated so as to co-ordinate actions across distant child chains by relying on the existance of their parents.
We start by removing the per-chain difficulties, leaving only a single master proof-of-work target. Solutions less than target itself are considered valid in the root chain, less than the target << 1 in the root's children, << 2 in the children's children etc. In children that means the header no longer contains a time, nonce, or target; the values in the root block header are used instead:
struct ChildBlockHeader: uint256 prevChildBlockHash uint256 blockContentsHash 
For a given chain we always choose the one with the most total work. But to get our ordering primitive we'll add a second, somewhat brutal, rule: Parent always wins.
We achieve this moving the child block header into the parent block itself:
struct BlockContents: ChildBlockHeader childHeader # may be null (zeroed out) bool childSide # left or right bytes txout 
Let's look at how this works. We start with a parent and a child chain:
a0 ⇽ a1 ⇽ a2 ⇽ a3 ↖ ↖ b0 ⇽ b1 ⇽ b2 ⇽ b3 ⇽ b4 ⇽ b5 
First there is the obvious scenario where the parent chain is reorganized. Here our node learns of a2 ⇽ a3' ⇽ a4':
 ⇽ a3' ⇽ a4' a0 ⇽ a1 ⇽ a2 ⇽ a3 ⇽ X ↖ ↖ b0 ⇽ b1 ⇽ b2 ⇽ b3 ⇽ X 
Block a3 is killed, resulting in the orphaning of b3, b4, and b5:
a0 ⇽ a1 ⇽ a2 ⇽ a3' ⇽ a4' ↖ b0 ⇽ b1 ⇽ b2 
The second case is when a parent has a conflicting idea about what the child chian is. Here our node receives block a5, which has a conflicting idea of what child b2 is:
a0 ⇽ a1 ⇽ a2 ⇽ a3' ⇽ a4' ⇽ a5 ↖ ↖ b0 ⇽ b1 ⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽ b2' ⇽ b2 ⇽ X 
As the parent always wins, even multiple blocks can get killed off this way:
a0 ⇽ a1 ⇽ a2 ⇽ a3 ⇽ a4 ↖ b0 ⇽ b1 ⇽ b2 ⇽ b3 ⇽ b4 ⇽ b5 ⇽ b6 ⇽ b7 
a0 ⇽ a1 ⇽ a2 ⇽ a3 ⇽ a4 ⇽ a5 ↖ ↖ b0 ⇽ b1 ⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽ b2' ⇽ b2 ⇽ b3 ⇽ b4 ⇽ b5 ⇽ X 
This behavior is easier to understand if you say instead that the node learned about block b2', which had more total work than b2 as the sum total of work done in the parent chain in blocks specifying the that particular child chain is considered before comparing the total work done in only the child chain.
It's important to remember that the parent blockchain has and validates both childrens' block headers; it is not possible to mine a block with an invalid secret of child headers. For instance with the following:
a0 ⇽ a1 ⇽ a2 ⇽ a3 ⇽ a4 ↖ ↖ ↖ b0 ⇽ b1 ⇽ b2 ⇽ b3 ⇽ b4 ⇽ b5 ⇽ b6 ⇽ b7 
I can't mine block a5 that says following b2 is b2' in an attempt to kill off b2 through b7.

Token transfer with tree-chains

How can we make use of this? Lets start with a simple discrete token transfer system. Transactions are simply:
struct Transaction: uint256 prevTxHash script prevPubKey script scriptSig uint256 scriptPubKeyHash 
We'll say transactions go in the tree-chain according to their prevTxHash, with the depth in the tree equal to the depth of the previous output. This means that you can prove an output was created by the existance of that transaction in the block with prefix matching H(tx.prevTxHash), and you can prove the transaction output is unspent by the non-existance of a transaction in the block with prefix matching H(tx).
With our above re-organization rule everything is consistent too: if block bi contains tx1, then the corresponding block c_j can contain a valid tx2 spending tx1 provided that c_j depends on a_p and there is a path from a_p to b(i+k). Here's an example, starting with tx1 in c2:
 b0 ⇽⇽⇽⇽⇽⇽ b1 ↙ a0 ⇽ a1 ⇽ a2 ↖ c0 ⇽ c1 ⇽ c2 
Block b2 below can't yet contain tx2 because there is no path:
 b0 ⇽⇽⇽⇽⇽⇽ b1 ⇽ b2 ↙ a0 ⇽ a1 ⇽ a2 ↖ c0 ⇽ c1 ⇽ c2 
However now c3 is found, whose PoW solution was also valid for a3:
 b0 ⇽⇽⇽⇽⇽⇽ b1 ⇽ b2 ↙ a0 ⇽ a1 ⇽ a2 ⇽ a3 ↖ ↖ c0 ⇽ c1 ⇽ c2 ⇽ c3 
Now b3 can contain tx2, as b3 will also attempt to create a4, which depends on a3:
 b0 ⇽⇽⇽⇽⇽⇽ b1 ⇽ b2 ⇽ b3 ↙ a0 ⇽ a1 ⇽ a2 ⇽ a3 ↖ ↖ c0 ⇽ c1 ⇽ c2 ⇽ c3 
Now that a3 exists, block c2 can only be killed if a3 is, which would also kill b3 and thus destroy tx2.

Proving transaction output validity in a token transfer system

How cheap is it to prove the entire history of a token is valid from genesis? Perhaps surprisingly, without any cryptographic moon-math the cost is only linear!
Remember that a transaction in a given chain has committed to the chain that it can be spent in. If Alice is to prove to Bob that the output she gave him is valid, she simply needs to prove that for every transaction in the histroy of the token the token was created, remained unspent, then finally was spent. Proving a token remained unspent between blocks b_n and b_m is trivially possible in linear size. Once the token is spent nothing about blocks beyond b_m is required. Even if miners do not validate transactions at all the proof size remains linear provided blocks themselves have a maximum size - at worst the proof contains some invalid transactions that can be shown to be false spends.
While certainly inconvenient, it is interesting how such a simple system appears to in theory scale to unlimited numbers of transactions and with an appropriate exchange rate move unlimited amounts of value. A possible model would be for the the tokens themselves to have power of two values, and be split and combined as required.

The lost data problem

There is however a catch: What happens when blocks get lost? Parent blocks only contain their childrens' headers, not the block contents. At some point the difficulty of producing a block will drop sufficiently for malicious or accidental data loss to be possible. With the "parent chain wins" rule it must be possible to recover from that event for mining on the child to continue.
Concretely, suppose you have tx1 in block c2, which can be spent on chain b. The contents of chain a is known to you, but the full contents of chain b are unavailable:
 b0 ⇽ b1 (b) (b) ↙ ↙ ↙ a0 ⇽ a1 ⇽ a2 ⇽ a3 ⇽ a4 ⇽ a5 ↖ ↖ c0 ⇽ c1 ⇽ c2 ⇽ c3 ⇽ c4 ⇽ c5 
Blocks a3 and a4 are known to have children on b, but the contents of those children are unavailable. We can define some ratio of unknown to known blocks that must be proven for the proof to be valid. Here we show a 1:1 ratio:
 ⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽⇽ b0 ⇽ b1 (b) (b) b2 ⇽ b3 ⇽ b4 ⇽ b5 ⇽ b6 ⇽ b7 ↙ ↙ ↙ ↙ ↙ ↙ a0 ⇽ a1 ⇽ a2 ⇽ a3 ⇽ a4 ⇽ a5 ⇽ a6 ⇽ a7 ⇽ a8 ⇽ a9 ↖ ↖ ↖ c0 ⇽ c1 ⇽ c2 ⇽ c3 ⇽ c4 ⇽ c5 ⇽ c6 ⇽ c7 ⇽ c8 ⇽ c9 
The proof of now shows that while a3 and a4 has b-side blocks, by the time you reach b6 those two lost blocks were in the minority. Of course a real system needs to be careful that mining blocks and then discarding them isn't a profitably way to create coins out of thin air - ratios well in excess of 1:1 are likely to be required.

Challenge-response resolution

Another idea is to say if the parent blockchain's contents are known we can insert a challenge into it specifying that a particular child block be published verbatim in the parent. Once the challenge is published further parent blocks may not reference that children on that side until either the desired block is re-republished or some timeout is reached. If the timeout is reached, mining backtracks to some previously known child specified in the challenge. In the typical case the block is known to a majority of miners, and is published, essentially allowing new miners to force the existing ones to "cough up" blocks they aren't publishing and allow the new ones to continue mining. (obviously some care needs to be taken with regard to incentives here)
While an attractive idea, this is our first foray into moon math. Suppose such a challenge was issued in block a2, asking for the contents of b1 to be published. Meanwhile tx1 is created in block c3, and can only be spent on a b-side chain:
 b0 ⇽ b1 ↙ a0 ⇽ a1 ⇽ (a2) ⇽ a3 ↖ c0 ⇽ c1 ⇽ c2 ⇽ c3 
The miners of the b-chain can violate the protocol by mining a4/b1', where b1' appears to contain valid transaction tx2:
 b0 ⇽ b1 b1' ↙ ↙ a0 ⇽ a1 ⇽ (a2) ⇽ a3 ⇽ a4 ↖ c0 ⇽ c1 ⇽ c2 ⇽ c3 
A proof of tx2 as valid payment would entirely miss fact that the challenge was published and thus not know that b1' was invalid. While I'm sure the reader can come up with all kinds of complex and fragile way of proving fraud to cause chain a to be somehow re-organized, what we really want is some sub-linear proof of honest computation. Without getting into details, this is probably possible via some flavor of sub-linear moon-math proof-of-execution. But this paper is too long already to start getting snarky.

Beyond token transfer systems

We can extend our simple one txin, one txout token transfer transactions with merkle (sum) trees. Here's a rough sketch of the concept:
input #1─┐ ┌─output #1 ├┐ ┌┤ input #2─┘│ │└─output #2 ├─┤ input #3─┐│ │┌─output #3 ├┘ └┤ input #4─┘ └─output #4 
Where previously a transaction committed to a specific transaction output, we can make our transactions commit to a merkle-sum-tree of transaction outputs. To then redeem a transaction output you prove that enough prior outputs were spend to add up to the new output's value. The entire process can happen incrementally without any specific co-operation between miners on different parts of the chain, and inputs and outputs can come from any depth in the tree provided that care is taken to ensure that reorganization is not profitable.
Like the token transfer system proving a given output is valid has cost linear with history. However we can improve on that using non-interactive proof techniques. For instance in the linear token transfer example the history only needs to be proven to a point where the transaction fees are higher than the value of the output. (easiest where the work required to spend a txout of a given value is well defined) A similar approach can be easily taken with the directed-acyclic-graph of mutliple-input-output transactions. Secondly non-interactive proof techniques can also be used, again out of the scope of this already long preliminary paper.
1) "Disentangling Crypto-Coin Mining: Timestamping, Proof-of-Publication, and Validation",
submitted by isysd to Blocktrees [link] [comments]

My attempt at neural databases.. Would love donations =)

#include  #include  #include  // bitcoin donations welcomed @ 16SQczdZdVETq5LsHxKQ3CM8YXhhxkj58k // by unidef #define ARRAY_SIZE 10000000000 // good luck. this is supposed to be a big number #define ARRAY [ARRAY_SIZE] struct node { double long *data[ARRAY_SIZE][ARRAY_SIZE]; // as many dimensions wanted char *description; // description of node struct node *up; struct node *down; struct node *left; struct node *right; // etc, add additional dimension in whatever x dimension }; struct neural { int *data ARRAY ARRAY; // hopefully that works. passes through emacs+company int *description; // description of neural network variable struct node *prev; struct node *next; // etc }; // hacks.h void *malloc(); // overload malloc for dirty hacks // // prototype functions void *move(double long, double long); // add extra dimensions void *sort(); void *rearrange(); void *delete(); int main(){ struct neural *AI[ARRAY],*sql[ARRAY]; // add as many dimensions as possible AI[0] = malloc(sizeof(neural)); sql[0] = malloc(sizeof(neural)); // add high preformance algorythms to navigate neural variables } 
feedback welcome!
submitted by unsignedint1024 to cprogramming [link] [comments]

Bitcoin Vault Three Private Key Security Structure - YouTube Embedded Software: C Structures Week10 1 Struct&union How To Get FREE BITCOIN? 5 Ways! 💰 - YouTube What is Bitcoin? Bitcoin Explained Simply for Dummies ...

Coinbase is a secure platform that makes it easy to buy, sell, and store cryptocurrency like Bitcoin, Ethereum, and more. Based in the USA, Coinbase is available in over 30 countries worldwide. Padding aligns structure members to "natural" address boundaries - say, int members would have offsets, which are mod(4) == 0 on 32-bit platform. Padding is on by default. It inserts the following "gaps" into your first structure: struct mystruct_A { char a; char gap_0[3]; /* inserted by compiler: for alignment of b */ int b; char c; char gap_1[3]; /* -"-: for alignment of the whole struct in ... Hooray! Someone who understands that C and C++ are (very) different languages! (Of course I'm talking about the compiler :P) – Manu343726 May 4 '14 at 22:31 Bitcoin puts the current compact-format target and the arbitrary-precision "extraNonce" number there, which increments every time the Nonce field in the block header overflows. Outputs can be anything, but Bitcoin creates one exactly like an IP address transaction. The extranonce contributes to enlarge the domain for the proof of work function. Miners can easily modify nonce (4byte), timestamp ... Because you defined the struct as consisting of char arrays, the two strings are the structure and freeing the struct is sufficient, nor is there a way to free the struct but keep the arrays. For that case you would want to do something like struct { char *firstName, *lastName; }, but then you need to allocate memory for the names separately and handle the question of when to free that memory.

[index] [19734] [4357] [4083] [11062] [15735] [18855] [8923] [8018] [44449] [24357]

Bitcoin Vault Three Private Key Security Structure - YouTube

Bybit bis zu $390 Bonus: https://www.bybit.com/app/register?ref=RPyME Bybit Tutorial: https://www.youtube.com/watch?v=k0MWynMHUF8&t= 👇🏻Unterstütze den Kana... 🔥 TOP Crypto TIPS In My Newsletter 👉 https://signup.coinbureau.com/newsletter 💰 Get A Ruby Card Or Better & Get $50 FREE Here 👉 https://www.coinbureau.com ... Bitcoin Vault Three Private Key Security Structure Get started mining today.. get daily BTCV to your wallet every day.. https://me.miningcity.com/referral-re... Start trading Bitcoin and cryptocurrency here: http://bit.ly/2Vptr2X Bitcoin is the first decentralized digital currency. All Bitcoin transactions are docume... 🔥 BLACK FRIDAY 🔥 -40% sur tout notre site avec le code BF40 : https://www.cryptelite.fr ⚡️ Recevez tous nos signaux de trading, apprenez et gagner à nos côté...