aboutsummaryrefslogtreecommitdiffstats
path: root/src/ark/board.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-05 12:39:05 -0700
committerAdam Soltys <[email protected]>2026-08-05 12:39:05 -0700
commit47919c94e861e98fc5c21956c3c53e896052aea4 (patch)
treee77435dc9065991b242341464c70543bf7f37457 /src/ark/board.js
parent68fd614f8cb404904e1939ab711f7c7ba4350c32 (diff)
downloadcoinosv3-47919c94e861e98fc5c21956c3c53e896052aea4.tar.gz
coinosv3-47919c94e861e98fc5c21956c3c53e896052aea4.zip
Boards show the server their funding tx, as mainnet now insists
Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01M5kFodm9azZJVTQxnkDdKe
Diffstat (limited to 'src/ark/board.js')
-rw-r--r--src/ark/board.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/ark/board.js b/src/ark/board.js
index 7544353..4192716 100644
--- a/src/ark/board.js
+++ b/src/ark/board.js
@@ -49,13 +49,18 @@ export function buildBoard({ userPub, serverPub, amountSat, feeSat, expiryHeight
return { fundingTaproot, exitTaproot, exitTx, sighash };
}
-export async function requestBoardCosign(ark, { amountSat, fundingOutpointRaw, expiryHeight, userPub, pubNonce }) {
+export async function requestBoardCosign(ark, { amountSat, fundingOutpointRaw, expiryHeight, userPub, pubNonce, fundingTxBytes }) {
const w = pbWriter();
w.varintField(1, amountSat);
w.bytesField(2, fundingOutpointRaw);
w.varintField(3, expiryHeight);
w.bytesField(4, userPub);
w.bytesField(5, pubNonce);
+ // Mandatory on mainnet since 0.6.0 (require_board_funding_tx): the server
+ // validates the board outpoint against the funding tx and refuses inputs
+ // that are VTXOs. The txid check ignores witnesses, so the broadcast
+ // (signed) serialization is fine here.
+ if (fundingTxBytes) w.bytesField(6, fundingTxBytes);
const resp = await grpcCall(ark, 'bark_server.ArkService/RequestBoardCosign', w.finish());
const out = {};
for (const { field, value } of pbFields(resp)) {