Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nakamoto: NakamotoStacksBlock and NakamotoStacksBlockHeader structs #3858

Closed
kantai opened this issue Aug 22, 2023 · 4 comments
Closed

Nakamoto: NakamotoStacksBlock and NakamotoStacksBlockHeader structs #3858

kantai opened this issue Aug 22, 2023 · 4 comments

Comments

@kantai
Copy link
Member

kantai commented Aug 22, 2023

NakamotoStacksBlockHeader should contain:

  1. A producer signature field
  2. A stacker signature field
  3. A state root hash
  4. A bitcoin block hash
  5. The parent stacks block hash
  6. A version number (u8)
  7. TX merkle root (sha512/256)
  8. Stacks fork length so far
  9. BTC spent on this fork so far
  10. VRF proof

The NakamotoStacksBlock will be struct containing the block header and
a Vec of the transactions (similar to the existing StacksBlock struct).

@kantai kantai added this to the Mockamoto milestone Aug 22, 2023
@jcnelson jcnelson self-assigned this Sep 5, 2023
@kantai kantai self-assigned this Sep 6, 2023
@kantai
Copy link
Member Author

kantai commented Sep 6, 2023

Per the updates to Nakomoto's block selection (#3892):

Nakamoto Stacks blocks will have a different wire format than Stacks blocks and microblocks today. In particular, the header will contain:

  1. A version number
  2. The length of the chain as of this tip
  3. The total BTC spent producing this tip
  4. The StacksBlockId of the parent Stacks block
  5. The Bitcoin block hash of the Bitcoin block that triggered the start of the tenure in which they were mined
  6. A recoverable ECDSA signature from the tenure’s miner
  7. The root of a SHA512/256 Merkle tree constructed over all of its contained transactions
  8. The SHA512/256 root hash of the MARF once all of the contained transactions are processed

As before, the Stacks blockchain will continue to calculate a consensus hash for each sortition. The StacksBlockId of a Stacks block would simply be the SHA512/256 of the block’s associated sortition’s consensus hash and the hash of the block header.

Absent from this header is the VRF proof. Instead, this information will be put into the Nakamoto Coinbase transaction.

@EmbeddedAndroid
Copy link

Is this in progress? I don't seem to find a PR implementing this yet, but maybe I missed it.

@kantai
Copy link
Member Author

kantai commented Oct 17, 2023

That's this PR: #3933

@saralab
Copy link
Contributor

saralab commented Nov 3, 2023

Closing this, merged in this PR: #3933

@saralab saralab closed this as completed Nov 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants