Skip to content

Conversation

@justin-elementlabs
Copy link

No description provided.

justin-elementlabs and others added 25 commits July 15, 2024 07:29
* Implement `peg-in` graph tx functions

* Use timelock constants
* Add human-readable statuses

* Rephrase statuses
* Add merge POC

* Work on validation

* Add graph validation

* Format

* Add todo comment

* Add todo comment

* `read()`, `save()` and `merge()` implementation

---------

Co-authored-by: ivebeenherebefore <[email protected]>
Co-authored-by: StarDumpling <[email protected]>
* Add merge POC

* Work on validation

* Add graph validation

* Format

* Add todo comment

* Add todo comment

* Work on adding ftp and ftps

* Fix compilation issues

* Clean up cargo deps

* Add sftp (#44)

* Add sftp support

* Fully integrate sftp

---------

Co-authored-by: ivebeenherebefore <[email protected]>

---------

Co-authored-by: ivebeenherebefore <[email protected]>
* Add progress

* Continue debugging

* Fix ftp lib

---------

Co-authored-by: ivebeenherebefore <[email protected]>
* add peg out test

* updated with inscription

* use bitcoin hash

* format
* Add progress

* Continue debugging

* Fix ftp lib

* Try russh

* Rollback russh

* Disable ftp datastores for now

---------

Co-authored-by: ivebeenherebefore <[email protected]>
* Add merge POC

* Work on validation

* Add graph validation

* Format

* Add todo comment

* Add todo comment

* Add MuSig2 nonce handling

* Move nonce handling down to transaction layer, use common key types

* Add partial signatures, refactor

* Add a MuSig2 E2E test

* Update tests after `setup_test()` change

* Add signer key generation sample

* Add n-of-n pubkey generation

* Flesh out the MuSig2 test

* Refactor the client

* Refactor

* Pass the list of keys by reference in the client 'constructor'

* Add a TODO

* Clean up

* Clean up

* Refactored Musig2 (#46)

* Work on refactor

* Update N of N generation

* Work on refactor

* Work on applying nonce and signatures to other txns

* Commit changes

* Finish refactor and clean up

* Fix tests

---------

Co-authored-by: ivebeenherebefore <[email protected]>

* Refactor

* Lint

* Merge musig2 nonces and signatures, save local files to folders

* Save private nonces to local file

* Update some method names

* Wrap musig2 signature into taproot signature

* Change n of n p2wsh to p2tr (#50)

* Change n of n p2wsh to p2tr

* Fix consensus hex

* Fix leaf index

---------

Co-authored-by: ivebeenherebefore <[email protected]>

* Wait for peg-in deposit tx to be mined in musig2 test

* Fix merge

---------

Co-authored-by: ivebeenherebefore <[email protected]>
Co-authored-by: justin-elementlabs <[email protected]>
Co-authored-by: StarDumpling <[email protected]>
* Refactor num blocks per x weeks constant

* Add client peg-out tests
* Reduce console verbosity + reword messages for clarity

* Read private data from local file

* Remove unused function

---------

Co-authored-by: StarDumpling <[email protected]>
* Add nonce signatures

* OsRng is safe to use

* Do not fetch data when instantiating the `BitVMClient`

* Add pub nonce verification

* Rename test file `musig2.rs` to `musig2_peg_in.rs` for consistency

* Do not fail fast on pubnonce verification (get all the failures before returning)

* Send error messages to the error output
* add l2 chain adaptors

* Fix compilation error

* debug pegin events

* feat: add pegin event

* type fixes in peg in event

* fix u256 to amount cast

* add peg out burnt event

* checks length of results

---------

Co-authored-by: ivebeenherebefore <[email protected]>
Co-authored-by: stardustPandora <[email protected]>
* Add merge POC

* Work on validation

* Add graph validation

* Format

* Add todo comment

* Add todo comment

* Add MuSig2 nonce handling

* Move nonce handling down to transaction layer, use common key types

* Add partial signatures, refactor

* Add a MuSig2 E2E test

* Update tests after `setup_test()` change

* Add signer key generation sample

* Add n-of-n pubkey generation

* Flesh out the MuSig2 test

* Refactor the client

* Refactor

* Pass the list of keys by reference in the client 'constructor'

* Add a TODO

* Clean up

* Clean up

* Refactored Musig2 (#46)

* Work on refactor

* Update N of N generation

* Work on refactor

* Work on applying nonce and signatures to other txns

* Commit changes

* Finish refactor and clean up

* Fix tests

---------

Co-authored-by: ivebeenherebefore <[email protected]>

* Refactor

* Lint

* Merge musig2 nonces and signatures, save local files to folders

* Save private nonces to local file

* Update some method names

* Wrap musig2 signature into taproot signature

* Change n of n p2wsh to p2tr (#50)

* Change n of n p2wsh to p2tr

* Fix consensus hex

* Fix leaf index

---------

Co-authored-by: ivebeenherebefore <[email protected]>

* Start v3 graph

* Work on graph v3

* Work on changing connectors and rename _d

* Rename leafs

* Work on transactions

* Finish updating txns to v3 graph

* Remove comment

* Refactor inputs

* Update graphs

* Update status check

* Update peg out graph

* Start updating status

* Graph v3 status progress

* Finish peg out status update

* Update tests

* Remove lib

* Fix integration tests

* Refactor

* Revert unneeded changes

* Update musig tests

* Update musig2 peg out tests

* Fix issues

* Fix merging

* Fix compile errors

* Fixes

---------

Co-authored-by: ivebeenherebefore <[email protected]>
Co-authored-by: franklynot <[email protected]>
Co-authored-by: StarDumpling <[email protected]>
* Add nonce signatures

* OsRng is safe to use

* Do not fetch data when instantiating the `BitVMClient`

* Add pub nonce verification

* Rename test file `musig2.rs` to `musig2_peg_in.rs` for consistency

* Do not fail fast on pubnonce verification (get all the failures before returning)

* Send error messages to the error output

* Add UTs for `verify_public_nonces()`

* Refactor test

* Fixes after the merge

* One more fix after the merge

* Reduce compiler warnings

* Undo the last change in files unrelated to this PR
* Add basic implementation for `check_hash_sig`

* Add separate function for `blake3_160_var_length`

* Add separate function for `sign_hash`

* Complete version of algorithm 9 in On Proving Pairings (BitVM#83)

* resolve build error

* keep local ell_coeffs consistant with remote ark_ec, and move double/add into utils

* two things left: backward compatibility need to be done for arkworks, mul_by_034_with_4_constant_affine need to filled

* fill mul_by_34 instead of mul_by_034_with_4_constant_affine

* add test for fq12_mul_by_34, and some comment for fq12_mu_by_034_with_4_constant

* fix bug for fq12_mul_by_34

* fix bug on from_eval_point

* up

* test for from_eval_point, passed

* update package url for bn254

* add test_ell_by_constant_affine

* test of dual pairing passed!

* remove bn254_ell

* modify tests

* frame of quad_pairing

* refactor: remove unnecessary for loop

* fill utility funcs for quad_pairing

* fix conflicts

* restore

* fix double error

* text: add comments

* add test

* test: update test to use negative value for bias

* text: add comment

* test: add test for affine_double_line

* test: add check test for line type

* refactor: sync with upstream to use new form of script

* refactor: support new form of script for miller loop  in affine space

* refactor: add test for affine space

* fix: use projective mode to fix test error

* test: add test for quad pairing

* test: handle tangent line check logic

* update test

* add debug info

* debug

* debug

* change to use vec for computation

* refactor

* fixed version

* fix frob square bug

* code refactoring

* text: add comment for code

* feat: add pairing verification function

* comment for stack

* f initial value is c inverse

* update f with multiplying c or c inverse

* update comment

* update stack index

* update f

* update comment

* add test

* update test

* text: add comment

* fix index for roll to calculate Frobenius map

* refactor: update stack index

* update comment

* update comment

* update f value at first

* update comment

* fix stack index

* update comment

* add log

* update comment

* update comment

* fix: square f all the time

* this log will cause error, delete it

* update pairing, only use affine mode

* update test to support affine mode

* update test to support affine space for pairing zero test

* update test for miller loop in projective space

* feat: make fflonk verifier support dual pairing in affine space

* get groth16 verifier optimized with affine mode done

* code clean

---------

Co-authored-by: Harry <[email protected]>

* Use `run` function in Winternitz tests

* Add bridge progress (BitVM#79)

* 👩‍🏫 Reorganize bridge modules

* 🤓 Stub out more of implementation components

* Fix compilation error

* remove invalid secret and use existing unspendable pubkey

* 🫣 Progress

* 🏏 Fix errors, create alts

* 🎱 Cargo fix

* ✊ Progress

* 👐 Cargo fix

* 🏅 Post meeting

* 😻 Complete txns

* 😼 Work of refactoring

* 📦 Cargo fix

* 😵 Progress

* 😐 Progress

* 📦 Cargo fix

* 🚀 Progress

* 🤓 Progress

* 👨‍🚀 Progress

* ✂️ Cargo clippy

* 🥍 rustfmt

* 🐙 Progress

* 👨‍🍳 rustfmt

* 👩‍⚖️ Progress

* 🔥 Fix output amounts

* 🧼 Fix op code

* 🤡 fmt

* ❓ Added questions

* Add `peg_in_confirm` and `peg_in_refund` tests

* finish assert tx and add unit test

* fixed bugs and added test cases to disprove tx and burn tx

* fix control block error

* peg in confirm & test

* Refactor `Input` into a struct

* 😼 Fix pub key error by adding new Bitcoin PubKey

* pub key compressed or uncompressed error

* fixed burn tx test case for timelock and added more test cases

* take1 timelock fix & unit test

* clean up

* fixed import

* `peg_in_refund` and `connector_a` fixes

* Add `challenge` tx test

* 🤕 Refactor context

* 🫣 Fix

* 🧼 Fix formatting

* Fix formatting

* Add todo

* Fix function call

* Fix type

* Fix formatting

* Update unspendable

* Format

* Fix burn

* move tests in tests folder

* prettier

* Fixed compilation errors and moved test cases to tests/

* refactoring

* refactoring connector b

* Update messages

* Rust fmt

* Refactor connectors

* Format

* Start updating tests

* Extract network setting from lower level functions

* continue refactoring

* Reorder network param

* Fix tests

* Refactor tests

* Fix formatting

* Format tests

* Fix up a few items

* Implement trait for connectors

* Always use the network provided in context

* Finalize the kick-off tx

* fixed compilation erros

* fix lint

* refactoring tests

* fix lint

* Rename variables

* COmment out incomplete signing code

* Refactor signing

* Restructure components into transactions and connectors

* Rename p2wpkh

* Format

* Replace connector 2 pub key with operator pub key

* Fixes (#23)

* Add codeowners (#24)

* Txn Serialization (#11)

* Fix compilation errors and run rustfmt

* add serialization trait

* add test

* use serde

* remove old version

* eleminate merge differences

* derive serialization for all txns

* Format

* Reorder imports

* feat: use consensus encode

---------

Co-authored-by: ivebeenherebefore <[email protected]>
Co-authored-by: stardustPandora <[email protected]>

* [WIP] Refactor pre-signing functions (#22)

* Refactor pre-signing functions

* Refactor remaining transactions

* Refactor

---------

Co-authored-by: ivebeenherebefore <[email protected]>

* Refactor contexts

* Refactor signing flow

* Fix some compile time issues

* Fix mutable borrow

* Update test setup

* Finish fixing all compile errors

* Refactor contexts (#26)

* Refactor contexts

* Refactor signing flow

* Fix some compile time issues

* Fix mutable borrow

* Update test setup

* Finish fixing all compile errors

* Rename assert leaf to disprove leaf

* Add integration tests (#21)

* Add peg-in integration tests

* Adjust peg-in integration tests

* Fix `add_input_output()` in disprove tx

* Remove input placeholder from challenge tx

* Add kick_off test and integration tests for challenge and disprove

* Add `take1` and `take2` tests

* Refactor tests and adding outputs

* Allow multiple inputs and one output in `challenge` tx

* Refactor adding inputs and output to `challenge` tx

* Refactor integration challenge test to use `add_inputs_and_output()` function

* Allow adding inputs only once in `challenge` tx (#28)

* Allow adding inputs only once in `challenge` tx

* Fix error msg

---------

Co-authored-by: ivebeenherebefore <[email protected]>

* Start on graphs (#27)

* Start on graphs

* Refactor into graph structs

* Commit pseudocode

* Fix compile errors

* Remove graph file

* Fix more warnings work on client

* Rc create graph client (#30)

* Commit progress

* Commit progress

* Start on client (#31)

* Commit progress

* Commit progress

* Merge and fix compile errors

* Update code to be compatible with Script changes

* Small changes to client

* [WIP] Rc create graph - implementation (#29)

* Start on graphs

* Refactor into graph structs

* Commit pseudocode

* Fix compile errors

* Remove graph file

* Fix more warnings work on client

* Fix tests

* Add constants file

* Implement `burn` in `peg_out` graph

* Implement `peg_out` graph remaining txs

---------

Co-authored-by: ivebeenherebefore <[email protected]>

* Add serialization and deserialization to graphs

* Refactor tests to use helper outpoint method (#32)

* Remove unused variables

* Add peg-in statuses and peg-out statuses (#34)

* Work on client syncing (#33)

* Refactor serialization

* Work on integrating Amazon S3

* Finished AWS reading and writing

* Make AWS s3 optional

* Fix test

* Update error handling

* Update warning message

* Delete obsolete files

* Refactor and clean up unused variables

* Remove unused variables

* Try to implement formatter for statuses (#35)

* Try to implement formatter for statuses

* Fix result error

* Remove status

* Delete codeowners

---------

Co-authored-by: aristotleee <[email protected]>
Co-authored-by: StarDumpling <[email protected]>
Co-authored-by: timesaved12345 <[email protected]>
Co-authored-by: mac user <[email protected]>
Co-authored-by: franklynot <[email protected]>
Co-authored-by: stardustPandora <[email protected]>

* First prototype chunking for mul and fflonk

* Rework execute_as_chunks to copy over stack

* Executing chunks now copies over stack; add tests

* Remove dependency on seckey in Winternitz sig verification

* Fix: Remove outdated script chunk execution

* Split up if

* Add some debug info in tests

* Quick fix for if in add()

* Quick fix for double

* Use nested script in restart_if

* Print info to file and set target and tolerance

* Update gitignore and Cargo.toml

* Add from_bytes for U254

* Small cleanup and fixes

* Replace restart_if with selector pattern

* Fix: Unresolved restart_if import

* Optimized Fq multiplication using hints with w-width windowed method (BitVM#87)

* optimized tunable field multiplication using w-width windowed method

* reverted back formatting changes, and added few docstrings

* align comments

* fix: fq-mul (BitVM#86)

* G1 scalar mul optimization (BitVM#88)

* perf: g1_scalar_mul optimization

* add a few comments to G1.scalar_mul

---------

Co-authored-by: fatih <[email protected]>

---------

Co-authored-by: robinlinus <[email protected]>
Co-authored-by: ivebeenherebefore <[email protected]>
Co-authored-by: PayneJoe <[email protected]>
Co-authored-by: Harry <[email protected]>
Co-authored-by: aristotleee <[email protected]>
Co-authored-by: StarDumpling <[email protected]>
Co-authored-by: timesaved12345 <[email protected]>
Co-authored-by: mac user <[email protected]>
Co-authored-by: franklynot <[email protected]>
Co-authored-by: stardustPandora <[email protected]>
Co-authored-by: Lukas <[email protected]>
Co-authored-by: bbist <[email protected]>
Co-authored-by: FatihSolak <[email protected]>
Co-authored-by: Hakan Karakuş <[email protected]>
Co-authored-by: fatih <[email protected]>
@justin-elementlabs justin-elementlabs merged commit b2ef156 into rc Sep 10, 2024
@justin-elementlabs justin-elementlabs deleted the rc-updates branch November 10, 2024 18:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants