Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
node_modules/
dist/
dist-server/
build/
*.tsbuildinfo
.env
Expand Down
10 changes: 10 additions & 0 deletions apps/lch-reference/AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ts-stack agent instructions

This project follows the repository-wide [agent instructions](../../AGENTS.md)
and [contribution policy](../../CONTRIBUTING.md). Read and follow both files
before changing anything in this directory.

Do not add package-local agent or contribution conventions. Put
package-specific technical information in the package README, `docs/`,
`specs/`, or the applicable operator guide, and propose shared policy at the
repository root.
202 changes: 202 additions & 0 deletions apps/lch-reference/DEPLOYMENT.md

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions apps/lch-reference/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:24-bookworm-slim AS build
RUN corepack enable
WORKDIR /workspace
COPY . .
RUN pnpm install --frozen-lockfile --ignore-scripts
RUN pnpm --filter @bsv/lch build && pnpm --filter lch-reference-app build

FROM node:24-bookworm-slim
ENV NODE_ENV=production PORT=4173
WORKDIR /app
COPY --from=build /workspace/apps/lch-reference/dist ./dist
COPY --from=build /workspace/apps/lch-reference/dist-server ./dist-server
EXPOSE 4173
USER node
CMD ["node", "dist-server/nodeServer.js"]
7 changes: 7 additions & 0 deletions apps/lch-reference/Dockerfile.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.git
**/node_modules
**/dist
**/dist-server
**/coverage
**/.turbo
**/.DS_Store
58 changes: 58 additions & 0 deletions apps/lch-reference/LICENSE.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Open BSV License Version 6 – granted by BSV Association, Alpenstrasse 15, 6300
Zug, Switzerland (CHE-427.008.338) ("Licensor"), to you as a user (henceforth
"You", "User" or "Licensee").

For the purposes of this license, the definitions below have the following
meanings:

"Bitcoin Protocol" means the protocol implementation, cryptographic rules,
network protocols, and consensus mechanisms in the Bitcoin White Paper as
described here https://protocol.bsvblockchain.org.

"Bitcoin White Paper" means the paper entitled 'Bitcoin: A Peer-to-Peer
Electronic Cash System' published by 'Satoshi Nakamoto' in October 2008.

"BSV Blockchain" means:

(a) the Bitcoin blockchain containing block height #556767 with the hash
"000000000000000001d956714215d96ffc00e0afda4cd0a96c96f8d802b1662b" and
that contains the longest honest persistent chain of blocks which has been
produced in a manner which is consistent with the rules set forth in the
Network Access Rules; and
(b) the test blockchains that contain the longest honest persistent chains of
blocks which has been produced in a manner which is consistent with the
rules set forth in the Network Access Rules.

"Network Access Rules" or "Rules" means the set of rules regulating the
relationship between BSV Association and the nodes on BSV based on the Bitcoin
Protocol rules and those set out in the Bitcoin White Paper, and available here
https://bsvblockchain.org/network-access-rules.

"Software" means the software the subject of this license, including any/all
intellectual property rights therein and associated documentation files.

BSV Association grants permission, free of charge and on a non-exclusive basis
to any person obtaining a copy of the Software to deal in the Software, including
without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to and conditioned upon the following
conditions:

1 - The text "© BSV Association", and this license shall be included in all
copies or substantial portions of the Software.

2 - The Software, and any software that is derived from the Software or parts
thereof, may only be used exclusively on the BSV Blockchain.

For the avoidance of doubt, this license is granted subject to and conditioned
upon your compliance with these terms only and is limited to uses on the BSV
Blockchain. Any exercise of rights not compliant with these terms including
use not for the BSV Blockchain is deemed outside the scope of the license.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES REGARDING ENTITLEMENT,
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS THEREOF BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
28 changes: 28 additions & 0 deletions apps/lch-reference/LICENSES/BIP-0032-BSD-2-Clause.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
BIP 32: Hierarchical Deterministic Wallets

Author: Pieter Wuille
License: BSD-2-Clause

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above attribution, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above attribution, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Upstream licensing statement:
https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki
26 changes: 26 additions & 0 deletions apps/lch-reference/LICENSES/BIP-0039-MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
BIP 39: Mnemonic code for generating deterministic keys

Authors: Marek Palatinus, Pavol Rusnak, Aaron Voisine, and Sean Bowe
License: MIT

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above attribution, this permission notice and the statement that BIP 39
falls under the MIT License shall be included in all copies or substantial
portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Upstream licensing statement:
https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Open BSV License version 4

Copyright (c) 2023 BSV Blockchain Association ("Bitcoin Association")

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

1 - The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

2 - The Software, and any software that is derived from the Software or parts thereof,
can only be used on the Bitcoin SV blockchains. The Bitcoin SV blockchains are defined,
for purposes of this license, as the Bitcoin blockchain containing block height #556767
with the hash "000000000000000001d956714215d96ffc00e0afda4cd0a96c96f8d802b1662b" and
that contains the longest persistent chain of blocks accepted by this Software and which are valid under the rules set forth in the Bitcoin white paper (S. Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, posted online October 2008) and the latest version of this Software available in this repository or another repository designated by Bitcoin Association,
as well as the test blockchains that contain the longest persistent chains of blocks accepted by this Software and which are valid under the rules set forth in the Bitcoin whitepaper (S. Nakamoto, Bitcoin: A Peer-to-Peer Electronic Cash System, posted online October 2008) and the latest version of this Software available in this repository, or another repository designated by Bitcoin Association

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
58 changes: 58 additions & 0 deletions apps/lch-reference/LICENSES/Teranode-Open-BSV-License-6.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Open BSV License Version 6 – granted by BSV Association, Alpenstrasse 15, 6300
Zug, Switzerland (CHE-427.008.338) ("Licensor"), to you as a user (henceforth
"You", "User" or "Licensee").

For the purposes of this license, the definitions below have the following
meanings:

"Bitcoin Protocol" means the protocol implementation, cryptographic rules,
network protocols, and consensus mechanisms in the Bitcoin White Paper as
described here https://protocol.bsvblockchain.org.

"Bitcoin White Paper" means the paper entitled 'Bitcoin: A Peer-to-Peer
Electronic Cash System' published by 'Satoshi Nakamoto' in October 2008.

"BSV Blockchain" means:

(a) the Bitcoin blockchain containing block height #556767 with the hash
"000000000000000001d956714215d96ffc00e0afda4cd0a96c96f8d802b1662b" and
that contains the longest honest persistent chain of blocks which has been
produced in a manner which is consistent with the rules set forth in the
Network Access Rules; and
(b) the test blockchains that contain the longest honest persistent chains of
blocks which has been produced in a manner which is consistent with the
rules set forth in the Network Access Rules.

"Network Access Rules" or "Rules" means the set of rules regulating the
relationship between BSV Association and the nodes on BSV based on the Bitcoin
Protocol rules and those set out in the Bitcoin White Paper, and available here
https://bsvblockchain.org/network-access-rules.

"Software" means the software the subject of this license, including any/all
intellectual property rights therein and associated documentation files.

BSV Association grants permission, free of charge and on a non-exclusive basis
to any person obtaining a copy of the Software to deal in the Software, including
without limitation the rights to use, copy, modify, merge, publish, distribute,
sublicense, and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to and conditioned upon the following
conditions:

1 - The text "© BSV Association", and this license shall be included in all
copies or substantial portions of the Software.

2 - The Software, and any software that is derived from the Software or parts
thereof, may only be used exclusively on the BSV Blockchain.

For the avoidance of doubt, this license is granted subject to and conditioned
upon your compliance with these terms only and is limited to uses on the BSV
Blockchain. Any exercise of rights not compliant with these terms including
use not for the BSV Blockchain is deemed outside the scope of the license.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES REGARDING ENTITLEMENT,
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS THEREOF BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
15 changes: 15 additions & 0 deletions apps/lch-reference/LICENSES/aes-gcm.js-ISC.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
ISC License

Copyright (c) 2019 Taner Mansur

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
86 changes: 86 additions & 0 deletions apps/lch-reference/LICENSES/bitcoin-sv-879fc8b4.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
Open BSV License Version 5 – granted by BSV Association, Grafenauweg 6, 6300
Zug, Switzerland (CHE-427.008.338) ("Licensor"), to you as a user (henceforth
"You", "User" or "Licensee").

For the purposes of this license, the definitions below have the following
meanings:

"Bitcoin Protocol" means the protocol implementation, cryptographic rules,
network protocols, and consensus mechanisms in the Bitcoin White Paper as
described here https://protocol.bsvblockchain.org.

"Bitcoin White Paper" means the paper entitled 'Bitcoin: A Peer-to-Peer
Electronic Cash System' published by 'Satoshi Nakamoto' in October 2008.

"BSV Blockchains" means:
(a) the Bitcoin blockchain containing block height #556767 with the hash
"000000000000000001d956714215d96ffc00e0afda4cd0a96c96f8d802b1662b" and
that contains the longest honest persistent chain of blocks which has been
produced in a manner which is consistent with the rules set forth in the
Network Access Rules; and
(b) the test blockchains that contain the longest honest persistent chains of
blocks which has been produced in a manner which is consistent with the
rules set forth in the Network Access Rules.

"Network Access Rules" or "Rules" means the set of rules regulating the
relationship between BSV Association and the nodes on BSV based on the Bitcoin
Protocol rules and those set out in the Bitcoin White Paper, and available here
https://bsvblockchain.org/network-access-rules.

"Software" means the software the subject of this licence, including any/all
intellectual property rights therein and associated documentation files.

BSV Association grants permission, free of charge and on a non-exclusive and
revocable basis, to any person obtaining a copy of the Software to deal in the
Software without restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
Software, and to permit persons to whom the Software is furnished to do so,
subject to and conditioned upon the following conditions:

1 - The text "© BSV Association," and this license shall be included in all
copies or substantial portions of the Software.
2 - The Software, and any software that is derived from the Software or parts
thereof, must only be used on the BSV Blockchains.

For the avoidance of doubt, this license is granted subject to and conditioned
upon your compliance with these terms only. In the event of non-compliance, the
license shall extinguish and you can be enjoined from violating BSV's
intellectual property rights (incl. damages and similar related claims).

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES REGARDING ENTITLEMENT,
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS THEREOF BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.


Version 0.1.1 of the Bitcoin SV software, and prior versions of software upon
which it was based, were licensed under the MIT License, which is included below.

The MIT License (MIT)

Copyright (c) 2009-2010 Satoshi Nakamoto
Copyright (c) 2009-2015 Bitcoin Developers
Copyright (c) 2009-2017 The Bitcoin Core developers
Copyright (c) 2017 The Bitcoin ABC developers
Copyright (c) 2018 Bitcoin Association for BSV
Copyright (c) 2023 BSV Association

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19 changes: 19 additions & 0 deletions apps/lch-reference/LICENSES/bn.js-MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Copyright Fedor Indutny, 2015.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
21 changes: 21 additions & 0 deletions apps/lch-reference/LICENSES/brorand-MIT.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
This software is licensed under the MIT License.

Copyright Fedor Indutny, 2014.

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to permit
persons to whom the Software is furnished to do so, subject to the
following conditions:

The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
Loading
Loading