Bitcoin Forum
November 16, 2018, 08:44:19 AM *
News: Latest Bitcoin Core release: 0.17.0 [Torrent].
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1] 2 3 4 5 6 7 8 9 »
1  Bitcoin / Development & Technical Discussion / Re: How exactly are forks resolved in bitcoin? on: November 05, 2018, 11:30:17 PM
Your description is correct - the UTXO set is reverted to the previous state and then updated for the blocks in the new chain branch.  Reverting is done by means of "undo data" that is stored along each block by Bitcoin Core - and that keeps all the information necessary to revert changes made (e.g. outputs that have been spent in the block and were thus removed from the UTXO set, so that they can be added back in).

Oh i see its quite an obvious answer  Roll Eyes. thanks
2  Bitcoin / Development & Technical Discussion / How exactly are forks resolved in bitcoin? on: November 05, 2018, 06:28:30 PM
so say there is one block 1500. the next block published is 1501_a. but at the same time another block is published 1501_b.
a node recieves 1501_a first and stores it as the main chain. but the next block is actually mined on top of 1502_b.

so now the node has to revert any changes made with block 1501_a. and change it so that it never happened but was instead 1501_b and then 1502_b.

how does the node revert the changes exactly?

the only thing i can think that has to be changed are, the utxo set would need to be edited to go back to 1500. and then 1501_b, 1502_b.
and the last block hash has to be changed to 1502_b as well as deleting 1501_b.

but how is the utxo set reverted? it means that utxos that were spent and deleted from the db after block 1502_a was processed, will have to some how be recovered again. how is this done?
3  Bitcoin / Development & Technical Discussion / Re: How does bitcoin store the utxo set? on: November 03, 2018, 03:30:42 PM
IS the utxo set stored independently from the block set?

Yes. It's called chainstate, few call it UTXO set.

how does bitcoin search the db for a given utxo to verify a transaction is legitimate if it just stores the blocks?

By access chainstate, not access blocks

Okay thanks. This seems like something that could be easily optimised no? Instead of having a tonne of duplicated data that is both in the utxo db and blocks db. You could have each block, and each tx that tries to spend utxo's (instead of referencing a previous tx hash), references a block number and position in the block of the tx he is trying to spend. then the client finds the tx and position of the utxo inside the tx and checks the lockscript/unlockscript.
4  Bitcoin / Development & Technical Discussion / How does bitcoin store the utxo set? on: November 03, 2018, 03:17:53 PM
IS the utxo set stored independently from the block set?

so for each block that comes in you store;
block (Key: BlockHash)
then extract each tx and store;
tx (Key: TxHash)

or is it all stored inside blocks? how does bitcoin search the db for a given utxo to verify a transaction is legitimate if it just stores the blocks?
5  Bitcoin / Development & Technical Discussion / Re: How are bitcoin blocks verified? on: October 29, 2018, 09:45:06 AM
Thanks for asking the question there haha. i probably should have gone there first.
Achow explained pretty much what is was looking for anyway Smiley
6  Bitcoin / Development & Technical Discussion / How are bitcoin blocks verified? on: October 28, 2018, 06:10:10 PM
I see in the bitcoin wiki there is something called "script" which compiles down to some bytecode to be run by a very very basic virtual machine.
Does this mean that each block is actually just a string/array of bytes when it comes in and is processed by a node?
so a block in its "true" format would look something like [0x01, 0x04, 0x0f, 0xa1.... etc. ?

and then the node that recieves the block just puts the bytes into the interpreter to be run by the bitcoin VM?
or is there some plaintext involved in the block as well? so it looks something like JSON;
{
   blockhash: 12983092....,
   transactions: [ {8123098...}, {12381923...}],
   timestamp: "08:00:23 12/09/2017"
}

which is correct? a block is pure bytecode or JSON? what would a bitcoincore node understand when receiving a new block?
7  Alternate cryptocurrencies / Bounties (Altcoins) / Re: Finding Development Team For A Project on: October 28, 2018, 09:04:24 AM
Hi everyone


i m finding a DEV team for a project who can able to design n make a blockchain  digital asset with a good securty leval


 

kys
8  Alternate cryptocurrencies / Altcoin Discussion / Re: Smart contract dev that splits payment on: October 16, 2018, 05:49:04 AM
Can someone create a contract that can distribute erc20 tokens to multiple
addresses by Percentage?

Ex.
Addy1 30%
Addy2 52%
Addy3 x%

..and so on.

Yes we will compensate. Please help.


sure, send me a pm. can it do for $59.
9  Bitcoin / Development & Technical Discussion / Re: how is "s" kept as an integer in ECDSA? on: October 09, 2018, 01:31:03 PM
Oh wait. I just realised that all integers belong to a finite integer field of [1, n-1].

So you have to do finite field math or whatever its called.
Quote
The tricky one is division; that is not division on the field of integers followed by a modulus operation. Instead, it involves finding the multiplicative inverse of a number; that is, given b, we find the field member b^−1 such that bb^−1=1. Then, a/b=ab^−1

so thats how k^-1 is calculated. someone please correct me if im wrong... or tell me if im right lol. im still not sure if thats correct
10  Bitcoin / Development & Technical Discussion / how is "s" kept as an integer in ECDSA? on: October 09, 2018, 01:15:06 PM
from wikipedia

Quote
G is a basepoint on a curve.
Alice picks a key; d_{A} and a corresponding pub key; Q_{A} = d_{A} * G

Calculate e = HASH(m), where HASH is a cryptographic hash function, such as SHA-2.
Let z be the L_{n} leftmost bits of e, where L_{n} is the bit length of the group order n.
Select a cryptographically secure random integer k from [1,n-1].
Calculate the curve point (x_1, y_1) = k * G.
Calculate r = x_1 mod n. If r = 0, go back to step 3.
Calculate  s=k^-1(z+rd_{A}) mod n. If s=0, go back to step 3.
The signature is the pair (r,s).

But how can s be an integer since k^-1 will yield a decimal amount (e.g. 123.12347)?
11  Bitcoin / Development & Technical Discussion / Re: How is a bitcoin transaction serialised so that it is ready for signing? on: October 07, 2018, 04:15:15 PM
What are the exact technical steps to serialize a transactions so that it is ready to be signed and the resulting signature is valid?
You mean something like this? https://bitcoin.stackexchange.com/a/32695

This answer is also pretty constructive (And is what the above answer is based on). https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx?noredirect=1&lq=1

The above answer also links an article which is defnitely worth a read. See http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html

I'd be very much interested in seeing a segwit version of this aswell. especially one which uses bech adresses. (If anyone has any links!)

Why does the hex transaction need to be decoded?
Code:
HEX_TRANSACTION="010000000126c07ece0bce7cda0ccd14d99e205f118cde27e83dd75da7b141fe487b5528fb000000008b48304502202b7e37831273d74c8b5b1956c23e79acd660635a8d1063d413c50b218eb6bc8a022100a10a3a7b5aaa0f07827207daf81f718f51eeac96695cf1ef9f2020f21a0de02f01410452684bce6797a0a50d028e9632be0c2a7e5031b710972c2a3285520fb29fcd4ecfb5fc2bf86a1e7578e4f8a305eeb341d1c6fc0173e5837e2d3c7b178aade078ffffffff02b06c191e010000001976a9143564a74f9ddb4372301c49154605573d7d1a88fe88ac00e1f505000000001976a914010966776006953d5567439e5e39f86a0d273bee88ac00000000"

tx_data=HEX_TRANSACTION.decode('hex_codec')
tx_hash=double_sha256(tx_data)

wouldnt the whole process work just as fine as
Code:
tx_hash = double_sha256(HEX_TRANSACTION)
. Whats the reasoning for adding this extra step?
12  Bitcoin / Development & Technical Discussion / How is a bitcoin transaction serialised so that it is ready for signing? on: October 07, 2018, 01:00:57 PM
What are the exact technical steps to serialize a transactions so that it is ready to be signed and the resulting signature is valid?
13  Bitcoin / Development & Technical Discussion / Re: How is a public key calculated from a private key using ecc? on: October 02, 2018, 08:27:33 AM
Yes; u*G is computed in time logarithmic in u, not linear in u as you seem to think.
For instance 13*G is computed as 2 * (2 * (2 * G + G)) + G.

Ah yes. This makes a lot more sense. Thanks.
14  Bitcoin / Development & Technical Discussion / How is a public key calculated from a private key using ecc? on: October 02, 2018, 07:39:21 AM
As I understand it a pub key is calculated by;

u = random number (private key)
(x, y) = G = Base point

uG = P = public key

my question is, if its possible to calculate the pub key with uG then since you are doing u computations already, can't you just calculate the private key from P?
Just brute force G as many times as needed until you arrive at P.

Obviously I am misunderstanding something. Is P calculated in a more efficient way than just u*G?
15  Bitcoin / Development & Technical Discussion / Re: What are the steps to take to publish the solution for blockchain scaling? on: September 11, 2018, 06:59:57 PM
A quick example image that I made with draw.io to explain my views.


Does this not mean that the main chain or "monster chain" as you called it would get insanely big? How does that scale?
16  Bitcoin / Development & Technical Discussion / Re: How to sign a message offline with your private key? on: September 08, 2018, 02:43:11 PM

Ah yes this is just what i was looking for thanks
17  Bitcoin / Development & Technical Discussion / How to sign a message offline with your private key? on: September 08, 2018, 01:16:56 PM
Is there a javascript library that lets you sign and verify a message offline with a bitcoin private key?

e.g.
Code:
import ecc from "ecc-library";

const privateKey = "5K9Rx5LtXrTCo7Rb1ZsE3rKYxinzE5Ge8Rm3xeuyXm8LyjApqyH";
const address = "1EheWoBDtpU46ioGrycKnxAkJZR7xRQ6Bt";
const message = "My message";
const signature = ecc.sign(message, privateKey); //Signs the message
ecc.isValidSignature(signature, message, address); //Checks if signature is valide
18  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] DERO: DAG + Cryptonote + Bulletproofs + SSL + POW + Smart Contracts on: August 01, 2018, 09:03:57 PM
GUI wallet preview.  Wallet is currently under testing (by me and others).  Expect some changes before final release.  Here is a preview of how things look now.



what does clicking on the "smart contract" button do?
19  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] DERO: DAG + Cryptonote + Bulletproofs + SSL + POW + Smart Contracts on: July 15, 2018, 12:35:53 AM
Why is it so hard impossible to refute the things we're saying?

We didn't get fired, burnt, or anything like that. We quit this shit project to make an appropriate stand, and we've already accomplished what we set out to do. We simply set out to inform the community about the disregard and deceit that they receive. However, since the saga continues with things like a woman beater who jokes about drugging children being promoted, I think it's worth simply pointing little things like that out.
I think its pretty obvious you are a schizo and you and mojo are the same person.
20  Alternate cryptocurrencies / Announcements (Altcoins) / Re: [ANN] DERO: DAG + Cryptonote + Bulletproofs + SSL + POW + Smart Contracts on: June 28, 2018, 11:12:22 AM
When will the source code be released? All I ever hear is "in a few days". But the devs said the same thing after atlantis and it turned out to take nearly a month before it was pushed to mainnet. Can we actually expect it to be "in a few days" or not?
Pages: [1] 2 3 4 5 6 7 8 9 »
Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!